Skip to content

Commit d55bc49

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

1 file changed

Lines changed: 38 additions & 42 deletions

File tree

vm-config.md

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

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.
35

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:
6+
## Example
167

178
```
18-
machines:
19-
- ubuntu-vm:
20-
provider: aws # if we want to force provider
21-
count: 1 # ignore if provider is "static"
22-
9+
templates:
10+
ubuntu-vm:
11+
provider:
12+
name: aws
2313
aws:
2414
image: ubuntu-24
2515
16+
centos7:
17+
provider:
18+
name: vagrant
2619
vagrant:
27-
image: ubuntu/focal64
28-
memory: 1024
29-
cpus: 2
20+
box: generic/centos7
3021
31-
static:
32-
hosts: [ ubuntu@8.8.8.8, ubuntu@1.1.1.1 ]
22+
groups:
23+
- myhub:
24+
role: hub
25+
count: 1
26+
spawn-config: ubuntu-vm
27+
cfengine: 3.24.3
28+
scripts: [ ./script.sh ]
29+
30+
- myclient:
31+
role: client
32+
count: 3
33+
bootstrap: myhub
34+
spawn-config: centos7
35+
cfengine: 3.24.3
36+
37+
- other:
38+
role: client
39+
hosts: [ ubuntu@1.1.1.1 ]
40+
bootstrap: myhub
41+
cfengine: 3.24.3
42+
```
3343

34-
packages:
35-
- cfengine-master:
36-
package: cfengine
37-
version: master
38-
bootstrap: myhub # myhub count must be 1
44+
To apply the config:
3945

40-
- git-latest:
41-
package: git
42-
version: latest
46+
`cf-remote up config.yaml`
4347

44-
hubs:
45-
- 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 ]
54-
```
48+
# Future features
49+
50+
- inlining (being able to split config in smaller subtrees)

0 commit comments

Comments
 (0)