ami_pre/init.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Mon, 18 Mar 2013 11:47:15 +0100
changeset 85 8010f73133e5
parent 78 f964fb1a386a
child 91 b7d005a8ef48
permissions -rw-r--r--
corrected bug of grains not filled when using defaults parameters

### unarchived files ###

{% if 'ami.type' not in grains %}
ami.type:
    present:
        - value: {{ salt['state.single']('grains.present', 'ami.type', 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