Bug fixes and build errors

Refs #23211
Refs #24268
Refs #24235
Refs #24193
Refs #24172
Refs #19901
Refs #19801
This commit is contained in:
Jacob Hammons 2015-06-05 17:32:35 -06:00
parent ced558a6e6
commit d45c4ed11f
39 changed files with 233 additions and 133 deletions

View file

@ -15,6 +15,14 @@ Description
The salt-call command is used to run module functions locally on a minion
instead of executing them from the master.
salt-call is used to run a :ref:`Standalone Minion <tutorial-standalone-minion>`,
and was originally created for :ref:`troubleshooting <troubleshooting-minion-salt-call>`.
Be aware that ``salt-call`` commands execute from the current user's shell
context, while ``salt`` commands execute from the system's default context.
By default, the Salt Master is contacted to retrieve state files and other resources
during execution unless the ``--local`` option is specified.:w
Options
=======

View file

@ -87,11 +87,6 @@ Execution Options
for this influx of vm creation. When creating large groups of VMs watch the
cloud provider carefully.
.. option:: -Q, --query
Execute a query and print out information about all cloud VMs. Can be used
in conjunction with -m to display only information about the specified map.
.. option:: -u, --update-bootstrap
Update salt-bootstrap to the latest develop version on GitHub.

View file

@ -2432,3 +2432,15 @@ List of git repositories to include with the local repo.
win_gitrepos:
- 'https://github.com/saltstack/salt-winrepo.git'
To specify a specific revision of the repository, preface the
repository location with a commit ID:
.. code-block:: yaml
win_gitrepos:
- '<commit_id> https://github.com/saltstack/salt-winrepo.git'
Replacing ``<commit_id>`` with the ID from GitHub. Specifying a commit
ID is useful if you need to revert to a previous version if an error
is introduced in the latest version.

View file

@ -289,6 +289,22 @@ executed. By default this feature is disabled, to enable set cache_jobs to
cache_jobs: False
.. conf_minion:: grains_cache
``grains_cache``
----------------
Default: ``False``
The minion can locally cache grain data instead of refreshing the data
each time the grain is referenced. By default this feature is disabled,
to enable set grains_cache to ``True``.
.. code-block:: yaml
cache_jobs: False
.. conf_minion:: sock_dir
``sock_dir``

View file

@ -24,6 +24,21 @@ The cp module is the home of minion side file server operations. The cp module
is used by the Salt state system, salt-cp, and can be used to distribute files
presented by the Salt file server.
Escaping Special Characters
```````````````````````````
The ``salt://`` url format can potentially contain a query string, for example
``salt://dir/file.txt?saltenv=base``. You can prevent the fileclient/fileserver from
interpreting ``?`` as the initial token of a query string by referencing the file
with ``salt://|`` rather than ``salt://``.
.. code-block:: yaml
/etc/marathon/conf/?checkpoint:
file.managed:
- source: salt://|hw/config/?checkpoint
- makedirs: True
Environments
````````````

View file

@ -3,4 +3,4 @@ salt.modules.ipmi
=================
.. automodule:: salt.modules.ipmi
:members
:members:

View file

@ -63,6 +63,7 @@ Full list of builtin state modules
influxdb_database
influxdb_user
ini_manage
ipmi
ipset
iptables
jboss7
@ -142,6 +143,7 @@ Full list of builtin state modules
sysrc
test
timezone
tls
tomcat
user
vbox_guest

View file

@ -0,0 +1,6 @@
================
salt.states.ipmi
================
.. automodule:: salt.states.ipmi
:members:

View file

@ -0,0 +1,6 @@
===============
salt.states.tls
===============
.. automodule:: salt.states.tls
:members:

View file

@ -1,6 +1,8 @@
===================
.. _external-pillars:
================
External Pillars
===================
================
Salt provides a mechanism for generating pillar data by calling external
pillar interfaces. This document will describe an outline of an ext_pillar

View file

@ -43,8 +43,9 @@ minion exe>` should match the contents of the corresponding md5 file.
* 2014.7.0
* Salt-Minion-2014.7.0-1-win32-Setup.exe | md5
* Salt-Minion-2014.7.0-AMD64-Setup.exe | md5
.. note::
The 2014.7.0 installers have been removed because of a regression. Please use the 2014.7.1 release instead.
.. note::
The 2014.7.0 installers have been removed because of a regression. Please use the 2014.7.1 release instead.
* 2014.1.13
* `Salt-Minion-2014.1.13-x86-Setup.exe <http://docs.saltstack.com/downloads/Salt-Minion-2014.1.13-x86-Setup.exe>`__ | `md5 <http://docs.saltstack.com/downloads/Salt-Minion-2014.1.13-x86-Setup.exe.md5>`__

View file

@ -66,6 +66,8 @@ check that no additional access control system such as `SELinux`_ or
.. _`SELinux`: https://en.wikipedia.org/wiki/Security-Enhanced_Linux
.. _`AppArmor`: http://wiki.apparmor.net/index.php/Main_Page
.. _troubleshooting-minion-salt-call:
Using salt-call
===============

View file

@ -34,9 +34,9 @@ Variables:
minions can be defined in pillar and then accessed inside sls formulas
and template files.
Arbitrary Data:
Pillar can contain any basic data structure, so a list of values, or a
key/value store can be defined making it easy to iterate over a group
of values in sls formulas
Pillar can contain any basic data structure in dictionary format,
so a key/value store can be defined making it easy to iterate over a group
of values in sls formulas.
Pillar is therefore one of the most important systems when using Salt. This
walkthrough is designed to get a simple Pillar up and running in a few minutes
@ -309,12 +309,6 @@ line:
salt '*' state.sls my_sls_file pillar='{"hello": "world"}'
Lists can be passed in pillar as well:
.. code-block:: bash
salt '*' state.highstate pillar='["foo", "bar", "baz"]'
.. note::
If a key is passed on the command line that already exists on the minion,

View file

@ -1,3 +1,5 @@
.. _tutorial-standalone-minion:
=================
Standalone Minion
=================
@ -77,4 +79,10 @@ it unnecessary to change the configuration file:
.. code-block:: bash
salt-call state.highstate --local
salt-call state.highstate --local
External Pillars
================
:ref:`External pillars <external-pillars>` are supported when running in masterless mode.

View file

@ -178,8 +178,8 @@ and all changes made.
salt-minion -l debug
Run the minion in the foreground
By not starting the minion in daemon mode (:option:`-d <salt-minion
-d>`) one can view any output from the minion as it works:
By not starting the minion in daemon mode (:option:`-d <salt-minion -d>`)
one can view any output from the minion as it works:
.. code-block:: bash

View file

@ -9,29 +9,29 @@ use an existing table that has a username and a password column.
To get started, create a simple table that holds just a username and
a password. The password field will hold a SHA256 checksum.
.. code-block:: sql
.. code-block:: sql
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(25) DEFAULT NULL,
`password` varchar(70) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(25) DEFAULT NULL,
`password` varchar(70) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
To create a user within MySQL, execute the following statement.
.. code-block:: sql
.. code-block:: sql
INSERT INTO users VALUES (NULL, 'diana', SHA2('secret', 256))
INSERT INTO users VALUES (NULL, 'diana', SHA2('secret', 256))
.. code-block:: yaml
.. code-block:: yaml
mysql_auth:
hostname: localhost
database: SaltStack
username: root
password: letmein
auth_sql: 'SELECT username FROM users WHERE username = "{0}" AND password = SHA2("{1}", 256)'
mysql_auth:
hostname: localhost
database: SaltStack
username: root
password: letmein
auth_sql: 'SELECT username FROM users WHERE username = "{0}" AND password = SHA2("{1}", 256)'
The `auth_sql` contains the SQL that will validate a user to ensure they are
correctly authenticated. This is where you can specify other SQL queries to
@ -39,7 +39,7 @@ authenticate users.
Enable MySQL authentication.
.. code-block:: yaml
.. code-block:: yaml
external_auth:
mysql:

View file

@ -84,24 +84,26 @@ def beacon(config):
The mask list can contain the following events (the default mask is create,
delete, and modify):
* access File accessed
* attrib File metadata changed
* close_nowrite Unwritable file closed
* close_write Writable file closed
* create File created in watched directory
* delete File deleted from watched directory
* delete_self Watched file or directory deleted
* modify File modified
* moved_from File moved out of watched directory
* moved_to File moved into watched directory
* move_self Watched file moved
* open File opened
* access File accessed
* attrib File metadata changed
* close_nowrite Unwritable file closed
* close_write Writable file closed
* create File created in watched directory
* delete File deleted from watched directory
* delete_self Watched file or directory deleted
* modify File modified
* moved_from File moved out of watched directory
* moved_to File moved into watched directory
* move_self Watched file moved
* open File opened
The mask can also contain the following options:
* dont_follow Don't dereference symbolic links
* excl_unlink Omit events for children after they have been unlinked
* oneshot Remove watch after one event
* onlydir Operate only if name is directory
* dont_follow Don't dereference symbolic links
* excl_unlink Omit events for children after they have been unlinked
* oneshot Remove watch after one event
* onlydir Operate only if name is directory
recurse:
Recursively watch files in the directory

View file

@ -647,6 +647,7 @@ def list_permissions(username=None, resource=None, resource_type='keyspace', per
:rtype: dict
.. code-block:: bash
salt 'minion1' cassandra_cql.list_permissions
salt 'minion1' cassandra_cql.list_permissions username=joe resource=test_keyspace permission=select
@ -702,6 +703,7 @@ def grant_permission(username, resource=None, resource_type='keyspace', permissi
:rtype:
.. code-block:: bash
salt 'minion1' cassandra_cql.grant_permission
salt 'minion1' cassandra_cql.grant_permission username=joe resource=test_keyspace permission=select

View file

@ -579,18 +579,18 @@ def run(cmd,
Note that ``env`` represents the environment variables for the command, and
should be formatted as a dict, or a YAML string which resolves to a dict.
*************************************************************************
WARNING: This function does not process commands through a shell
unless the python_shell flag is set to True. This means that any
shell-specific functionality such as 'echo' or the use of pipes,
redirection or &&, should either be migrated to cmd.shell or
have the python_shell=True flag set here.
.. warning::
The use of python_shell=True means that the shell will accept _any_ input
including potentially malicious commands such as 'good_command;rm -rf /'.
Be absolutely certain that you have sanitized your input prior to using
python_shell=True
*************************************************************************
This function does not process commands through a shell
unless the python_shell flag is set to True. This means that any
shell-specific functionality such as 'echo' or the use of pipes,
redirection or &&, should either be migrated to cmd.shell or
have the python_shell=True flag set here.
The use of python_shell=True means that the shell will accept _any_ input
including potentially malicious commands such as 'good_command;rm -rf /'.
Be absolutely certain that you have sanitized your input prior to using
python_shell=True
CLI Example:
@ -707,12 +707,12 @@ def shell(cmd,
.. versionadded:: 2015.5.0
************************************************************
WARNING: This passes the cmd argument directly to the shell
without any further processing! Be absolutely sure that you
have properly santized the command passed to this function
and do not use untrusted inputs.
************************************************************
.. warning ::
This passes the cmd argument directly to the shell
without any further processing! Be absolutely sure that you
have properly santized the command passed to this function
and do not use untrusted inputs.
Note that ``env`` represents the environment variables for the command, and
should be formatted as a dict, or a YAML string which resolves to a dict.

View file

@ -1807,7 +1807,7 @@ def _run_wrapper(status, container, func, cmd, *args, **kwargs):
def load(imagepath):
'''
Load the specified file at imagepath into docker that was generated from
a docker save command
a docker save command
e.g. `docker load < imagepath`
imagepath

View file

@ -590,9 +590,7 @@ def import_key(user=None,
.. code-block:: bash
salt '*' gpg.import_key text='-----BEGIN PGP PUBLIC KEY BLOCK-----\n ... -----END PGP PUBLIC KEY BLOCK-----'
salt '*' gpg.import_key filename='/path/to/public-key-file'
'''
ret = {
'res': True,
@ -749,7 +747,6 @@ def trust_key(keyid=None,
salt '*' gpg.trust_key fingerprint='53C96788253E58416D20BCD352952C84C3252192' trust_level='not_trusted'
salt '*' gpg.trust_key keys=3FAD9F1E trust_level='ultimately' user='username'
'''
ret = {
'res': True,

View file

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
'''
:requires: libnacl
https://github.com/saltstack/libnacl
This module helps include encrypted passwords in pillars, grains and salt state files.
This is often usefull if you wish to store your pillars in source control or
share your pillar data with others that you trust. I dont advise making your pillars public
:depends: libnacl, https://github.com/saltstack/libnacl
This is often useful if you wish to store your pillars in source control or
share your pillar data with others that you trust. I don't advise making your pillars public
regardless if they are encrypted or not.
When generating keys and encrypting passwords use --local when using salt-call for extra
@ -14,20 +14,28 @@ security. Also consider using just the salt runner nacl when encrypting pillar p
The nacl lib uses 32byte keys, these keys are base64 encoded to make your life more simple.
To generate your `key` or `keyfile` you can use:
.. code-block:: bash
salt-call --local nacl.keygen keyfile=/root/.nacl
Now with your key, you can encrypt some data
Now with your key, you can encrypt some data:
.. code-block:: bash
salt-call --local nacl.enc mypass keyfile=/root/.nacl
DRB7Q6/X5gGSRCTpZyxS6hXO5LnlJIIJ4ivbmUlbWj0llUA+uaVyvou3vJ4=
To decrypt the data
To decrypt the data:
.. code-block:: bash
salt-call --local nacl.dec data='DRB7Q6/X5gGSRCTpZyxS6hXO5LnlJIIJ4ivbmUlbWj0llUA+uaVyvou3vJ4=' keyfile=/root/.nacl
mypass
The following optional configurations can be defined in the
minion or master config. Avoide storeing the config in pillars!
minion or master config. Avoid storing the config in pillars!
.. code-block:: yaml
cat /etc/salt/master.d/nacl.conf
nacl.config:
@ -36,15 +44,21 @@ minion or master config. Avoide storeing the config in pillars!
When the key is defined in the master config you can use it from the nacl runner:
.. code-block:: bash
salt-run nacl.enc 'myotherpass'
Now you can create a pillar with protected data like:
.. code-block:: yaml
pillarexample:
user: root
password: {{ salt.nacl.dec('DRB7Q6/X5gGSRCTpZyxS6hXO5LnlJIIJ4ivbmUlbWj0llUA+uaVyvou3vJ4=') }}
Or do somthing interesting with grains like:
Or do something interesting with grains like:
.. code-block:: yaml
salt-call nacl.enc minionname:dbrole
AL24Z2C5OlkReer3DuQTFdrNLchLuz3NGIhGjZkLtKRYry/b/CksWM8O9yskLwH2AGVLoEXI5jAa

View file

@ -225,11 +225,13 @@ def enable():
def disable(message=None):
'''
.. versionadded:: 2014.7.0
Disable the puppet agent
message
.. versionadded:: 2015.5.2
disable message to send to puppet
Disable message to send to puppet
CLI Example:
@ -237,7 +239,6 @@ def disable(message=None):
salt '*' puppet.disable
salt '*' puppet.disable 'disabled for a good reason'
'''
_check_puppet()

View file

@ -681,10 +681,9 @@ def generateBlobs(api_key=None,
.. code-block:: bash
salt '*' get_intergers number=5 min=1 max=6
salt '*' get_intergers number=5 min=1 max=6
salt '*' get_integers number=5 min=1 max=6
salt '*' get_integers number=5 min=1 max=6
'''
ret = {'res': True}

View file

@ -1,6 +1,12 @@
# -*- coding: utf-8 -*-
'''
Control the state system on the minion
Control the state system on the minion.
State Caching
-------------
When a highstate is called, the minion automatically caches a copy of the last high data.
If you then run a highstate with cache=True it will use that cached highdata and won't hit the fileserver.
'''
from __future__ import absolute_import

View file

@ -52,8 +52,7 @@ def _call_system_profiler(datatype):
def receipts():
'''
Return the results of a call to
`system_profiler -xml -detail full
SPInstallHistoryDataType`
``system_profiler -xml -detail full SPInstallHistoryDataType``
as a dictionary. Top-level keys of the dictionary
are the names of each set of install receipts, since
there can be multiple receipts with the same name.
@ -93,12 +92,11 @@ def receipts():
def applications():
'''
Return the results of a call to
`system_profiler -xml -detail full
SPApplicationsDataType`
``system_profiler -xml -detail full SPApplicationsDataType``
as a dictionary. Top-level keys of the dictionary
are the names of each set of install receipts, since
there can be multiple receipts with the same name.
Contents of each key are a list of dicttionaries.
Contents of each key are a list of dictionaries.
Note that this can take a long time depending on how many
applications are installed on the target Mac.

View file

@ -7,16 +7,18 @@ A REST API for Salt
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends: - CherryPy Python module. Versions 3.2.{2,3,4} are strongly
recommended due to a known `SSL error
<https://bitbucket.org/cherrypy/cherrypy/issue/1298/ssl-not-working>`_
introduced in version 3.2.5. The issue was reportedly resolved with
CherryPy milestone 3.3, but the patch was committed for version 3.6.1.
:depends:
- CherryPy Python module. Versions 3.2.{2,3,4} are strongly
recommended due to a known `SSL error
<https://bitbucket.org/cherrypy/cherrypy/issue/1298/ssl-not-working>`_
introduced in version 3.2.5. The issue was reportedly resolved with
CherryPy milestone 3.3, but the patch was committed for version 3.6.1.
:optdepends: - ws4py Python module for websockets support.
:client_libraries:
- Java: https://github.com/SUSE/saltstack-netapi-client-java
- Python: https://github.com/saltstack/pepper
:configuration: All authentication is done through Salt's :ref:`external auth
:configuration:
All authentication is done through Salt's :ref:`external auth
<acl-eauth>` system which requires additional configuration not described
here.

View file

@ -16,7 +16,7 @@ them.
An example Django module that registers a function called
'returner_callback' with this module's 'returner' function:
.. code-block:: python
.. code-block:: python
import salt.returners.django_return
from django.dispatch import receiver

View file

@ -84,6 +84,7 @@ There is also the option of specifying a dynamic inventory, and generating it on
This is the format that an inventory script needs to output to work with ansible, and thus here.
.. code-block:: bash
[~]# salt-ssh --roster-file /etc/salt/hosts salt.gtmanfred.com test.ping
salt.gtmanfred.com:
True

View file

@ -349,7 +349,7 @@ def lock(backend=None, remote=None):
.. note::
This will only operate on enabled backends (those configured in
:master_conf:`fileserver_backend`).
:conf_master:`fileserver_backend`).
backend
Only set the update lock for the specified backend(s).

View file

@ -3,7 +3,7 @@
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
.. versionadded:: 2015.5.0
.. versionadded:: 2015.5
'''
from __future__ import absolute_import
# Import Python libs
@ -19,7 +19,7 @@ def query(url, output=True, **kwargs):
'''
Query a resource, and decode the return data
.. versionaddedd:: 2015.2
.. versionadded:: 2015.5
CLI Example:
@ -44,7 +44,7 @@ def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
.. versionaddedd:: 2015.2
.. versionadded:: 2015.5
CLI Example:

View file

@ -234,10 +234,10 @@ def present(
listeners
A list of listener lists; example:
[
['443', 'HTTPS', 'arn:aws:iam::1111111:server-certificate/mycert'],
['8443', '80', 'HTTPS', 'HTTP', 'arn:aws:iam::1111111:server-certificate/mycert']
]
[
['443', 'HTTPS', 'arn:aws:iam::1111111:server-certificate/mycert'],
['8443', '80', 'HTTPS', 'HTTP', 'arn:aws:iam::1111111:server-certificate/mycert']
]
subnets
A list of subnet IDs in your VPC to attach to your LoadBalancer.

View file

@ -164,7 +164,7 @@ elasticsearch profile via pillars:
The behavior of this module is to create dashboards if they do not exist, to
add rows if they do not exist in existing dashboards, and to update rows if
they exist in dashboards. The module will not manage rows that are not defined,
allowing users to manage their own custom rows.
allowing users to manage their own custom rows.
'''
from __future__ import absolute_import
from salt.exceptions import SaltInvocationError

View file

@ -73,6 +73,7 @@ def send_message(name,
The message that is to be sent to the Hipchat room.
The following parameters are optional:
api_key
The api key for Hipchat to use for authentication,
if not specified in the configuration options of master or minion.

View file

@ -163,8 +163,10 @@ def user_present(name, uid, password, channel=14, callback=False,
callback
User Restricted to Callback
False = User Privilege Limit is determined by the User Privilege Limit
parameter privilege_level, for both callback and non-callback connections.
True = User Privilege Limit is determined by the privilege_level
parameter for callback connections, but is restricted to Callback
level for non-callback connections. Thus, a user can only initiate

View file

@ -4,7 +4,8 @@ Linux File Access Control Lists
Ensure a Linux ACL is present
.. code-block:: yaml
.. code-block:: yaml
root:
acl.present:
- name: /root
@ -14,7 +15,8 @@ Ensure a Linux ACL is present
Ensure a Linux ACL does not exist
.. code-block:: yaml
.. code-block:: yaml
root:
acl.absent:
- name: /root

View file

@ -66,10 +66,10 @@ def post_message(name,
The message that is to be sent to the Hipchat room.
The following parameters are optional:
api_key
The api key for Slack to use for authentication,
if not specified in the configuration options of master or minion.
'''
ret = {'name': name,
'changes': {},

View file

@ -73,23 +73,26 @@ def installed(name, recurse=False, force=False):
def removed(name):
'''
Remove the windows feature
name:
short name of the feature (the right column in win_servermanager.list_available)
Note:
.. note::
Some features require a reboot after uninstallation. If so the feature will not be completly uninstalled until
the server is restarted.
the server is restarted.
Example:
Run ``salt MinionName win_servermanager.list_installed`` to get a list of all features installed. Use the top
Run ``salt MinionName win_servermanager.list_installed`` to get a list of all features installed. Use the top
name listed for each feature, not the indented one. Do not use the role or feature names mentioned in the
PKGMGR documentation.
.. code-block:: yaml
ISWebserverRole:
win_servermanager.removed:
- name: Web-Server
.. code-block:: yaml
ISWebserverRole:
win_servermanager.removed:
- name: Web-Server
'''
ret = {'name': name,
'result': True,

View file

@ -52,19 +52,22 @@ def update_config(file_name, yaml_contents):
specified by ``default_include``.
This folder is named ``master.d`` by
default. Please look at
http://docs.saltstack.com/en/latest/ref/configuration/master.html#include-configuration
:conf_master:`include-configuration`
for more information.
Example low data::
data = {
'username': 'salt',
'password': 'salt',
'fun': 'config.update_config',
'file_name': 'gui',
'yaml_contents': {'id': 1},
'client': 'wheel',
'eauth': 'pam',
}
Example low data:
.. code-block:: yaml
data = {
'username': 'salt',
'password': 'salt',
'fun': 'config.update_config',
'file_name': 'gui',
'yaml_contents': {'id': 1},
'client': 'wheel',
'eauth': 'pam',
}
'''
file_name = '{0}{1}'.format(file_name, '.conf')
dir_path = os.path.join(__opts__['config_dir'],