From: W. Trevor King Date: Tue, 25 Feb 2014 21:40:06 +0000 (-0800) Subject: salt-minion/README.md: Discuss minion caching and sync_all X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d69d9be90f627bd9060b033e4020dd6da46eab41;p=dockerfile.git salt-minion/README.md: Discuss minion caching and sync_all I needed the explicit sync_all with Salt v0.17.0. It's possible that this is a bug that has been (or will be) fixed in future versions. --- diff --git a/salt-minion/README.md b/salt-minion/README.md index 69263fb..8a0e8a8 100644 --- a/salt-minion/README.md +++ b/salt-minion/README.md @@ -6,6 +6,9 @@ The [default master name][master-name] is `salt`, so make sure that resolves appropriately on your Docker host (via DNS or an entry in `/etc/hosts`). +Minion keys +=========== + You have two options for setting up minon keys. The more secure approach is to create and install minion keys on the master: @@ -26,8 +29,35 @@ mount][volume-mount]: The less secure approach is to [auto-accept][] the minion's internally-generated key. +Minion caching +============== + +If you blow away a minion container and replace it with a +freshly-spawned container, you may get errors in the minion logs like: + + Feb 25 20:14:18 salt-minion-0 2014-02-25 20:14:18,257 [salt.fileclient ][INFO ] Fetching file ** done ** 'elasticsearch/init.sls' + Feb 25 20:14:18 salt-minion-0 2014-02-25 20:14:18,289 [salt.state ][INFO ] Executing state file.managed for /etc/portage/package.use/elasticsearch + Feb 25 20:14:18 salt-minion-0 2014-02-25 20:14:18,396 [salt.fileclient ][INFO ] Fetching file ** done ** 'elasticsearch/files/gentoo/package.use' + Feb 25 20:14:18 salt-minion-0 2014-02-25 20:14:18,402 [salt.state ][ERROR ] An exception occurred in this state: Traceback (most recent call last): + File "/usr/lib64/python2.7/site-packages/salt/state.py", line 1305, in call + *cdata['args'], **cdata['kwargs']) + File "/usr/lib64/python2.7/site-packages/salt/states/file.py", line 1157, in managed + dir_mode) + File "/usr/lib64/python2.7/site-packages/salt/modules/file.py", line 2150, in manage_file + __opts__['cachedir']) + File "/usr/lib64/python2.7/site-packages/salt/utils/__init__.py", line 599, in copyfile + '[Errno 2] No such file or directory: {0}'.format(source) + IOError: [Errno 2] No such file or directory: /var/cache/salt/minion/files/base/elasticsearch/files/gentoo/package.use + +That's because the master expects the salt state to be cached on the +old container. To fill in the cache on the new container, you'll want +to [manually sync][sync_all] the minion: + + salt# salt salt-minion-0 saltutil.sync_all + [salt]: http://saltstack.com/community.html [master-name]: http://docs.saltstack.com/ref/configuration/minion.html#master [preseed]: http://docs.saltstack.com/topics/tutorials/preseed_key.html [volume-mount]: http://docs.docker.io/en/latest/use/working_with_volumes/ [auto-accept]: http://docs.saltstack.com/ref/configuration/master.html#auto-accept +[sync_all]: http://docs.saltstack.com/ref/modules/all/salt.modules.saltutil.html#salt.modules.saltutil.sync_all