ami_pre/init.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Fri, 15 Mar 2013 14:58:22 +0100
changeset 78 f964fb1a386a
child 85 8010f73133e5
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

### unarchived files ###

{% if 'ami.type' not in grains %}
ami.type:
    grains.present:
        - value : debian
{% endif %}

variation_extracted:
    archive.extracted:
        - name: /mnt/
        - source: salt://variation_{{ grains['ami.type'] }}.tar.gz
        - archive_format: tar
        - tar_options: z
        - if_missing: variation.img

### Resize the partition ###
resize_variation:
    tmp_state.resized:
        - name: /mnt/variation.img
        - size: 3G
        - require:
            - archive.extracted: variation_extracted

###  Directories ###
/mnt/variation:
    file.directory:
        - user: root
        - group: root
        - mode: 755
        - makedirs: True

### Mounts ###
include:
    - ami_pre.mounts
    - ami_pre.files