ami_creator_post.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Mon, 11 Mar 2013 18:23:55 +0100
changeset 64 38b62296b765
parent 59 c062ff185a14
child 66 23a31e4cbb65
permissions -rw-r--r--
corrected error in ami post sls, requirements for unmounts were wrong

### Salt state to check after modifying chroot ###

### deletes ###

policy:
    file.absent:
        - name: /mnt/variation/usr/sbin/policy-rc.d

#01proxy:
#    file.absent:
#        - name: /mnt/variation/etc/apt/apt.conf.d/01proxy

02confold:
    file.absent:
        - name: /mnt/variation/etc/apt/apt.conf.d/02confold

resolv.conf:
    file.absent:
        - name: /mnt/variation/etc/resolv.conf


### Extract necessary files ###

{% for file in salt['file.find']('/mnt/variation/boot/', iname='vmlinuz*') %}
kernel:
    tmp_state.local_managed:
        - name: /mnt/vmlinuz_variation
        - source: {{ file }}
{% endfor %}

{% for file in salt['file.find']('/mnt/variation/boot/', iname='initrd*') %}
initrd:
    tmp_state.local_managed:
        - name: /mnt/initrd_variation
        - source: {{ file }}
{% endfor %}


### umounts ###
umount_chroot_proc:
    tmp_state.umounted:
        - name: /mnt/variation/proc

umount_chroot_devpts:
    tmp_state.umounted:
        - name: /mnt/variation/dev/pts

umount_chroot_slash:
    tmp_state.umounted:
        - name: /mnt/variation
        - require:
            - tmp_state.umounted: umount_chroot_devpts
            - tmp_state.umounted: umount_chroot_proc
            - tmp_state.local_managed: kernel
            - tmp_state.local_managed: initrd
            - file.absent: policy
#            - file.absent: 01proxy_removed
            - file.absent: 02confold
            - file.absent: resolv.conf

### Resize the partition to min ###
resize_variation:
    tmp_state.resized:
        - name: /mnt/variation.img
        - require:
            - tmp_state.unmounted: umount_chroot_slash