Skip to content

Move cloud provider defaults from config.cfg to individual roles #14893

@dguido

Description

@dguido

Summary

config.cfg lines 141-200 contain cloud provider defaults (instance sizes, images, etc.) that logically belong in the individual cloud role's defaults/main.yml files.

Current Structure

# config.cfg lines 141-200
cloud_providers:
  azure:
    size: Standard_B1S
    osDisk:
      type: Standard_LRS
    image:
      publisher: Canonical
      ...
  digitalocean:
    size: s-1vcpu-1gb
    image: "ubuntu-22-04-x64"
  ec2:
    encrypted: true
    size: t2.micro
    ...

Proposed Solution

Move each provider's defaults to roles/cloud-<provider>/defaults/main.yml:

# roles/cloud-digitalocean/defaults/main.yml
cloud_providers:
  digitalocean:
    size: s-1vcpu-1gb
    image: "ubuntu-22-04-x64"

Or flatten the structure:

# roles/cloud-digitalocean/defaults/main.yml
digitalocean_size: s-1vcpu-1gb
digitalocean_image: "ubuntu-22-04-x64"

Benefits

  • Better separation of concerns - each role owns its defaults
  • config.cfg becomes purely user-facing configuration
  • Easier to update provider defaults without touching user config
  • Cleaner role independence

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions