update.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Mon, 18 Mar 2013 11:47:15 +0100
changeset 85 8010f73133e5
parent 83 09fdf067e0b7
child 89 d6f5473f3dc1
permissions -rw-r--r--
corrected bug of grains not filled when using defaults parameters

my_pkgs:
  pkg.installed:
    - pkgs:
      - salt-minion
      - python
      - mercurial
      - tar
      - rsync
      - glance

{% if 'ami.hg_address' not in grains %}
ami.hg_address:
    present:
        - value: {{ salt['state.single']('grains.present', 'ami.hg_address', value='http://hg.logilab.fr/users/ptonelli/srv_salt') }}
{% endif %}

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