Skip to content

Conversation

@victormlg
Copy link
Contributor

@victormlg victormlg commented Dec 22, 2025

No description provided.

Signed-off-by: Victor Moene <victor.moene@northern.tech>
vm-config.md Outdated
Comment on lines 9 to 10
- Atomic config: either all vms created or none. No in-between states.
- Top-down run order
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean by these 2 points.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The idea was that either all the VMs on the config are created, or none are created. There should not be any state where half of the VMs were creating or worse, that the VMs are not attached to the config anymore.
  2. I think that the creation order in the config would be top-down. It's probably redundant to mention it here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Maybe, this is a bit opposite of what is normal in CFEngine. We try to converge, do as much as possible, maybe it will be able to fix something more if you run it one more time, etc.
  2. This should not be a goal / default. In many cases it will be desirable to spawn things in parallel, to speed it up.

@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: [ ubuntu@8.8.8.8, ubuntu@1.1.1.1 ]
      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: [ ubuntu@8.8.8.8, ubuntu@1.1.1.1 ]
      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.

Signed-off-by: Victor Moene <victor.moene@northern.tech>
Comment on lines +3 to +4
## Idempotency:
The user defines a desired state in the form of a config in yaml, and cf-remote makes it a reality. If run against an existing environment, it detects changes and 'repairs' the current state using the configuration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Idempotency:
The user defines a desired state in the form of a config in yaml, and cf-remote makes it a reality. If run against an existing environment, it detects changes and 'repairs' the current state using the configuration.
## Idempotency
The user defines a desired state in the form of a config in yaml, and cf-remote makes it a reality.
If run against an existing environment, it detects changes and 'repairs' the current state using the configuration.


## Example

```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```yml


To apply the config:

`cf-remote up config.yaml`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part should be in triple backticked code block with bash as the language.

To apply the config:

`cf-remote up config.yaml`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add information about how to bring down an environment / destroy VMs.

Maybe add some example (invented) output of how it should look when you run the up command?

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