ami_creator.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Fri, 15 Mar 2013 14:58:22 +0100
changeset 78 f964fb1a386a
parent 68 601c145e6326
child 79 07d85619353a
permissions -rw-r--r--
cut ami_creator_pre into different sls files in folder, made necessary modification: - transformed variables into salt grains when necessary - moved requirements

# /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_rev') %}
{% set ami_hg_revision = salt['grains.item']('ami.hg_rev') %}
        - rev: {{ ami_hg_revision }}
{% endif %}
        - target: /etc/salt/srv
        - require:
            - pkg: my_pkgs