Skip to content

Conversation

@victormlg
Copy link
Contributor

@victormlg victormlg commented Dec 22, 2025

No description provided.

Signed-off-by: Victor Moene <[email protected]>
@olehermanse
Copy link
Member

olehermanse commented Jan 7, 2026

@victormlg Continuing on your example, here is my updated suggestion;

spawn-config:
  - ubuntu-vm:
      provider: aws
      aws:
        image: ubuntu-24
  - local-ubuntu-vm:
      provider: vagrant
      vagrant:
        image: ubuntu/focal64
        memory: 1024
        cpus: 2

groups:
  - cloud-hub:
      role: hub
      spawn-config: ubuntu-vm
      count: 1
      cfengine: 3.24.3
      scripts: [ ./provision.sh ]
  - cloud-clients:
      role: client
      spawn-config: ubuntu-vm
      count: 2
      cfengine: 3.24.3
      bootstrap: cloud-hub
  - local-hub:
      role: hub
      spawn-config: local-ubuntu-vm
      count: 1
      cfengine: 3.24.3
      bootstrap: cloud-hub
  - static-hosts:
      role: client
      cfengine: 3.24.3
      hosts: [ [email protected], [email protected] ]
      bootstrap: cloud-hub

Another alternative instead of spawn-config could be template.

@larsewi larsewi self-requested a review January 7, 2026 16:37
@victormlg
Copy link
Contributor Author

victormlg commented Jan 12, 2026

@victormlg Continuing on your example, here is my updated suggestion;

spawn-config:
  - ubuntu-vm:
      provider: aws
      aws:
        image: ubuntu-24
  - local-ubuntu-vm:
      provider: vagrant
      vagrant:
        image: ubuntu/focal64
        memory: 1024
        cpus: 2

groups:
  - cloud-hub:
      role: hub
      spawn-config: ubuntu-vm
      count: 1
      cfengine: 3.24.3
      scripts: [ ./provision.sh ]
  - cloud-clients:
      role: client
      spawn-config: ubuntu-vm
      count: 2
      cfengine: 3.24.3
      bootstrap: cloud-hub
  - local-hub:
      role: hub
      spawn-config: local-ubuntu-vm
      count: 1
      cfengine: 3.24.3
      bootstrap: cloud-hub
  - static-hosts:
      role: client
      cfengine: 3.24.3
      hosts: [ [email protected], [email protected] ]
      bootstrap: cloud-hub

Another alternative instead of spawn-config could be template.

I agree that this looks cleaner. However doesn't it sacrifice some "power" and flexibility if we want to add more features in the future?

Why precising the provider two times if you mentioned that there should only be one provider option per spawn-config?

      provider: aws
      aws:
        image: ubuntu-24

I think having fully reproducible configs would be useful, especially in a dev environment. For example, if in ./provision.sh script you use some package with a version and your share your cf-remote config, it's not sure that the installed softwares would have the same version. Scripts and static hosts can break reproducibility. We could track the scripts with git.

Lastly, I think that instead of being fixed, the config should be modular. I believe this:

spawn-config:
  - ubuntu-vm:
    provider: aws
    aws:
      image: ubuntu-24
    
groups:
  - cloud-hub
      role: hub
      spawn-config: ubuntu-vm
 

should be synonymous to:

groups:
  - cloud-hub
      role: hub
      spawn-config:
        provider: aws
        aws:
          image: ubuntu-24

Basically, you could create "aliases" to repeat some configuration in a modular way. Not only for spawn-config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants