ami_creator.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Mon, 11 Mar 2013 18:29:08 +0100
changeset 65 0cba5e282f10
parent 59 c062ff185a14
child 68 601c145e6326
permissions -rw-r--r--
wrong call to file.find instead of grains.item in ami creator templates

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


{% if  salt['grains.item']('ami_hg_address') %}
{% set ami_hg_address = salt['grains.item']('ami_hg_address') %}
{% else %}
{% set ami_hg_address = 'http://hg.logilab.fr/users/ptonelli/srv_salt' %}
{% endif %}
hg_ami_creation:
    hg.latest:
        - name: {{ ami_hg_address }}
{% if  salt['grains.item']('ami_hg_revision') %}
{% set ami_hg_revision = salt['grains.item']('ami_hg_revision') %}
        - rev: {{ ami_hg_revision }}
{% endif %}
        - target: /etc/salt/srv
        - require:
            - pkg: my_pkgs