ami_pre/init.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Tue, 26 Mar 2013 10:35:03 +0100
changeset 97 ae24ced33f8e
parent 93 c5be902f46b7
child 108 05f01e1d3341
permissions -rw-r--r--
add the source_hash which is necessary for getting http files in salt modify the path to output

### unarchived files ###

variation_extracted:
    archive.extracted:
        - name: /mnt/output/
{% if 'ami.source_address' in grains and 'ami.source_hash' in grains %}
        - source: {{ grains['ami.source_address'] }}
        - source_hash: {{ grains['ami.source_hash'] }}
{% else %}
        - source: http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64.tar.gz
        - source_hash: md5=http://cloud-images.ubuntu.com/precise/current/MD5SUMS 
{% endif %}
        - archive_format: tar
        - tar_options: z
        - rename_regexp: s/.*\.img/variation.img/


### Resize the partition ###
resize_variation:
    tmp_state.resized:
        - name: /mnt/output/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