ami_creator.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Mon, 11 Mar 2013 16:31:00 +0100
changeset 59 c062ff185a14
parent 54 7e33d0c7f399
child 65 0cba5e282f10
permissions -rw-r--r--
updated and renamed user data options

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


{% if  salt['file.find']('ami_hg_address') %}
{% set ami_hg_address = salt['file.find']('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['file.find']('ami_hg_revision') %}
{% set ami_hg_revision = salt['file.find']('ami_hg_revision') %}
        - rev: {{ ami_hg_revision }}
{% endif %}
        - target: /etc/salt/srv
        - require:
            - pkg: my_pkgs