Demo: SaltStack and Google Compute Engine
Example: Install Apache
1 apache:
2 pkg:
3 - installed
4 service:
5 - running
6 - enable: True
7 - require:
8 - pkg: apache
9
10 /var/www/index.html:
11 file:
12 - managed
13 - source: salt://index.html
14 - require:
15 - pkg: apache
Example: Create a Compute Engine instance
## /etc/salt/cloud.profiles
1 my_minions:
2 minion:
3 master: salt
4 image: debian-7
5 size: n1-standard-1
6 location: us-central1-a
7 make_master: False
8 deploy: True
9 delete_boot_pd: True
10 tags: '["google-io", "salt"]'
11 provider: gce-config
## /etc/salt/demo.map
1 my_minions:
2 - minion1
3 - minion2
## create minions with salt-cloud like this,
salt-cloud -P -m /etc/salt/demo.map