Skip to content

Commit 9ed1624

Browse files
committed
cf-remote config md
Signed-off-by: Victor Moene <victor.moene@northern.tech>
1 parent 4d26a7a commit 9ed1624

1 file changed

Lines changed: 34 additions & 44 deletions

File tree

vm-config.md

Lines changed: 34 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,44 @@
1-
# Indempotent VM spawning config
1+
# Idempotent VM spawning config
22

3-
4-
5-
## Core concepts:
6-
7-
- Fully reproducible and sharable cfengine testing environment
8-
- Should work for dev environment: support for package install and scripts
9-
- Atomic config: either all vms created or none. No in-between states.
10-
- Top-down run order
11-
- VMs bound to config that generated them. Should not manually interfer: VMs should not be destroyed manually and the config should not be modified while VMs are running.
12-
- Should provide abstraction of provider (aws, vagrant, static)
13-
14-
15-
## Example:
3+
## Idempotency:
4+
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.
165

176
```
18-
machines:
19-
- ubuntu-vm:
20-
provider: aws # if we want to force provider
21-
count: 1 # ignore if provider is "static"
22-
7+
templates:
8+
ubuntu-vm:
9+
provider:
10+
name: aws
2311
aws:
2412
image: ubuntu-24
2513
14+
centos7:
15+
provider:
16+
name: vagrant
2617
vagrant:
27-
image: ubuntu/focal64
28-
memory: 1024
29-
cpus: 2
18+
box: generic/centos7
3019
31-
static:
32-
hosts: [ ubuntu@8.8.8.8, ubuntu@1.1.1.1 ]
33-
34-
packages:
35-
- cfengine-master:
36-
package: cfengine
37-
version: master
38-
bootstrap: myhub # myhub count must be 1
39-
40-
- git-latest:
41-
package: git
42-
version: latest
43-
44-
hubs:
20+
groups:
4521
- myhub:
46-
from: ubuntu-vm
47-
install: [ cfengine-master, git-latest ]
48-
scripts: [ ./provision.sh ]
49-
50-
clients:
51-
- myclient:
52-
from: ubuntu-vm
53-
install: [ cfengine-master ]
22+
role: hub
23+
count: 1
24+
spawn-config: ubuntu-vm
25+
cfengine: 3.24.3
26+
scripts: [ ./script.sh ]
27+
28+
- myclient:
29+
role: client
30+
count: 3
31+
bootstrap: myhub
32+
spawn-config: centos7
33+
cfengine: 3.24.3
34+
35+
- other:
36+
role: client
37+
hosts: [ ubuntu@1.1.1.1 ]
38+
bootstrap: myhub
39+
cfengine: 3.24.3
5440
```
41+
42+
# Future features
43+
44+
- inlining (being able to split config in smaller subtrees)

0 commit comments

Comments
 (0)