ami_creator.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Fri, 15 Mar 2013 09:43:42 +0100
changeset 79 07d85619353a
parent 68 601c145e6326
child 84 40a8790380af
permissions -rw-r--r--
modified syntax to go from salt['grains.present']('...') to grains['...'] whichi is MUCH cleaner and removed use of vriables to have only grains

# /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