Skip to content
Browse files

Merge branch '0.9.6'

  • Loading branch information...
2 parents b9dc071 + 6804c86 commit c21a93231a9b428b4eea79379d7c133f5b509131 @thatch45 thatch45 committed
Showing with 4,841 additions and 10,404 deletions.
  1. +3 −1 MANIFEST.in
  2. +7 −3 conf/{master → master.template}
  3. +12 −2 conf/{minion → minion.template}
  4. +1 −1 debian/changelog
  5. +29 −21 debian/control
  6. +3 −3 debian/copyright
  7. +3 −0 debian/lintian-overrides
  8. +2 −3 debian/rules
  9. +25 −9 debian/salt-common.install
  10. +1 −0 debian/salt-common.manpages
  11. +6 −1 debian/salt-master.install
  12. +0 −3 debian/{links → salt-master.links}
  13. +2 −3 debian/salt-master.manpages
  14. +4 −4 debian/salt-minion.install
  15. +2 −0 debian/salt-minion.links
  16. +1 −0 debian/salt-syndic.install
  17. +1 −0 debian/salt-syndic.links
  18. +0 −9 debian/salt.manpages
  19. BIN doc/_static/salt-vert.png
  20. +5 −187 doc/_templates/layout.html
  21. +186 −0 doc/_themes/saltstack/layout.html
  22. 0 doc/{_static → _themes/saltstack/static}/base-salt.css
  23. 0 doc/{_static/salt.png → _themes/saltstack/static/salt-horiz.png}
  24. +3 −0 doc/_themes/saltstack/theme.conf
  25. +11 −4 doc/conf.py
  26. +1 −1 doc/man/salt-call.1
  27. +4 −4 doc/man/salt-cp.1
  28. +1 −1 doc/man/salt-key.1
  29. +13 −1 doc/man/salt-master.1
  30. +13 −1 doc/man/salt-minion.1
  31. +1 −1 doc/man/salt-run.1
  32. +1 −1 doc/man/salt-syndic.1
  33. +1 −1 doc/man/salt.1
  34. +3,586 −1,004 doc/man/salt.7
  35. +3 −3 doc/ref/cli/salt-cp.rst
  36. +10 −0 doc/ref/cli/salt-master.rst
  37. +10 −0 doc/ref/cli/salt-minion.rst
  38. +2 −2 doc/ref/configuration/examples.rst
  39. +15 −2 doc/ref/configuration/master.rst
  40. +32 −0 doc/ref/configuration/minion.rst
  41. +8 −2 doc/topics/configuration.rst
  42. +2 −1 doc/topics/index.rst
  43. +114 −99 doc/topics/releases/0.9.5.rst
  44. +6 −0 requirements.txt
  45. +86 −33 salt/__init__.py
  46. +16 −4 salt/config.py
  47. +5 −1 salt/loader.py
  48. 0 salt/log.py
  49. +66 −27 salt/minion.py
  50. +13 −2 salt/modules/apache.py
  51. +67 −27 salt/modules/cmd.py
  52. +26 −15 salt/modules/mysql.py
  53. +118 −0 salt/modules/network.py
  54. +68 −0 salt/modules/nginx.py
  55. +8 −9 salt/modules/solr.py
  56. +90 −0 salt/modules/win_groupadd.py
  57. +0 −20 salt/msgpack/__init__.py
  58. +0 −1 salt/msgpack/__version__.py
  59. +0 −6,762 salt/msgpack/_msgpack.c
  60. +0 −427 salt/msgpack/_msgpack.pyx
  61. +0 −107 salt/msgpack/pack.h
  62. +0 −25 salt/msgpack/pack_define.h
  63. +0 −686 salt/msgpack/pack_template.h
  64. +0 −94 salt/msgpack/sysdep.h
  65. +0 −213 salt/msgpack/unpack.h
  66. +0 −92 salt/msgpack/unpack_define.h
  67. +0 −386 salt/msgpack/unpack_template.h
  68. +1 −1 salt/output.py
  69. +1 −1 salt/payload.py
  70. +1 −1 salt/returners/cassandra_return.py
  71. +13 −5 salt/state.py
  72. +109 −17 salt/states/file.py
  73. 0 salt/states/mysql_database.py
  74. 0 salt/states/mysql_user.py
  75. +8 −2 salt/states/pkg.py
  76. +1 −1 salt/utils/__init__.py
  77. 0 salt/utils/find.py
  78. +1 −17 salt/utils/verify.py
  79. +1 −1 salt/version.py
  80. +1 −1 scripts/salt
  81. +1 −1 scripts/salt-call
  82. +1 −1 scripts/salt-cp
  83. +1 −1 scripts/salt-key
  84. +1 −1 scripts/salt-master
  85. +1 −1 scripts/salt-minion
  86. +1 −1 scripts/salt-run
  87. +1 −1 scripts/salt-syndic
  88. +4 −41 setup.py
View
4 MANIFEST.in
@@ -1 +1,3 @@
-include salt/msgpack/*.h
+include AUTHORS
+include LICENSE
+include README.rst
View
10 conf/master → conf/master.template
@@ -1,3 +1,4 @@
+# DO NOT MODIFY THIS FILE. Copy it to: /etc/salt/master
##### Primary configuration settings #####
##########################################
# The address of the interface to bind to
@@ -6,6 +7,9 @@
# The port used by the publisher
#publish_port: 4505
+# The user to run salt
+#user: root
+
# The number of worker threads to start, these threads are used to manage
# return calls made from minions to the master, if the master seems to be
# running slowly, increase the number of threads
@@ -85,9 +89,9 @@
# prod:
# - /srv/salt/prod/services
# - /srv/salt/prod/states
-#
+#
# Default:
-#file_roots:
+#file_roots:
# base:
# - /srv/salt
@@ -183,7 +187,7 @@
##########################################
# Node groups allow for logical groupings of minion nodes.
# A group consists of a group name and a compound target.
-#
+#
# nodegroups:
# group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com and bl*.domain.com',
# group2: 'G@os:Debian and foo.domain.com',
View
14 conf/minion → conf/minion.template
@@ -1,3 +1,4 @@
+# DO NOT MODIFY THIS FILE. Copy it to: /etc/salt/minion
##### Primary configuration settings #####
##########################################
# Set the location of the salt master server, if the master server cannot be
@@ -7,6 +8,9 @@
# Set the post used by the master reply and authentication server
#master_port: 4506
+# The user to run salt
+#user: root
+
# The root directory prepended to these options: pki_dir, cachedir, log_file.
#root_dir: /
@@ -28,10 +32,16 @@
# Where cache data goes
#cachedir: /var/cache/salt
+# The minion can locally cache the return data from jobs sent to it, this
+# can be a good way to keep track minion side of the jobs the minion has
+# executed. By default this feature is disabled, to enable set cache_jobs
+# to True
+#cache_jobs: False
+
# When waiting for a master to accept the minion's public key, salt will
-# contiuously attempt to reconnect until successful. This is the time, in
+# continuously attempt to reconnect until successful. This is the time, in
# seconds, between those reconnection attempts.
-# acceptance_wait_time = 10
+#acceptance_wait_time = 10
View
2 debian/changelog
@@ -1,4 +1,4 @@
-salt (0.9.5+git20111227.g8182e48-1) unstable; urgency=low
+salt (0.9.5-1) unstable; urgency=low
* First package release. (Closes: #643789)
View
50 debian/control
@@ -7,14 +7,11 @@ Build-Depends: debhelper (>= 7.0.50~),
cython,
python-yaml,
python-setuptools,
- python-yaml,
python-crypto,
python-m2crypto,
python-zmq (>= 2.1.9),
- libzmq1 (>= 2.1.9),
libzmq-dev (>= 2.1.9),
- python (>= 2.6),
- python-dev (>= 2.6),
+ python-all-dev,
python-jinja2
Standards-Version: 3.9.2
Homepage: http://saltstack.org
@@ -24,8 +21,20 @@ Homepage: http://saltstack.org
Package: salt-common
Architecture: any
-Depends: ${python:Depends},
- ${misc:Depends}
+Depends: ${python:Depends},
+ ${misc:Depends},
+ ${shlibs:Depends},
+ python-support,
+ cython,
+ python-setuptools,
+ python-yaml,
+ python-crypto,
+ python-m2crypto,
+ python-zmq (>= 2.1.9),
+ libzmq-dev (>= 2.1.9),
+ python,
+ python-dev,
+ python-jinja2
Description: Shared libraries that salt requires for all packages
This package is a powerful remote execution manager that can be used
to administer servers in a fast and efficient way.
@@ -41,15 +50,14 @@ Description: Shared libraries that salt requires for all packages
Between the remote execution system, and state management Salt addresses
the backbone of cloud and data center management.
.
- This particular package provides shared libraries that salt-master, salt-minion,
- and salt-syndic require to function.
-
+ This particular package provides shared libraries that salt-master,
+ salt-minion, and salt-syndic require to function.
Package: salt-master
Architecture: all
-Depends: ${python:Depends},
- ${misc:Depends},
- salt-common
+Depends: ${misc:Depends},
+ python,
+ salt-common (>= ${source:Version})
Description: This package provides a remote manager to administer servers via salt
This package is a powerful remote execution manager that can be used
to administer servers in a fast and efficient way.
@@ -70,9 +78,9 @@ Description: This package provides a remote manager to administer servers via sa
Package: salt-minion
Architecture: all
-Depends: ${python:Depends},
- ${misc:Depends},
- salt-common
+Depends: ${misc:Depends},
+ python,
+ salt-common (>= ${source:Version})
Description: This package represents the client package for salt
This package is a powerful remote execution manager that can be used
to administer servers in a fast and efficient way.
@@ -93,10 +101,10 @@ Description: This package represents the client package for salt
Package: salt-syndic
Architecture: all
-Depends: ${python:Depends},
- ${misc:Depends},
- salt-master
-Description: salt-syndic represents the master-of-masters for salt
+Depends: ${misc:Depends},
+ python,
+ salt-master (>= ${source:Version})
+Description: This package represents the master-of-masters for salt
This package is a powerful remote execution manager that can be used
to administer servers in a fast and efficient way.
.
@@ -111,5 +119,5 @@ Description: salt-syndic represents the master-of-masters for salt
Between the remote execution system, and state management Salt addresses
the backbone of cloud and data center management.
.
- This particular package provides the master of masters for salt-- it enables the management
- of multiple masters at a time.
+ This particular package provides the master of masters for salt-- it enables
+ the management of multiple masters at a time.
View
6 debian/copyright
@@ -1,10 +1,10 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: salt
-Upstream-Contact: Aaron Toponce <aaron.toponce@gmail.com>
-Source: http://github.com/thatch45/salt/
+Upstream-Contact: salt-users@googlegroups.com
+Source: https://github.com/downloads/saltstack/salt/salt-0.9.5.tar.gz
Files: *
-Copyright: 2011 Thomas S Hatch <thatch45@gmail.com>
+Copyright: 2012 Thomas S Hatch <thatch45@gmail.com>
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
View
3 debian/lintian-overrides
@@ -0,0 +1,3 @@
+salt-common: manpage-has-errors-from-man usr/share/man/man7/salt.7.gz
+# The man page renders correctly, no need for lintian to get upset about
+# it.
View
5 debian/rules
@@ -1,8 +1,7 @@
#!/usr/bin/make -f
-
+#export DH_VERBOSE=1
%:
- dh $@
-
+ dh $@ --buildsystem=python_distutils
#override_dh_installinit:
# dh_installinit --no-start --name="salt-master"
# dh_installinit --no-start --name="salt-minion"
View
34 debian/salt-common.install
@@ -1,9 +1,25 @@
-usr/share/man/man1/salt-minion.1
-usr/share/man/man1/salt-call.1
-usr/share/man/man1/salt-key.1
-usr/share/man/man1/salt-master.1
-usr/share/man/man1/salt-syndic.1
-usr/share/man/man1/salt-cp.1
-usr/share/man/man1/salt.1
-conf/minion /etc/salt/minion
-salt/* /usr/share/salt/
+salt/exceptions.py /usr/share/salt
+salt/loader.py /usr/share/salt
+salt/master.py /usr/share/salt
+salt/client.py /usr/share/salt
+salt/runner.py /usr/share/salt
+salt/output.py /usr/share/salt
+salt/minion.py /usr/share/salt
+salt/version.py /usr/share/salt
+salt/config.py /usr/share/salt
+salt/state.py /usr/share/salt
+salt/log.py /usr/share/salt
+salt/__init__.py /usr/share/salt
+salt/payload.py /usr/share/salt
+salt/crypt.py /usr/share/salt
+salt/runners /usr/share/salt/
+salt/renderers /usr/share/salt/
+salt/returners /usr/share/salt/
+salt/ext /usr/share/salt/
+salt/msgpack /usr/share/salt/
+salt/grains /usr/share/salt/
+salt/cli /usr/share/salt/
+salt/states /usr/share/salt/
+salt/utils /usr/share/salt/
+usr/lib/python2*/dist-packages/salt/msgpack
+debian/lintian-overrides /usr/share/lintian/overrides/salt-common
View
1 debian/salt-common.manpages
@@ -0,0 +1 @@
+doc/man/salt.7
View
7 debian/salt-master.install
@@ -1 +1,6 @@
-conf/master /etc/salt/master
+conf/master.template /etc/salt/master
+scripts/salt-key /usr/share/salt
+scripts/salt /usr/share/salt
+scripts/salt-run /usr/share/salt
+scripts/salt-cp /usr/share/salt
+scripts/salt-master /usr/share/salt
View
3 debian/links → debian/salt-master.links
@@ -1,8 +1,5 @@
usr/share/salt/salt /usr/bin/salt
usr/share/salt/salt-master /usr/bin/salt-master
-usr/share/salt/salt-syndic /usr/bin/salt-syndic
usr/share/salt/salt-cp /usr/bin/salt-cp
usr/share/salt/salt-key /usr/bin/salt-key
usr/share/salt/salt-run /usr/bin/salt-run
-usr/share/salt/salt-minion /usr/bin/salt-minion
-usr/share/salt/salt-call /usr/bin/salt-call
View
5 debian/salt-master.manpages
@@ -1,6 +1,5 @@
-doc/man/salt.7
doc/man/salt.1
-doc/man/salt-master.1
-doc/man/salt-key.1
doc/man/salt-cp.1
+doc/man/salt-key.1
+doc/man/salt-master.1
doc/man/salt-run.1
View
8 debian/salt-minion.install
@@ -1,4 +1,4 @@
-scripts/salt-minion /usr/share/salt/salt-minion
-scripts/salt-call /usr/share/salt/salt-call
-modules/* /usr/share/salt/modules/
-conf/minion /etc/salt/minion
+scripts/salt-minion /usr/share/salt
+scripts/salt-call /usr/share/salt
+salt/modules /usr/share/salt/modules
+conf/minion.template /etc/salt/minion
View
2 debian/salt-minion.links
@@ -0,0 +1,2 @@
+usr/share/salt/salt-minion /usr/bin/salt-minion
+usr/share/salt/salt-call /usr/bin/salt-call
View
1 debian/salt-syndic.install
@@ -0,0 +1 @@
+scripts/salt-syndic /usr/share/salt
View
1 debian/salt-syndic.links
@@ -0,0 +1 @@
+usr/share/salt/salt-syndic /usr/bin/salt-syndic
View
9 debian/salt.manpages
@@ -1,9 +0,0 @@
-doc/man/salt.1
-doc/man/salt.7
-doc/man/salt-call.1
-doc/man/salt-cp.1
-doc/man/salt-key.1
-doc/man/salt-master.1
-doc/man/salt-minion.1
-doc/man/salt-run.1
-doc/man/salt-syndic.1
View
BIN doc/_static/salt-vert.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
192 doc/_templates/layout.html
@@ -1,188 +1,6 @@
-{%- block doctype -%}
-<!DOCTYPE html>
-{%- endblock %}
+{% extends "!layout.html" %}
-{%- set reldelim1 = reldelim1 is not defined and ' &raquo;' or reldelim1 %}
-{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
-{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and (sidebars != []) %}
-{%- set url_root = pathto('', 1) %}
-{# XXX necessary? #}
-{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
-{%- if not embedded and docstitle %}
- {%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
-{%- else %}
- {%- set titlesuffix = "" %}
-{%- endif %}
-
-{%- macro relbar() %}
- <div class="related">
- <h3>{{ _('Navigation') }}</h3>
- <ul class="rel-main">
- {%- block rootrellink %}
- <li><a href="{{ pathto('index') }}">Salt home</a>&nbsp;|&nbsp;</li>
- <li><a href="{{ pathto('home') }}">Documentation</a> &raquo;</li>
- {%- endblock %}
- </ul>
- <ul class="rel-extra">
- {%- for rellink in rellinks|reverse %}
- <li>
- <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}">{{ rellink[3] }}</a>
- {%- if not loop.last %}{{ reldelim2 }}{% endif %}</li>
- {%- endfor %}
-
- {%- block relbaritems %} {% endblock %}
- </ul>
- </div>
-{%- endmacro %}
-
-{%- macro sidebar() %}
- {%- if render_sidebar %}
- <div class="sidebar">
- {%- block sidebarlogo %}{%- endblock %}
-
- {%- for sidebartemplate in sidebars|default(html_default_sidebars, true) %}
- {%- include sidebartemplate %}
- {%- endfor %}
- </div>
- {%- endif %}
-{%- endmacro %}
-
-{%- macro script() %}
- <script>
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '{{ url_root }}',
- VERSION: '{{ release|e }}',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
- HAS_SOURCE: {{ has_source|lower }}
- };
- </script>
- {%- for scriptfile in script_files %}
- <script src="{{ pathto(scriptfile, 1) }}"></script>
- {%- endfor %}
-{%- endmacro %}
-
-{%- macro css() %}
- <link rel="stylesheet" href="http://yui.yahooapis.com/combo?3.3.0/build/cssreset/reset-min.css&3.3.0/build/cssfonts/fonts-min.css&3.3.0/build/cssbase/base-min.css">
- {% for s in style %}
- <link rel="stylesheet" href="{{ pathto('_static/' + s, 1) }}">
- {% endfor %}
- <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}">
-{%- endmacro %}
-
-<html lang="en" class="no-js">
- <head>
- <meta charset="{{ encoding }}">
- {{ metatags }}
-
- {%- block htmltitle %}
- <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
- {%- endblock %}
-
- {{ css() }}
-
- {%- if not embedded %}
- {{ script() }}
- {%- if use_opensearch %}
- <link rel="search" type="application/opensearchdescription+xml"
- title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
- href="{{ pathto('_static/opensearch.xml', 1) }}">
- {%- endif %}
-
- {%- if favicon %}
- <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}">
- {%- endif %}
- {%- endif %}
-
- {%- block linktags %}
- {%- if hasdoc('about') %}
- <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}">
- {%- endif %}
- {%- if hasdoc('genindex') %}
- <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}">
- {%- endif %}
- {%- if hasdoc('search') %}
- <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}">
- {%- endif %}
- {%- if hasdoc('copyright') %}
- <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}">
- {%- endif %}
- <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}">
- {%- if parents %}
- <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}">
- {%- endif %}
- {%- if next %}
- <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}">
- {%- endif %}
- {%- if prev %}
- <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}">
- {%- endif %}
- {%- endblock %}
-
- {%- block extrahead %} {% endblock %}
-
- {%- block analytics %}
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-26984928-1']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- {% endblock %}
- </head>
- <body id="saltstack.org"><div class="container">
- {% block header %}
- {%- if logo %}
- <div class="header">
- <h1 class="logo"><a href="{{ pathto('index') }}">
- <img src="{{ pathto('_static/' + logo, 1) }}" alt="Salt Stack">
- </a></h1>
- </div>
- {%- endif %}
- {% endblock %}
-
- {%- block relbar1 %}{{ relbar() }}{% endblock %}
-
- {%- block content %}
-
- {%- block sidebar1 %}{% endblock %}
-
- <div class="content">
- <div class="document">
- {%- block document %}
- {% block body %} {% endblock %}
- {%- endblock %}
- </div>
-
- {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
- </div>
- {%- endblock %}
-
- {%- block relbar2 %}{{ relbar() }}{% endblock %}
-
- {%- block footer %}
- <div class="footer">
- {%- if show_copyright %}
- {%- if hasdoc('copyright') %}
- {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
- {%- else %}
- {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
- {%- endif %}
- {%- endif %}
-
- {%- if last_updated %}
- {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
- {%- endif %}
-
- {%- if show_sphinx %}
- {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
- {%- endif %}
- </div>
- {%- endblock %}
- </body>
-</html>
+{% block rootrellink %}
+ <li><a href="{{ pathto('index') }}">Salt home</a>&nbsp;|&nbsp;</li>
+ <li><a href="{{ pathto('home') }}">Documentation</a> &raquo;</li>
+{% endblock %}
View
186 doc/_themes/saltstack/layout.html
@@ -0,0 +1,186 @@
+{%- block doctype -%}
+<!DOCTYPE html>
+{%- endblock %}
+
+{%- set reldelim1 = reldelim1 is not defined and ' &raquo;' or reldelim1 %}
+{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
+{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and (sidebars != []) %}
+{%- set url_root = pathto('', 1) %}
+{# XXX necessary? #}
+{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
+{%- if not embedded and docstitle %}
+ {%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
+{%- else %}
+ {%- set titlesuffix = "" %}
+{%- endif %}
+
+{%- macro relbar() %}
+ <div class="related">
+ <h3>{{ _('Navigation') }}</h3>
+ <ul class="rel-main">
+ {%- block rootrellink %}
+ <li><a href="{{ pathto('index') }}">Salt home</a>&nbsp;|&nbsp;</li>
+ <li><a href="{{ pathto('home') }}">Documentation</a> &raquo;</li>
+ {%- endblock %}
+ </ul>
+ <ul class="rel-extra">
+ {%- for rellink in rellinks|reverse %}
+ <li>
+ <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}">{{ rellink[3] }}</a>
+ {%- if not loop.last %}{{ reldelim2 }}{% endif %}</li>
+ {%- endfor %}
+
+ {%- block relbaritems %} {% endblock %}
+ </ul>
+ </div>
+{%- endmacro %}
+
+{%- macro sidebar() %}
+ {%- if render_sidebar %}
+ <div class="sidebar">
+ {%- block sidebarlogo %}{%- endblock %}
+
+ {%- for sidebartemplate in sidebars|default(html_default_sidebars, true) %}
+ {%- include sidebartemplate %}
+ {%- endfor %}
+ </div>
+ {%- endif %}
+{%- endmacro %}
+
+{%- macro script() %}
+ <script>
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: '{{ url_root }}',
+ VERSION: '{{ release|e }}',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
+ HAS_SOURCE: {{ has_source|lower }}
+ };
+ </script>
+ {%- for scriptfile in script_files %}
+ <script src="{{ pathto(scriptfile, 1) }}"></script>
+ {%- endfor %}
+{%- endmacro %}
+
+{%- macro css() %}
+ <link rel="stylesheet" href="http://yui.yahooapis.com/combo?3.3.0/build/cssreset/reset-min.css&3.3.0/build/cssfonts/fonts-min.css&3.3.0/build/cssbase/base-min.css">
+ {% if style %}
+ <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}">
+ {% endif %}
+ <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}">
+{%- endmacro %}
+
+<html lang="en" class="no-js">
+ <head>
+ <meta charset="{{ encoding }}">
+ {{ metatags }}
+
+ {%- block htmltitle %}
+ <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
+ {%- endblock %}
+
+ {{ css() }}
+
+ {%- if not embedded %}
+ {{ script() }}
+ {%- if use_opensearch %}
+ <link rel="search" type="application/opensearchdescription+xml"
+ title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
+ href="{{ pathto('_static/opensearch.xml', 1) }}">
+ {%- endif %}
+
+ {%- if favicon %}
+ <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}">
+ {%- endif %}
+ {%- endif %}
+
+ {%- block linktags %}
+ {%- if hasdoc('about') %}
+ <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}">
+ {%- endif %}
+ {%- if hasdoc('genindex') %}
+ <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}">
+ {%- endif %}
+ {%- if hasdoc('search') %}
+ <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}">
+ {%- endif %}
+ {%- if hasdoc('copyright') %}
+ <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}">
+ {%- endif %}
+ <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}">
+ {%- if parents %}
+ <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}">
+ {%- endif %}
+ {%- if next %}
+ <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}">
+ {%- endif %}
+ {%- if prev %}
+ <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}">
+ {%- endif %}
+ {%- endblock %}
+
+ {%- block extrahead %} {% endblock %}
+
+ {%- block analytics %}
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-26984928-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+ {% endblock %}
+ </head>
+ <body id="saltstack.org"><div class="container">
+ {% block header %}
+ <div class="header">
+ <h1 class="logo"><a href="{{ pathto('index') }}">
+ <img src="{{ pathto('_static/salt-horiz.png', 1) }}" alt="Salt Stack">
+ </a></h1>
+ </div>
+ {% endblock %}
+
+ {%- block relbar1 %}{{ relbar() }}{% endblock %}
+
+ {%- block content %}
+
+ {%- block sidebar1 %}{% endblock %}
+
+ <div class="content">
+ <div class="document">
+ {%- block document %}
+ {% block body %} {% endblock %}
+ {%- endblock %}
+ </div>
+
+ {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
+ </div>
+ {%- endblock %}
+
+ {%- block relbar2 %}{{ relbar() }}{% endblock %}
+
+ {%- block footer %}
+ <div class="footer">
+ {%- if show_copyright %}
+ {%- if hasdoc('copyright') %}
+ {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
+ {%- else %}
+ {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
+ {%- endif %}
+ {%- endif %}
+
+ {%- if last_updated %}
+ {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
+ {%- endif %}
+
+ {%- if show_sphinx %}
+ {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
+ {%- endif %}
+ </div>
+ {%- endblock %}
+ </body>
+</html>
View
0 doc/_static/base-salt.css → doc/_themes/saltstack/static/base-salt.css
File renamed without changes.
View
0 doc/_static/salt.png → doc/_themes/saltstack/static/salt-horiz.png
File renamed without changes
View
3 doc/_themes/saltstack/theme.conf
@@ -0,0 +1,3 @@
+[theme]
+inherit = default
+stylesheet = base-salt.css
View
15 doc/conf.py
@@ -29,7 +29,8 @@ def __getattr__(self, name):
MOCK_MODULES = [
# salt core
- 'salt.msgpack._msgpack',
+ 'yaml',
+ 'msgpack',
'zmq',
'Crypto',
'Crypto.Cipher',
@@ -68,6 +69,8 @@ def __getattr__(self, name):
from salt.version import __version__
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
# -- General configuration -----------------------------------------------------
project = u'Salt'
@@ -107,14 +110,18 @@ def __getattr__(self, name):
### HTML options
-html_theme = 'default'
+if on_rtd:
+ html_theme = 'default'
+else:
+ html_theme = 'saltstack'
+
+html_theme_path = ['_themes']
html_title = None
html_short_title = 'Salt'
html_static_path = ['_static']
-html_logo = 'salt.png'
+html_logo = 'salt-vert.png'
html_favicon = 'favicon.ico'
-html_style = ['base-salt.css']
html_use_smartypants = False
html_additional_pages = {
View
2 doc/man/salt-call.1
@@ -1,4 +1,4 @@
-.TH "SALT-CALL" "1" "January 14, 2012" "0.9.5" "Salt"
+.TH "SALT-CALL" "1" "January 20, 2012" "0.9.6" "Salt"
.SH NAME
salt-call \- salt-call Documentation
.
View
8 doc/man/salt-cp.1
@@ -1,4 +1,4 @@
-.TH "SALT-CP" "1" "January 14, 2012" "0.9.5" "Salt"
+.TH "SALT-CP" "1" "January 20, 2012" "0.9.6" "Salt"
.SH NAME
salt-cp \- salt-cp Documentation
.
@@ -61,7 +61,7 @@ The timeout in seconds to wait for replies from the salt minions.
.INDENT 0.0
.TP
.B \-E, \-\-pcre
-The target expresion will be interpereted as a pcre regular expression
+The target expression will be interpereted as a pcre regular expression
rather than a shell glob.
.UNINDENT
.INDENT 0.0
@@ -74,8 +74,8 @@ example: server1.foo.bar,server2.foo.bar,example7.quo.qux
.TP
.B \-G, \-\-grain
The target expression matches values returned by the salt grains system on
-the minions. The target expresion is in the format of \(aq<grain value>:<pcre
-regular expresion>\(aq; example: \(aqos:Arch.*\(aq
+the minions. The target expression is in the format of \(aq<grain value>:<pcre
+regular expression>\(aq; example: \(aqos:Arch.*\(aq
.UNINDENT
.INDENT 0.0
.TP
View
2 doc/man/salt-key.1
@@ -1,4 +1,4 @@
-.TH "SALT-KEY" "1" "January 14, 2012" "0.9.5" "Salt"
+.TH "SALT-KEY" "1" "January 20, 2012" "0.9.6" "Salt"
.SH NAME
salt-key \- salt-key Documentation
.
View
14 doc/man/salt-master.1
@@ -1,4 +1,4 @@
-.TH "SALT-MASTER" "1" "January 14, 2012" "0.9.5" "Salt"
+.TH "SALT-MASTER" "1" "January 20, 2012" "0.9.6" "Salt"
.SH NAME
salt-master \- salt-master Documentation
.
@@ -54,6 +54,18 @@ Run the salt master as a daemon
.B \-c CONFIG, \-\-config=CONFIG
The master configuration file to use, the default is /etc/salt/master
.UNINDENT
+.INDENT 0.0
+.TP
+.B \-u USER, \-\-user=USER
+Specify user to run minion
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-l LOG_LEVEL, \-\-log\-level=LOG_LEVEL
+Console log level. One of \fBinfo\fP, \fBnone\fP, \fBgarbage\fP,
+\fBtrace\fP, \fBwarning\fP, \fBerror\fP, \fBdebug\fP. For the logfile
+settings see the config file. Default: \fBwarning\fP.
+.UNINDENT
.SH AUTHOR
Thomas S. Hatch <thatch@gmail.com> and many others, please see the Authors file
.SH COPYRIGHT
View
14 doc/man/salt-minion.1
@@ -1,4 +1,4 @@
-.TH "SALT-MINION" "1" "January 14, 2012" "0.9.5" "Salt"
+.TH "SALT-MINION" "1" "January 20, 2012" "0.9.6" "Salt"
.SH NAME
salt-minion \- salt-minion Documentation
.
@@ -55,6 +55,18 @@ Run the salt minion as a daemon
.B \-c CONFIG, \-\-config=CONFIG
The minion configuration file to use, the default is /etc/salt/minion
.UNINDENT
+.INDENT 0.0
+.TP
+.B \-u USER, \-\-user=USER
+Specify user to run minion
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-l LOG_LEVEL, \-\-log\-level=LOG_LEVEL
+Console log level. One of \fBinfo\fP, \fBnone\fP, \fBgarbage\fP,
+\fBtrace\fP, \fBwarning\fP, \fBerror\fP, \fBdebug\fP. For the logfile
+settings see the config file. Default: \fBwarning\fP.
+.UNINDENT
.SH AUTHOR
Thomas S. Hatch <thatch@gmail.com> and many others, please see the Authors file
.SH COPYRIGHT
View
2 doc/man/salt-run.1
@@ -1,4 +1,4 @@
-.TH "SALT-RUN" "1" "January 14, 2012" "0.9.5" "Salt"
+.TH "SALT-RUN" "1" "January 20, 2012" "0.9.6" "Salt"
.SH NAME
salt-run \- salt-run Documentation
.
View
2 doc/man/salt-syndic.1
@@ -1,4 +1,4 @@
-.TH "SALT-SYNDIC" "1" "January 14, 2012" "0.9.5" "Salt"
+.TH "SALT-SYNDIC" "1" "January 20, 2012" "0.9.6" "Salt"
.SH NAME
salt-syndic \- salt-syndic Documentation
.
View
2 doc/man/salt.1
@@ -1,4 +1,4 @@
-.TH "SALT" "1" "January 14, 2012" "0.9.5" "Salt"
+.TH "SALT" "1" "January 20, 2012" "0.9.6" "Salt"
.SH NAME
salt \- salt
.
View
4,590 doc/man/salt.7
3,586 additions, 1,004 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
6 doc/ref/cli/salt-cp.rst
@@ -36,7 +36,7 @@ Options
.. option:: -E, --pcre
- The target expresion will be interpereted as a pcre regular expression
+ The target expression will be interpereted as a pcre regular expression
rather than a shell glob.
.. option:: -L, --list
@@ -47,8 +47,8 @@ Options
.. option:: -G, --grain
The target expression matches values returned by the salt grains system on
- the minions. The target expresion is in the format of '<grain value>:<pcre
- regular expresion>'; example: 'os:Arch.*'
+ the minions. The target expression is in the format of '<grain value>:<pcre
+ regular expression>'; example: 'os:Arch.*'
.. option:: -Q, --query
View
10 doc/ref/cli/salt-master.rst
@@ -30,3 +30,13 @@ Options
.. option:: -c CONFIG, --config=CONFIG
The master configuration file to use, the default is /etc/salt/master
+
+.. option:: -u USER, --user=USER
+
+ Specify user to run minion
+
+.. option:: -l LOG_LEVEL, --log-level=LOG_LEVEL
+
+ Console log level. One of ``info``, ``none``, ``garbage``,
+ ``trace``, ``warning``, ``error``, ``debug``. For the logfile
+ settings see the config file. Default: ``warning``.
View
10 doc/ref/cli/salt-minion.rst
@@ -31,3 +31,13 @@ Options
.. option:: -c CONFIG, --config=CONFIG
The minion configuration file to use, the default is /etc/salt/minion
+
+.. option:: -u USER, --user=USER
+
+ Specify user to run minion
+
+.. option:: -l LOG_LEVEL, --log-level=LOG_LEVEL
+
+ Console log level. One of ``info``, ``none``, ``garbage``,
+ ``trace``, ``warning``, ``error``, ``debug``. For the logfile
+ settings see the config file. Default: ``warning``.
View
4 doc/ref/configuration/examples.rst
@@ -11,7 +11,7 @@ Configuration file examples
Example master configuration file
=================================
-.. literalinclude:: ../../../conf/master
+.. literalinclude:: ../../../conf/master.template
:language: ini
:linenos:
@@ -20,6 +20,6 @@ Example master configuration file
Example minion configuration file
=================================
-.. literalinclude:: ../../../conf/minion
+.. literalinclude:: ../../../conf/minion.template
:language: ini
:linenos:
View
17 doc/ref/configuration/master.rst
@@ -7,8 +7,8 @@ of the Salt system each have a respective configuration file. The
:command:`salt-master` is configured via the master configuration file, and the
:command:`salt-minion` is configured via the minion configuration file.
-.. seealso::
- :ref:`example master configuration file <configuration-examples-master>`
+.. seealso::
+ :ref:`example master configuration file <configuration-examples-master>`
The configuration file for the salt-master is located at
:file:`/etc/salt/master`. The available options are as follows:
@@ -42,6 +42,19 @@ The network port to set up the publication interface
publish_port: 4505
+.. conf_master:: user
+
+``user``
+----------------
+
+Default: ``root``
+
+The user to run the Salt processes
+
+.. code-block:: yaml
+
+ user: root
+
.. conf_master:: worker_threads
``worker_threads``
View
32 doc/ref/configuration/minion.rst
@@ -43,6 +43,19 @@ option on the salt master.
master_port: 4506
+.. conf_minion:: user
+
+``user``
+----------------
+
+Default: ``root``
+
+The user to run the Salt processes
+
+.. code-block:: yaml
+
+ user: root
+
.. conf_minion:: pki_dir
``pki_dir``
@@ -99,8 +112,27 @@ The location for minion cache data.
cachedir: /var/cache/salt
+.. conf_minion:: cache_jobs
+
+``cache_jobs``
+--------------
+
+Default: ``False``
+
+The minion can locally cache the return data from jobs sent to it, this
+can be a good way to keep track minion side of the jobs the minion has
+executed. By default this feature is disabled, to enable set cache_jobs
+to True
+
+.. code-block:: yaml
+
+ cache_jobs: False
+
.. conf_minion:: acceptance_wait_time
+``acceptance_wait_time``
+------------------------
+
Default: ``10``
The number of seconds to wait until attempting to re-authenticate with the
View
10 doc/topics/configuration.rst
@@ -34,12 +34,12 @@ Running Salt
1. Start the master in the foreground (to daemonize the process, pass the
:option:`-d flag <salt-master -d>`)::
- salt-master
+ # salt-master
2. Start the minion in the foreground (to daemonize the process, pass the
:option:`-d flag <salt-minion -d>`)::
- salt-minion
+ # salt-minion
.. admonition:: Having trouble?
@@ -48,6 +48,12 @@ Running Salt
salt-master --log-level=debug
+.. admonition:: Run as an unprivileged (non-root) user?
+
+ To run Salt as another user, specify ``--user`` in the command
+ line or assign ``user`` in the
+ :doc:`configuration file</ref/configuration/master>`.
+
Manage Salt public keys
=======================
View
3 doc/topics/index.rst
@@ -45,9 +45,10 @@ contains a viable, and transparent, AMQ broker inside the daemon. Salt uses
public keys for authentication with the master daemon, then uses faster AES
encryption for payload communication, this means that authentication and
encryption are also built into Salt. Salt takes advantage of communication via
-Python pickles, enabling fast and light network traffic.
+`msgpack`_, enabling fast and light network traffic.
.. _`ZeroMQ`: http://www.zeromq.org/
+.. _`msgpack`: http://msgpack.org/
Python client interface
=======================
View
213 doc/topics/releases/0.9.5.rst
@@ -8,6 +8,11 @@ Salt 0.9.5 is one of the largest steps forward in the development of Salt.
developers grow out to an international team of 46 code contributors and has
many feature additions, feature enhancements, bug fixes and speed improvements.
+.. warning::
+
+ Be sure to :ref:`read the upgrade instructions <v0.9.5-msgpack>` about the
+ switch to msgpack before upgrading!
+
Community
=========
@@ -20,35 +25,35 @@ expandability of Salt is as exponential as I originally intended.
commiters. The following individuals have contributed to the development of
0.9.5:
-Aaron Bull Schaefer
-Antti Kaihola
-Bas Tichelaar
-Brad Barden
-Brian Wagner
-Byron Clark
-Chris Scheller
-Christer Edwards
-Clint Savage
-Corey Quinn
-David Boucha
-Eivind Uggedal
-Eric Poelke
-Evan Borgstrom
-Jed Glazner
-Jeff Schroeder
-Jeffrey C. Ollie
-Jonas Buckner
-Kent Tenney
-Martin Schnabel
-Maxim Burgerhout
-Mitch Anderson
-Nathaniel Whiteinge
-Seth House
-Thomas S Hatch
-Thomas Schreiber
-Tor Hveem
-lzyeval
-syphernl
+* Aaron Bull Schaefer
+* Antti Kaihola
+* Bas Tichelaar
+* Brad Barden
+* Brian Wagner
+* Byron Clark
+* Chris Scheller
+* Christer Edwards
+* Clint Savage
+* Corey Quinn
+* David Boucha
+* Eivind Uggedal
+* Eric Poelke
+* Evan Borgstrom
+* Jed Glazner
+* Jeff Schroeder
+* Jeffrey C. Ollie
+* Jonas Buckner
+* Kent Tenney
+* Martin Schnabel
+* Maxim Burgerhout
+* Mitch Anderson
+* Nathaniel Whiteinge
+* Seth House
+* Thomas S Hatch
+* Thomas Schreiber
+* Tor Hveem
+* lzyeval
+* syphernl
This makes 21 new developers since 0.9.4 was released!
@@ -59,6 +64,8 @@ Salt on Github, and get coding (https://github.com/saltstack/salt)!
Major Features
==============
+.. _v0.9.5-msgpack:
+
SPEED! Pickle to msgpack
------------------------
@@ -75,20 +82,24 @@ This move introduces a few changes to Salt. First off, Salt is no longer a
"noarch" package, since the msgpack lib is written in C. Salt 0.9.5 will also
have compatibility issues with 0.9.4 with the default configuration.
-We have gone through great lengths to avoid backwards compatibility issues
-with Salt, but changing the serialization medium was going to create issues
-regardless. Salt 0.9.5 is somewhat backwards compatible with earlier minions.
-A 0.9.5 master can command older minions, but only if the ?serial? config
-value in the master is set to ?pickle?. This will tell the master to publish
-messages in pickle format and will allow the master to receive messages in
-both msgpack and pickle formats.
-
-Therefore the suggested methods for upgrading are either to just upgrade
-everything at once, or to upgrade the master to 0.9.5, set "serial: pickle" in
-the master config, upgrade the minions, and then remove the serial option from
-the config. Since pickles can be used as a security exploit the ability for a
-master to accept pickles from minions at all will be removed in a future
-release.
+We have gone through great lengths to avoid backwards compatibility issues with
+Salt, but changing the serialization medium was going to create issues
+regardless. Salt 0.9.5 is somewhat backwards compatible with earlier minions. A
+0.9.5 master can command older minions, but only if the :conf_master:`serial`
+config value in the master is set to ``pickle``. This will tell the master to
+publish messages in pickle format and will allow the master to receive messages
+in both msgpack and pickle formats.
+
+Therefore **the suggested methods for upgrading** are either to just upgrade
+everything at once, or:
+
+1. Upgrade the master to 0.9.5
+2. Set :conf_master:`serial` to ``pickle`` in the master config
+3. Upgrade the minions
+4. Remove the ``serial`` option from the master config
+
+Since pickles can be used as a security exploit the ability for a master to
+accept pickles from minions at all will be removed in a future release.
C Bindings for YAML
--------------------
@@ -129,14 +140,15 @@ Modules via Module Environment Directories
Under the file_roots each environment can now have directories that are used
to deploy large groups of modules. These directories sync modules at the
beginning of a state run on the minion, or can be manually synced via the Salt
-module "saltutil.sync_all".
+module :mod:`salt.modules.saltutil.sync_all`.
The directories are named:
-_modules
-_states
-_grains
-_renderers
-_returners
+
+* ``_modules``
+* ``_states``
+* ``_grains``
+* ``_renderers``
+* ``_returners``
The modules are pushed to their respective scopes on the minions.
@@ -144,7 +156,7 @@ Module Reloading
----------------
Modules can now be reloaded without restarting the minion, this is done by
-calling the sys.reload_modules function.
+calling the :mod:`salt.modules.sys.reload_modules` function.
But wait, there's more! Now when a salt module of any type is added via
states the modules will be automatically reloaded, allowing for modules to be
@@ -160,9 +172,9 @@ A great deal of demand has existed for adding the capability to set services
to be started at boot in the service module. This feature also comes with an
overhaul of the service modules and initial systemd support.
-This means that the service state can now accept "- enable: True" to make sure
-a service is enabled at boot, and "- enable: False" to make sure it is
-disabled.
+This means that the :mod:`service state <salt.states.service.running>` can now
+accept ``- enable: True`` to make sure a service is enabled at boot, and ``-
+enable: False`` to make sure it is disabled.
Compound Target
---------------
@@ -172,12 +184,12 @@ previous versions the desired minions could only be targeted via a single
specific target type, but now many target specifications can be declared.
These targets can also be separated by and/or operators, so certain properties
-can be used to omit a node:
+can be used to omit a node::
-salt -C 'webserv* and G@os:Debian or E@db.*' test.ping
+ salt -C 'webserv* and G@os:Debian or E@db.*' test.ping
will match all minions with ids starting with webserv via a glob and minions
-matching the os:Debian grain. Or minions that match the "db.*" regular
+matching the ``os:Debian`` grain. Or minions that match the ``db.*`` regular
expression.
@@ -187,15 +199,15 @@ Node Groups
Often the convenience of having a predefined group of minions to execute
targets on is desired. This can be accomplished with the new nodegroups
feature. Nodegroups allow for predefined compound targets to be declared in
-the master configuration file:
+the master configuration file::
-nodegroups:
- group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com and bl*.domain.com'
- group2: 'G@os:Debian and foo.domain.com'
+ nodegroups:
+ group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com and bl*.domain.com'
+ group2: 'G@os:Debian and foo.domain.com'
-And then used via the -N option:
+And then used via the ``-N`` option::
-salt -N group1 test.ping
+ salt -N group1 test.ping
Minion Side Data Store
-----------------------
@@ -219,8 +231,8 @@ Salt -Q is Useful Now
In the past the salt query system, which would display the data from recent
executions would be displayed in pure python, and it was unreadable.
-0.9.5 has added the outputter system to the -Q option, thus enabling the salt
-query system to return readable output.
+0.9.5 has added the outputter system to the ``-Q`` option, thus enabling the
+salt query system to return readable output.
Packaging Updates
=================
@@ -255,9 +267,10 @@ Ubuntu and the package data that has been prepared is being pushed through
the needed channels for inclusion.
These packages have been prepared with the help of:
-Corey
-Aaron Toponce
-and`
+
+* Corey
+* Aaron Toponce
+* and`
More to Come
------------
@@ -291,67 +304,68 @@ This allows Salt to give much more granular error information.
New Modules
-----------
-data
-````
+:mod:`data <salt.modules.data>`
+```````````````````````````````
The new data module manages a persistent datastore on the minion.
Big thanks to bastichelaar for his help refining this module
-freebsdkmod
-````````````
+:mod:`freebsdkmod <salt.modules.freebsdkmod>`
+`````````````````````````````````````````````
FreeBSD kernel modules can now be managed in the same way Salt handles Linux
kernel modules.
+
This module was contributed thanks to the efforts of Christer Edwards
-gentoo_service
-``````````````
+:mod:`gentoo_service <salt.modules.gentoo_service>`
+```````````````````````````````````````````````````
Support has been added for managing services in Gentoo. Now Gentoo services
can be started, stopped, restarted, enabled, disabled and viewed.
-pip
-````
+:mod:`pip <salt.modules.pip>`
+`````````````````````````````
The pip module introduces management for pip installed applications.
Thanks goes to whitinge for the addition of the pip module
-rh_service
-``````````
+:mod:`rh_service <salt.modules.rh_service>`
+```````````````````````````````````````````
The rh_service module enables Red Hat and Fedora specific service management.
Now Red Hat like systems come with extensive management of the classic init
system used by Red Hat
-saltutil
-````````
+:mod:`saltutil <salt.modules.saltutil>`
+```````````````````````````````````````
The saltutil module has been added as a place to hold functions used in the
maintenance and management of salt itself. Saltutil is used to salt the salt
minion. The saltutil module is presently used only to sync extension modules
from the master server.
-systemd
-````````
+:mod:`systemd <salt.modules.systemd>`
+`````````````````````````````````````
Systemd support has been added to Salt, now systems using this next generation
init system are supported on systems running systemd.
-virtualenv
-``````````
+:mod:`virtualenv <salt.modules.virtualenv>`
+```````````````````````````````````````````
The virtualenv module has been added to allow salt to create virtual python
environments.
Thanks goes to whitinge for the addition of the virtualenv module
-win_disk
-````````
+:mod:`win_disk <salt.modules.win_disk>`
+```````````````````````````````````````
Support for gathering disk information on Microsoft Windows minions
The windows modules come courtesy of Utah_Dave
-win_service
-```````````
+:mod:`win_service <salt.modules.win_service>`
+`````````````````````````````````````````````
The win_service module adds service support to Salt for Microsoft Windows
services
-win_useradd
-````````````
+:mod:`win_useradd <salt.modules.win_useradd>`
+`````````````````````````````````````````````
Salt can now manage local users on Microsoft Windows Systems
-yumpkg5
-```````
+:mod:`yumpkg5 <salt.modules.yumpkg5>`
+`````````````````````````````````````
The yumpkg module introduces in 0.9.4 uses the yum api to interact with the
yum package manager. Unfortunately, on Red Hat 5 systems salt does not have
access to the yum api because the yum api is running under python 2.4 and Salt
@@ -363,26 +377,27 @@ the yum api is not available.
New States
-----------
-mysql_database
-``````````````
+:mod:`mysql_database <salt.states.mysql_database>`
+``````````````````````````````````````````````````
The new mysql_database state adds the ability to systems running a mysql
server to manage the existence of mysql databases.
The mysql states are thanks to syphernl
-mysql_user
-```````````
+:mod:`mysql_user <salt.states.mysql_user>`
+``````````````````````````````````````````
The mysql_user state enables mysql user management.
-virtualenv
-``````````
+:mod:`virtualenv <salt.states.virtualenv>`
+``````````````````````````````````````````
The virtualenv state can manage the state of python virtual environments.
Thanks to Whitinge for the virtualenv state
New Returners
-------------
-cassandra_returner
-``````````````````
+:mod:`cassandra_returner <salt.returners.cassandra_return>`
+```````````````````````````````````````````````````````````
+
A returner allowing Salt to send data to a cassandra server.
Thanks to Byron Clark for contributing this returner
View
6 requirements.txt
@@ -0,0 +1,6 @@
+Jinja2
+pyzmq
+msgpack-python
+M2Crypto
+pycrypto
+PyYAML
View
119 salt/__init__.py 100755 → 100644
@@ -8,6 +8,7 @@
import sys
import stat
import optparse
+import getpass
# Import salt libs, the try block bypasses an issue at build time so that c
# modules don't cause the build to fail
@@ -26,7 +27,7 @@ def verify_env(dirs):
for dir_ in dirs:
if not os.path.isdir(dir_):
try:
- cumask = os.umask(191)
+ cumask = os.umask(63) # 077
os.makedirs(dir_)
os.umask(cumask)
except OSError, e:
@@ -42,6 +43,34 @@ def verify_env(dirs):
salt.utils.verify.run()
+def check_user(user, log):
+ '''
+ Check user and assign process uid/gid.
+ '''
+ if 'os' in os.environ:
+ if os.environ['os'].startswith('Windows'):
+ return True
+ if user == getpass.getuser():
+ return True
+ import pwd # after confirming not running Windows
+ try:
+ p = pwd.getpwnam(user)
+ try:
+ os.setgid(p.pw_gid)
+ os.setuid(p.pw_uid)
+ except OSError:
+ if user == 'root':
+ msg = 'Sorry, the salt must run as root. http://xkcd.com/838'
+ else:
+ msg = 'Salt must be run from root or user "{0}"'.format(user)
+ log.critical(msg)
+ return False
+ except KeyError:
+ msg = 'User not found: "{0}"'.format(user)
+ log.critical(msg)
+ return False
+ return True
+
class Master(object):
'''
Creates a master server
@@ -49,6 +78,9 @@ class Master(object):
def __init__(self):
self.cli = self.__parse_cli()
self.opts = salt.config.master_config(self.cli['config'])
+ # command line overrides config
+ if self.cli['user']:
+ self.opts['user'] = self.cli['user']
def __parse_cli(self):
'''
@@ -67,6 +99,10 @@ def __parse_cli(self):
dest='config',
default='/etc/salt/master',
help='Pass in an alternative configuration file')
+ parser.add_option('-u',
+ '--user',
+ dest='user',
+ help='Specify user to run minion')
parser.add_option('-l',
'--log-level',
dest='log_level',
@@ -81,7 +117,8 @@ def __parse_cli(self):
salt.log.setup_console_logger(options.log_level, log_format=log_format)
cli = {'daemon': options.daemon,
- 'config': options.config}
+ 'config': options.config,
+ 'user': options.user}
return cli
@@ -104,13 +141,14 @@ def start(self):
import logging
log = logging.getLogger(__name__)
# Late import so logging works correctly
- import salt.master
- master = salt.master.Master(self.opts)
- if self.cli['daemon']:
- # Late import so logging works correctly
- import salt.utils
- salt.utils.daemonize()
- master.start()
+ if check_user(self.opts['user'], log):
+ import salt.master
+ master = salt.master.Master(self.opts)
+ if self.cli['daemon']:
+ # Late import so logging works correctly
+ import salt.utils
+ salt.utils.daemonize()
+ master.start()
class Minion(object):
@@ -120,6 +158,9 @@ class Minion(object):
def __init__(self):
self.cli = self.__parse_cli()
self.opts = salt.config.minion_config(self.cli['config'])
+ # command line overrides config
+ if self.cli['user']:
+ self.opts['user'] = self.cli['user']
def __parse_cli(self):
'''
@@ -138,6 +179,10 @@ def __parse_cli(self):
dest='config',
default='/etc/salt/minion',
help='Pass in an alternative configuration file')
+ parser.add_option('-u',
+ '--user',
+ dest='user',
+ help='Specify user to run minion')
parser.add_option('-l',
'--log-level',
dest='log_level',
@@ -151,7 +196,8 @@ def __parse_cli(self):
log_format = '%(asctime)s,%(msecs)03.0f [%(name)-15s][%(levelname)-8s] %(message)s'
salt.log.setup_console_logger(options.log_level, log_format=log_format)
cli = {'daemon': options.daemon,
- 'config': options.config}
+ 'config': options.config,
+ 'user': options.user}
return cli
@@ -170,22 +216,21 @@ def start(self):
)
for name, level in self.opts['log_granular_levels'].iteritems():
salt.log.set_logger_level(name, level)
-
import logging
-
# Late import so logging works correctly
import salt.minion
log = logging.getLogger(__name__)
- try:
- if self.cli['daemon']:
- # Late import so logging works correctly
- import salt.utils
- salt.utils.daemonize()
- minion = salt.minion.Minion(self.opts)
- minion.tune_in()
- except KeyboardInterrupt:
- log.warn('Stopping the Salt Minion')
- raise SystemExit('\nExiting on Ctrl-c')
+ if check_user(self.opts['user'], log):
+ try:
+ if self.cli['daemon']:
+ # Late import so logging works correctly
+ import salt.utils
+ salt.utils.daemonize()
+ minion = salt.minion.Minion(self.opts)
+ minion.tune_in()
+ except KeyboardInterrupt:
+ log.warn('Stopping the Salt Minion')
+ raise SystemExit('\nExiting on Ctrl-c')
class Syndic(object):
@@ -195,6 +240,9 @@ class Syndic(object):
def __init__(self):
self.cli = self.__parse_cli()
self.opts = self.__prep_opts()
+ # command line overrides config
+ if self.cli['user']:
+ self.opts['user'] = self.cli['user']
def __prep_opts(self):
'''
@@ -239,6 +287,10 @@ def __parse_cli(self):
dest='minion_config',
default='/etc/salt/minion',
help='Pass in an alternative minion configuration file')
+ parser.add_option('-u',
+ '--user',
+ dest='user',
+ help='Specify user to run minion')
parser.add_option('-l',
'--log-level',
dest='log_level',
@@ -255,7 +307,7 @@ def __parse_cli(self):
cli = {'daemon': options.daemon,
'minion_config': options.minion_config,
'master_config': options.master_config,
- }
+ 'user': options.user}
return cli
@@ -278,13 +330,14 @@ def start(self):
# Late import so logging works correctly
import salt.minion
log = logging.getLogger(__name__)
- try:
- syndic = salt.minion.Syndic(self.opts)
- if self.cli['daemon']:
- # Late import so logging works correctly
- import salt.utils
- salt.utils.daemonize()
- syndic.tune_in()
- except KeyboardInterrupt:
- log.warn('Stopping the Salt Syndic Minion')
- raise SystemExit('\nExiting on Ctrl-c')
+ if check_user(self.opts['user'], log):
+ try:
+ syndic = salt.minion.Syndic(self.opts)
+ if self.cli['daemon']:
+ # Late import so logging works correctly
+ import salt.utils
+ salt.utils.daemonize()
+ syndic.tune_in()
+ except KeyboardInterrupt:
+ log.warn('Stopping the Salt Syndic Minion')
+ raise SystemExit('\nExiting on Ctrl-c')
View
20 salt/config.py
@@ -30,7 +30,16 @@ def load_config(opts, path, env_var):
'''
if not path or not os.path.isfile(path):
- path = os.environ.get(env_var, '')
+ path = os.environ.get(env_var, path)
+ # If the configuration file is missing, attempt to copy the template,
+ # after removing the first header line.
+ if not os.path.isfile(path):
+ template = "%s.template" % path
+ if os.path.isfile(template):
+ with open(path, 'w') as out:
+ with open(template, 'r') as f:
+ f.readline() # skip first line
+ out.write(f.read())
if os.path.isfile(path):
try:
@@ -67,10 +76,12 @@ def minion_config(path):
'''
opts = {'master': 'salt',
'master_port': '4506',
+ 'user': 'root',
'root_dir': '/',
'pki_dir': '/etc/salt/pki',
'id': socket.getfqdn(),
'cachedir': '/var/cache/salt',
+ 'cache_jobs': False,
'conf_file': path,
'renderer': 'yaml_jinja',
'failhard': False,
@@ -105,14 +116,14 @@ def minion_config(path):
# else!
opts['open_mode'] = opts['open_mode'] is True
+ # set up the extension_modules location from the cachedir
+ opts['extension_modules'] = os.path.join(opts['cachedir'], 'extmods')
+
opts['grains'] = salt.loader.grains(opts)
# Prepend root_dir to other paths
prepend_root_dir(opts, ['pki_dir', 'cachedir', 'log_file'])
- # set up the extension_modules location from the cachedir
- opts['extension_modules'] = os.path.join(opts['cachedir'], 'extmods')
-
return opts
@@ -122,6 +133,7 @@ def master_config(path):
'''
opts = {'interface': '0.0.0.0',
'publish_port': '4505',
+ 'user': 'root',
'worker_threads': 5,
'sock_dir': os.path.join(tempfile.gettempdir(), '.salt-unix'),
'ret_port': '4506',
View
6 salt/loader.py
@@ -100,9 +100,13 @@ def grains(opts):
Return the functions for the dynamic grains and the values for the static
grains.
'''
+ extra_dirs = [
+ os.path.join(opts['extension_modules'],
+ 'grains')
+ ]
module_dirs = [
os.path.join(salt_base_path, 'grains'),
- ]
+ ] + extra_dirs
load = Loader(module_dirs, opts)
grains = load.gen_grains()
if 'grains' in opts:
View
0 salt/log.py 100755 → 100644
File mode changed.
View
93 salt/minion.py
@@ -226,14 +226,19 @@ def _thread_return(self, data):
ret['jid'] = data['jid']
ret['fun'] = data['fun']
+ self._return_pub(ret)
if data['ret']:
- ret['id'] = self.opts['id']
- try:
- self.returners[data['ret']](ret)
- except Exception as exc:
- log.error('The return failed for job %s %s', data['jid'], exc)
- else:
- self._return_pub(ret)
+ for returner in set(data['ret'].split(',')):
+ ret['id'] = self.opts['id']
+ try:
+ self.returners[returner](ret)
+ except Exception as exc:
+ log.error(
+ 'The return failed for job {0} {1}'.format(
+ data['jid'],
+ exc
+ )
+ )
def _thread_multi_return(self, data):
'''
@@ -259,23 +264,32 @@ def _thread_multi_return(self, data):
= self.functions[data['fun'][ind]](*data['arg'][ind])
except Exception as exc:
trb = traceback.format_exc()
- log.warning('The minion function caused an exception: %s', exc)
+ log.warning(
+ 'The minion function caused an exception: {0}'.format(
+ exc
+ )
+ )
ret['return'][data['fun'][ind]] = trb
ret['jid'] = data['jid']
+ self._return_pub(ret)
if data['ret']:
- ret['id'] = self.opts['id']
- try:
- self.returners[data['ret']](ret)
- except Exception as exc:
- log.error('The return failed for job %s %s', data['jid'], exc)
- else:
- self._return_pub(ret)
+ for returner in set(data['ret'].split(',')):
+ ret['id'] = self.opts['id']
+ try:
+ self.returners[returner](ret)
+ except Exception as exc:
+ log.error(
+ 'The return failed for job {0} {1}'.format(
+ data['jid'],
+ exc
+ )
+ )
def _return_pub(self, ret, ret_cmd='_return'):
'''
Return the data from the executed command to the master server
'''
- log.info('Returning information for job: %(jid)s', ret)
+ log.info('Returning information for job: {0}'.format(ret['jid']))
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(self.opts['master_uri'])
@@ -301,8 +315,21 @@ def _return_pub(self, ret, ret_cmd='_return'):
except KeyError:
pass
payload['load'] = self.crypticle.dumps(load)
- socket.send(self.serial.dumps(payload))
- return socket.recv()
+ data = self.serial.dumps(payload)
+ socket.send(data)
+ ret_val = socket.recv()
+ if self.opts['cache_jobs']:
+ # Local job cache has been enabled
+ fn_ = os.path.join(
+ self.opts['cachedir'],
+ 'minion_jobs',
+ load['jid'],
+ 'return.p')
+ jdir = os.path.dirname(fn_)
+ if not os.path.isdir(jdir):
+ os.makedirs(jdir)
+ open(fn_, 'w+').write(self.serial.dumps(ret))
+ return ret_val
def authenticate(self):
'''
@@ -567,7 +594,6 @@ def compound_match(self, tgt):
if not matcher:
# If an unknown matcher is called at any time, fail out
return False
- print comps
results.append(
str(getattr(
self,
@@ -582,7 +608,6 @@ def compound_match(self, tgt):
)('@'.join(comps[1:]))
))
- print ' '.join(results)
return eval(' '.join(results))
class FileClient(object):
@@ -695,14 +720,28 @@ def get_url(self, url, dest, makedirs=False, env='base'):
'''
Get a single file from a URL.
'''
- if urlparse.urlparse(url).scheme == 'salt':
+ url_data = urlparse.urlparse(url)
+ if url_data.scheme == 'salt':
return self.get_file(url, dest, makedirs, env)
- destdir = os.path.dirname(dest)
- if not os.path.isdir(destdir):
- if makedirs:
+ if dest:
+ destdir = os.path.dirname(dest)
+ if not os.path.isdir(destdir):
+ if makedirs:
+ os.makedirs(destdir)
+ else:
+ return False
+ else:
+ dest = os.path.join(
+ self.opts['cachedir'],