ami_creator_post.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Mon, 11 Mar 2013 15:27:04 +0100
changeset 57 28cbe9dbaf1f
parent 54 7e33d0c7f399
child 59 c062ff185a14
permissions -rw-r--r--
added debian config file to avoir conf messages (do you want to replace previously modified config file...)

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

### deletes ###

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

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

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

### 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_removed
            - file.absent: resolvconf_removed
            - file.absent: 01proxy_removed

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