[all] remove "hard" configuration on host
authorPaul Tonelli <paul.tonelli@logilab.fr>
Tue, 26 Nov 2013 13:57:52 +0100
changeset 184 abef89248f10
parent 183 de34235629b5
child 185 ca037e9e657c
[all] remove "hard" configuration on host With this modification, it is possible to use the ami-builder without changing the host machine configuration
ami_builder.sls
ami_pre/files.sls
others/rc.local
others/user_data_parser.py
variation.minion
--- a/ami_builder.sls	Wed Nov 20 17:04:52 2013 +0100
+++ b/ami_builder.sls	Tue Nov 26 13:57:52 2013 +0100
@@ -9,7 +9,7 @@
     module.run:
         - name: chroot.run
         - path: /mnt/variation
-        - command: salt-call  --local state.highstate
+        - command: salt-call --local state.highstate
         - require:
             - module.run: preparation
 
--- a/ami_pre/files.sls	Wed Nov 20 17:04:52 2013 +0100
+++ b/ami_pre/files.sls	Tue Nov 26 13:57:52 2013 +0100
@@ -100,14 +100,6 @@
         - require:
             - mount.mounted: mounted_variation
 
-minion:
-    file.managed:
-        - name: /mnt/variation/etc/salt/minion
-        - source: salt://variation.minion
-        - mode: 644
-        - require:
-            - mount.mounted: mounted_variation
-
 hg_variation:
     hg.latest:
 {% if 'ami.hg_address_variation' in grains %}
--- a/others/rc.local	Wed Nov 20 17:04:52 2013 +0100
+++ b/others/rc.local	Tue Nov 26 13:57:52 2013 +0100
@@ -23,7 +23,7 @@
         sleep 1
     done
     ## wait until salt-call is not running any longer
-    salt-call --no-color state.highstate | tee -a /var/log/ami-creator.log > /dev/console 2>&1
+    salt-call --no-color --local state.highstate | tee -a /var/log/ami-creator.log > /dev/console 2>&1
 done
 
 while [ `pgrep -c salt-call` -ne 0 ]
@@ -33,7 +33,7 @@
 ## wait until salt-call is not running any longer
 ## download, untar, resize and mount
 ## update modify image depending on variation.sls file
-salt-call --no-color state.sls ami_builder | tee -a /var/log/ami-creator.log > /dev/console 2>&1
+salt-call --no-color --local state.sls ami_builder | tee -a /var/log/ami-creator.log > /dev/console 2>&1
 ## umount, resize and upload if possible
 
 exit 0
--- a/others/user_data_parser.py	Wed Nov 20 17:04:52 2013 +0100
+++ b/others/user_data_parser.py	Tue Nov 26 13:57:52 2013 +0100
@@ -21,7 +21,7 @@
     if isinstance(pair[1],list) and len(pair[1]) > 0:
         pair=(pair[0],pair[1][0])
     if pair[1] != '':
-        Popen(['salt-call', 'grains.setval',
+        Popen(['salt-call', '--local', 'grains.setval',
             pair[0], pair[1]]).wait()
 
 class FakeSecHead(object):
--- a/variation.minion	Wed Nov 20 17:04:52 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-# top file to execute if startup_states is 'top'
-#top_file: ''
-
-#####     File Directory Settings    #####
-##########################################
-# The Salt Minion can redirect all file server operations to a local directory,
-# this allows for the same state tree that is on the master to be used if
-# copied completely onto the minion. This is a literal copy of the settings on
-# the master but used to reference a local directory on the minion.
-
-# Set the file client, the client defaults to looking on the master server for
-# files, but can be directed to look at the local file directory setting
-# defined below by setting it to local.
-file_client: local
-
-# The file directory works on environments passed to the minion, each environment
-# can have multiple root directories, the subdirectories in the multiple file
-# roots cannot match, otherwise the downloaded files will not be able to be
-# reliably ensured. A base environment is required to house the top file.
-
-file_roots:
-  base:
-    - /srv/salt
-
-