Add calls to other states (ami_pre and ami_post) in rc.local. These two states
authorPaul Tonelli <paul.tonelli@logilab.fr>
Wed, 27 Mar 2013 17:07:20 +0100
changeset 104 8e06b98b8078
parent 103 212c35d66dcc
child 105 cf42f99ebf05
Add calls to other states (ami_pre and ami_post) in rc.local. These two states prepare the chroot before the modification and clean up afterwards and improved comments.
others/rc.local
--- a/others/rc.local	Tue Mar 26 10:54:04 2013 +0100
+++ b/others/rc.local	Wed Mar 27 17:07:20 2013 +0100
@@ -16,12 +16,15 @@
 ## parse the user-data for ami related information
 /usr/bin/env python /etc/salt/srv/others/ec2_ami_parser.py
 
-## updates hg 
+## update host, get updated code 
 /usr/bin/env salt-call state.highstate
-## should source everything in /var/salt 
+## should source everything in /var/salt
 /usr/bin/env salt-call state.highstate
-## should create the vm 
-/usr/bin/env salt-call state.sls ami_creator 
-#/usr/bin/env salt-call vm_create.create_variation
+## download, untar, resize and mount
+/usr/bin/env salt-call state.sls ami_pre
+## update modify image depending on variation.sls file
+/usr/bin/env salt-call state.sls ami_creator
+## umount, resize and upload if possible
+/usr/bin/env salt-call state.sls ami_post
 
 exit 0