ami_creator.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Fri, 22 Mar 2013 11:38:47 +0100
changeset 92 46707aed3c76
parent 84 40a8790380af
child 96 077e05a2ce8e
permissions -rw-r--r--
removed unused files: the two shortcuts were used to access local debian / ubuntu images

# /srv/salt/init_machine.sls
preparation:
    sls:
        - ami_pre
    require:
        - hg.latest: hg_code

update_variant:
    grains.present: 
        - value: {{ salt['vm_create.update_image']('/mnt/variation') }}
    require:
        - preparation

variate_variant:
    grains.present: 
        - value: {{ salt['vm_create.variate_image']('/mnt/variation') }}
    require:
        - update_variant

cleaning:
    sls:
        - ami_post
    require:
        - variate_variant

{% if  grains['keystone.user'] %}
upload_variant:
    grains.present: 
        - value: {{ salt['vm_create.upload_to_glance']('/mnt/variation') }}
    require:
        - cleaning
{% endif %}