ami_creator.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Fri, 15 Mar 2013 10:17:58 +0100
changeset 83 09fdf067e0b7
parent 79 07d85619353a
child 84 40a8790380af
permissions -rw-r--r--
created additionnal state for preparatory state (update.sls) and updated top.sls salt file to call it instead of ami_creator.sls (ami_creator.sls will actually prepare the machine in next commit)

# /srv/salt/init_machine.sls
my_pkgs:
  pkg.installed:
    - pkgs:
      - salt-minion
      - python
      - mercurial
      - tar
      - rsync
      - glance

{% if 'ami.hg_address' not in grains %}
ami.hg_address:
    grains.present:
        - value : http://hg.logilab.fr/users/ptonelli/srv_salt
{% endif %}

hg_ami_creation:
    hg.latest:
        - name: {{ grains['ami.hg_address'] }}
{% if  grains['ami.hg_rev'] %}
        - rev: {{ grains['ami.hg_rev'] }}
{% endif %}
        - target: /etc/salt/srv
        - require:
            - pkg: my_pkgs