converted ami_creator_post to folder type sls
authorPaul Tonelli <paul.tonelli@logilab.fr>
Thu, 14 Mar 2013 19:53:44 +0100
changeset 81 55f06c0e278c
parent 80 8b298d36c41b
child 82 d1208c3e8b50
converted ami_creator_post to folder type sls
ami_creator_post.sls
ami_post/init.sls
--- a/ami_creator_post.sls	Thu Mar 14 19:52:23 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-### Salt state to check after modifying chroot ###
-
-{% set chroot = '/mnt/variation' %}
-### deletes ###
-
-#01proxy:
-#    file.absent:
-#        - name: {{ chroot }}/etc/apt/apt.conf.d/01proxy
-
-02confold:
-    file.absent:
-        - name: {{ chroot }}/etc/apt/apt.conf.d/02confold
-
-resolv.conf:
-    file.absent:
-        - name: {{ chroot }}/etc/resolv.conf
-
-{% set keyfiles = ['ssh_host_dsa_key', 'ssh_host_dsa_key.pub', 'ssh_host_rsa_key', 'ssh_host_rsa_key.pub'] %}
-{% for file in keyfiles %}
-ssh_host_keys_{{ file }}:
-    file.absent:
-        - name: {{ chroot }}/etc/ssh/{{ file }}
-{% endfor %}
-
-### remove apt caches ###
-{% set bin_caches = salt['file.find'](chroot + '/var/cache/apt/', iname='*bin') %}
-{% for file in bin_caches %}
-apt_cache_{{ file }}:
-    file.absent:
-        - name: {{ file }}
-{% endfor %}
-
-apt_lists:
-    file.absent:
-        - name: {{ chroot }}/var/lib/apt/lists
-
-apt_policy:
-    file.absent:
-        - name: {{ chroot }}/usr/sbin/policy-rc.d
-
-### extract necessary files ###
-
-{% for file in salt['file.find'](chroot + '/boot/', iname='vmlinuz*') %}
-kernel:
-    tmp_state.local_managed:
-        - name: /mnt/kernel_variation
-        - source: {{ file }}
-{% endfor %}
-
-{% for file in salt['file.find'](chroot + '/boot/', iname='initrd*') %}
-initrd:
-    tmp_state.local_managed:
-        - name: /mnt/ramdisk_variation
-        - source: {{ file }}
-{% endfor %}
-
-### umounts ###
-umount_chroot_proc:
-    tmp_state.umounted:
-        - name: {{ chroot }}/proc
-
-umount_chroot_devpts:
-    tmp_state.umounted:
-        - name: {{ chroot }}/dev/pts
-
-umount_chroot_slash:
-    tmp_state.umounted:
-        - name: {{ chroot }}
-        - 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: 01proxy_removed
-            - file.absent: 02confold
-            - file.absent: resolv.conf
-{% for file in keyfiles %}
-            - file.absent: ssh_host_keys_{{ file }}
-{% endfor %}
-{% for file in bin_caches %}
-            - file.absent: apt_cache_{{ file }}
-{% endfor %}
-            - file.absent: apt_lists
-            - file.absent: apt_policy
-
-### Resize the partition to min ###
-resize_variation:
-    tmp_state.resized:
-        - name: {{ chroot }}.img
-        - require:
-            - tmp_state.unmounted: umount_chroot_slash
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ami_post/init.sls	Thu Mar 14 19:53:44 2013 +0100
@@ -0,0 +1,87 @@
+### Salt state to check after modifying chroot ###
+
+{% set chroot = '/mnt/variation' %}
+
+02confold:
+    file.absent:
+        - name: {{ chroot }}/etc/apt/apt.conf.d/02confold
+
+resolv.conf:
+    file.absent:
+        - name: {{ chroot }}/etc/resolv.conf
+
+{% set keyfiles = ['ssh_host_dsa_key', 'ssh_host_dsa_key.pub', 'ssh_host_rsa_key', 'ssh_host_rsa_key.pub'] %}
+{% for file in keyfiles %}
+ssh_host_keys_{{ file }}:
+    file.absent:
+        - name: {{ chroot }}/etc/ssh/{{ file }}
+{% endfor %}
+
+### remove apt caches ###
+{% set bin_caches = salt['file.find'](chroot + '/var/cache/apt/', iname='*bin') %}
+{% for file in bin_caches %}
+apt_cache_{{ file }}:
+    file.absent:
+        - name: {{ file }}
+{% endfor %}
+
+apt_lists:
+    file.absent:
+        - name: {{ chroot }}/var/lib/apt/lists
+
+apt_policy:
+    file.absent:
+        - name: {{ chroot }}/usr/sbin/policy-rc.d
+
+### extract necessary files ###
+
+{% for file in salt['file.find'](chroot + '/boot/', iname='vmlinuz*') %}
+kernel:
+    tmp_state.local_managed:
+        - name: /mnt/kernel_variation
+        - source: {{ file }}
+{% endfor %}
+
+{% for file in salt['file.find'](chroot + '/boot/', iname='initrd*') %}
+initrd:
+    tmp_state.local_managed:
+        - name: /mnt/ramdisk_variation
+        - source: {{ file }}
+{% endfor %}
+
+### umounts ###
+umount_chroot_proc:
+    tmp_state.umounted:
+        - name: {{ chroot }}/proc
+
+umount_chroot_devpts:
+    tmp_state.umounted:
+        - name: {{ chroot }}/dev/pts
+
+umount_chroot_slash:
+    tmp_state.umounted:
+        - name: {{ chroot }}
+        - 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: 01proxy_removed
+            - file.absent: 02confold
+            - file.absent: resolv.conf
+{% for file in keyfiles %}
+            - file.absent: ssh_host_keys_{{ file }}
+{% endfor %}
+{% for file in bin_caches %}
+            - file.absent: apt_cache_{{ file }}
+{% endfor %}
+            - file.absent: apt_lists
+            - file.absent: apt_policy
+
+### Resize the partition to min ###
+resize_variation:
+    tmp_state.resized:
+        - name: {{ chroot }}.img
+        - require:
+            - tmp_state.unmounted: umount_chroot_slash
+