Merge branch 'develop' into compose_services

This commit is contained in:
Sjuul Janssen 2018-03-05 18:48:48 +01:00 committed by GitHub
commit ad55318341
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
283 changed files with 48697 additions and 7793 deletions

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-API" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-API" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-api \- salt-api Command
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-CALL" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-CALL" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-call \- salt-call Documentation
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-CLOUD" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-CLOUD" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-cloud \- Salt Cloud Command
.
@ -197,7 +197,7 @@ New in version 2014.7.0.
.sp
Display a list of configured profiles. Pass in a cloud provider to view
the provider\(aqs associated profiles, such as \fBdigital_ocean\fP, or pass in
the provider\(aqs associated profiles, such as \fBdigitalocean\fP, or pass in
\fBall\fP to list all the configured profiles.
.UNINDENT
.SS Cloud Providers Listings

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-CP" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-CP" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-cp \- salt-cp Documentation
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-KEY" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-KEY" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-key \- salt-key Documentation
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-MASTER" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-MASTER" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-master \- salt-master Documentation
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-MINION" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-MINION" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-minion \- salt-minion Documentation
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-PROXY" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-PROXY" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-proxy \- salt-proxy Documentation
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-RUN" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-RUN" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-run \- salt-run Documentation
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-SSH" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-SSH" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-ssh \- salt-ssh Documentation
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-SYNDIC" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-SYNDIC" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-syndic \- salt-syndic Documentation
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT-UNITY" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT-UNITY" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt-unity \- salt-unity Command
.

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SALT" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SALT" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
salt \- salt
.
@ -135,7 +135,7 @@ minions to execute on.
.B \-a EAUTH, \-\-auth=EAUTH
Pass in an external authentication medium to validate against. The
credentials will be prompted for. The options are \fIauto\fP,
\fIkeystone\fP, \fIldap\fP, \fIpam\fP, and \fIstormpath\fP\&. Can be used with the \-T
\fIkeystone\fP, \fIldap\fP, and \fIpam\fP\&. Can be used with the \-T
option.
.UNINDENT
.INDENT 0.0

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SPM" "1" "Jan 24, 2018" "2017.7.3" "Salt"
.TH "SPM" "1" "Feb 23, 2018" "2018.3.0" "Salt"
.SH NAME
spm \- Salt Package Manager Command
.

View File

@ -1398,7 +1398,7 @@ comparison, then by globbing, then by full-string regex matching.
This should still be considered a less than secure option, due to the fact
that trust is based on just the requesting minion id.
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
For security reasons the file must be readonly except for it's owner.
If :conf_master:`permissive_pki_access` is ``True`` the owning group can also
have write access, but if Salt is running as ``root`` it must be a member of that group.
@ -1423,7 +1423,7 @@ membership in the :conf_master:`autosign_file` and the
``autosign_grains_dir``
-----------------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``not defined``
@ -1920,7 +1920,7 @@ Set additional directories to search for runner modules.
``utils_dirs``
---------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``[]``
@ -2130,7 +2130,7 @@ the cloud profile or master config file, no templating will be performed.
``jinja_env``
-------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``{}``
@ -2166,7 +2166,7 @@ The default options are:
``jinja_sls_env``
-----------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``{}``
@ -2236,7 +2236,7 @@ be used if you had not set the line_statement and line_comment options:
``jinja_trim_blocks``
---------------------
.. deprecated:: Oxygen
.. deprecated:: 2018.3.0
Replaced by :conf_master:`jinja_env` and :conf_master:`jinja_sls_env`
.. versionadded:: 2014.1.0
@ -2256,7 +2256,7 @@ to the Jinja environment init variable ``trim_blocks``.
``jinja_lstrip_blocks``
-----------------------
.. deprecated:: Oxygen
.. deprecated:: 2018.3.0
Replaced by :conf_master:`jinja_env` and :conf_master:`jinja_sls_env`
.. versionadded:: 2014.1.0
@ -2666,7 +2666,7 @@ Example:
``roots_update_interval``
*************************
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``60``
@ -2853,7 +2853,7 @@ gitfs remotes.
``gitfs_disable_saltenv_mapping``
*********************************
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``False``
@ -2876,7 +2876,7 @@ parameters <gitfs-per-saltenv-config>`.
``gitfs_ref_types``
*******************
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``['branch', 'tag', 'sha']``
@ -2908,7 +2908,7 @@ are mapped as saltenvs:
***************************
.. versionadded:: 2014.7.0
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Renamed from ``gitfs_env_whitelist`` to ``gitfs_saltenv_whitelist``
Default: ``[]``
@ -2931,7 +2931,7 @@ information can be found in the :ref:`GitFS Walkthrough
***************************
.. versionadded:: 2014.7.0
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Renamed from ``gitfs_env_blacklist`` to ``gitfs_saltenv_blacklist``
Default: ``[]``
@ -2983,7 +2983,7 @@ they were created by a different master.
``gitfs_update_interval``
*************************
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``60``
@ -3298,7 +3298,7 @@ bookmark should be used as the ``base`` environment.
**************************
.. versionadded:: 2014.7.0
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Renamed from ``hgfs_env_whitelist`` to ``hgfs_saltenv_whitelist``
Default: ``[]``
@ -3328,7 +3328,7 @@ blacklist will be exposed as fileserver environments.
**************************
.. versionadded:: 2014.7.0
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Renamed from ``hgfs_env_blacklist`` to ``hgfs_saltenv_blacklist``
Default: ``[]``
@ -3357,7 +3357,7 @@ blacklist will be exposed as fileserver environments.
``hgfs_update_interval``
************************
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``60``
@ -3525,7 +3525,7 @@ also be configured on a per-remote basis, see :conf_master:`here
***************************
.. versionadded:: 2014.7.0
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Renamed from ``svnfs_env_whitelist`` to ``svnfs_saltenv_whitelist``
Default: ``[]``
@ -3555,7 +3555,7 @@ will be exposed as fileserver environments.
***************************
.. versionadded:: 2014.7.0
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Renamed from ``svnfs_env_blacklist`` to ``svnfs_saltenv_blacklist``
Default: ``[]``
@ -3584,7 +3584,7 @@ will be exposed as fileserver environments.
``svnfs_update_interval``
*************************
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``60``
@ -3690,7 +3690,7 @@ exposed.
``minionfs_update_interval``
****************************
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``60``
@ -3719,7 +3719,7 @@ examples.
``azurefs_update_interval``
***************************
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``60``
@ -3741,7 +3741,7 @@ See the :mod:`s3fs documentation <salt.fileserver.s3fs>` for usage examples.
``s3fs_update_interval``
************************
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``60``

View File

@ -138,7 +138,7 @@ name) is set in the :conf_minion:`master` configuration setting.
``master_tops_first``
---------------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``False``
@ -340,7 +340,7 @@ option on the Salt master.
``source_interface_name``
-------------------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The name of the interface to use when establishing the connection to the Master.
@ -379,7 +379,7 @@ Configuration example:
``source_address``
------------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The source IP address or the domain name to be used when connecting the Minion
to the Master.
@ -404,7 +404,7 @@ Configuration example:
``source_ret_port``
-------------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The source port to be used when connecting the Minion to the Master ret server.
@ -427,7 +427,7 @@ Configuration example:
``source_publish_port``
-----------------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The source port to be used when connecting the Minion to the Master publish
server.
@ -1358,7 +1358,7 @@ The password used for HTTP proxy access.
``docker.compare_container_networks``
-------------------------------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``{'static': ['Aliases', 'Links', 'IPAMConfig'], 'automatic': ['IPAddress', 'Gateway', 'GlobalIPv6Address', 'IPv6Gateway']}``
@ -1938,7 +1938,7 @@ enabled and can be disabled by changing this value to ``False``.
``saltenv``
-----------
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Renamed from ``environment`` to ``saltenv``. If ``environment`` is used,
``saltenv`` will take its value. If both are used, ``environment`` will be
ignored and ``saltenv`` will be used.
@ -1957,7 +1957,7 @@ environments is to isolate via the top file.
``lock_saltenv``
----------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``False``
@ -2489,7 +2489,7 @@ minion's pki directory.
``autosign_grains``
-------------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``not defined``
@ -2682,7 +2682,7 @@ executed in a thread.
``process_count_max``
-------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Default: ``-1``

View File

@ -257,7 +257,7 @@ large groups of states easily in any requisite statement.
require_any
~~~~~~~~~~~
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The use of ``require_any`` demands that one of the required states executes before the
dependent state. The state containing the ``require_any`` requisite is defined as the
@ -380,7 +380,7 @@ to Salt ensuring that the service is running.
watch_any
~~~~~~~~~
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The state containing the ``watch_any`` requisite is defined as the watching
state. The states specified in the ``watch_any`` statement are defined as the watched
@ -517,7 +517,7 @@ The ``onfail`` requisite is applied in the same way as ``require`` as ``watch``:
onfail_any
~~~~~~~~~~
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The ``onfail_any`` requisite allows for reactions to happen strictly as a response
to the failure of at least one other state. This can be used in a number of ways, such as
@ -616,7 +616,7 @@ if any of the watched states changes.
onchanges_any
~~~~~~~~~~~~~
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The ``onchanges_any`` requisite makes a state only apply one of the required states
generates changes, and if one of the watched state's "result" is ``True``. This can be

View File

@ -156,7 +156,7 @@ A State Module must return a dict containing the following keys/values:
in test mode without applying the change, ``False`` can be returned.
- **comment:** A list of strings or a single string summarizing the result.
Note that support for lists of strings is available as of Salt Oxygen.
Note that support for lists of strings is available as of Salt 2018.3.0.
Lists of strings will be joined with newlines to form the final comment;
this is useful to allow multiple comments from subparts of a state.
Prefer to keep line lengths short (use multiple lines as needed),

View File

@ -15,9 +15,16 @@ More information about Azure is located at `http://www.windowsazure.com/
Dependencies
============
* `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure>`_ >= 2.0rc6
* `Microsoft Azure Storage SDK for Python <https://pypi.python.org/pypi/azure-storage>`_ >= 0.32
* `AutoRest swagger generator Python client runtime (Azure-specific module) <https://pypi.python.org/pypi/msrestazure>`_ >= 0.4
* `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0rc6
* `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.4
* `azure-mgmt <https://pypi.python.org/pypi/azure-mgmt>`_ >= 0.30.0rc6
* `azure-mgmt-compute <https://pypi.python.org/pypi/azure-mgmt-compute>`_ >= 0.33.0
* `azure-mgmt-network <https://pypi.python.org/pypi/azure-mgmt-network>`_ >= 0.30.0rc6
* `azure-mgmt-resource <https://pypi.python.org/pypi/azure-mgmt-resource>`_ >= 0.30.0
* `azure-mgmt-storage <https://pypi.python.org/pypi/azure-mgmt-storage>`_ >= 0.30.0rc6
* `azure-mgmt-web <https://pypi.python.org/pypi/azure-mgmt-web>`_ >= 0.30.0rc6
* `azure-storage <https://pypi.python.org/pypi/azure-storage>`_ >= 0.32.0
* `msrestazure <https://pypi.python.org/pypi/msrestazure>`_ >= 0.4.21
* A Microsoft Azure account
* `Salt <https://github.com/saltstack/salt>`_

View File

@ -392,7 +392,7 @@ script, a cloud profile using ``file_map`` might look like:
Running Pre-Flight Commands
===========================
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
To execute specified preflight shell commands on a VM before the deploy script is
run, use the ``preflight_cmds`` option. These must be defined as a list in a cloud
@ -413,7 +413,7 @@ These commands will run in sequence **before** the bootstrap script is executed.
Force Minion Config
===================
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The ``force_minion_config`` option requests the bootstrap process to overwrite
an existing minion configuration file and public/private key files.

View File

@ -89,7 +89,7 @@ to it can be verified with Salt:
Destroy Options
---------------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
For obvious reasons, the ``destroy`` action does not actually vaporize hardware.
If the salt master is connected, it can tear down parts of the client machines.
@ -113,7 +113,7 @@ and can execute the following options:
Wake On LAN
-----------
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
In addition to connecting a hardware machine to a Salt master,
you have the option of sending a wake-on-LAN

View File

@ -286,7 +286,7 @@ Set up an initial profile at ``/etc/salt/cloud.profiles`` or
eagerly_scrub
Specifies whether the disk should be rewrite with zeros during thick provisioning or not.
Default is ``eagerly_scrub: False``.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
controller
Specify the SCSI controller label to which this disk should be attached.
This should be specified only when creating both the specified SCSI

View File

@ -58,7 +58,7 @@ States. GitFS is a quick and natural way to use Formulas.
3. Restart the Salt master.
Beginning with the Oxygen release, using formulas with GitFS is now much more
Beginning with the 2018.3.0 release, using formulas with GitFS is now much more
convenient for deployments which use many different fileserver environments
(i.e. saltenvs). Using the :ref:`all_saltenvs <gitfs-global-remotes>`
parameter, files from a single git branch/tag will appear in all environments.
@ -1266,10 +1266,10 @@ A sample skeleton for the ``README.rst`` file:
Install and configure the FOO service.
.. note::
**NOTE**
See the full `Salt Formulas installation and usage instructions
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
See the full `Salt Formulas installation and usage instructions
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
Available states
================

View File

@ -834,7 +834,7 @@ Returns:
----------
.. versionadded:: 2017.7.0
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Renamed from ``str_to_num`` to ``to_num``.
Converts a string to its numerical value.
@ -882,7 +882,7 @@ Example:
--------------------
.. versionadded:: 2017.7.0
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Renamed from ``json_decode_list`` to ``json_encode_list``. When you encode
something you get bytes, and when you decode, you get your locale's
encoding (usually a ``unicode`` type). This filter was incorrectly-named
@ -911,7 +911,7 @@ Returns:
--------------------
.. versionadded:: 2017.7.0
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Renamed from ``json_decode_dict`` to ``json_encode_dict``. When you encode
something you get bytes, and when you decode, you get your locale's
encoding (usually a ``unicode`` type). This filter was incorrectly-named
@ -942,7 +942,7 @@ Returns:
---------------
.. versionadded:: 2017.7.0
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Renamed from ``rand_str`` to ``random_hash`` to more accurately describe
what the filter does. ``rand_str`` will be supported until the Neon
release.

View File

@ -89,6 +89,6 @@ bare-bones example:
.. note::
If a master_tops module returns :ref:`top file <states-top>` data for a
given minion, it will be added to the states configured in the top file. It
will *not* replace it altogether. The Oxygen release adds additional
will *not* replace it altogether. The 2018.3.0 release adds additional
functionality allowing a minion to treat master_tops as the single source
of truth, irrespective of the top file.

View File

@ -263,16 +263,16 @@ To execute with pillar data.
Return Codes in Runner/Wheel Jobs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
State (``salt.state``) jobs are able to report failure via the :ref:`state
return dictionary <state-return-data>`. Remote execution (``salt.function``)
jobs are able to report failure by setting a ``retcode`` key in the
``__context__`` dictionary. However, runner (``salt.runner``) and wheel
(``salt.wheel``) jobs would only report a ``False`` result when the
runner/wheel function raised an exception. As of the Oxygen release, it is now
possible to set a retcode in runner and wheel functions just as you can do in
remote execution functions. Here is some example pseudocode:
runner/wheel function raised an exception. As of the 2018.3.0 release, it is
now possible to set a retcode in runner and wheel functions just as you can do
in remote execution functions. Here is some example pseudocode:
.. code-block:: python
@ -332,10 +332,9 @@ Given the above setup, the orchestration will be carried out as follows:
3. Finally, the ``ceph`` SLS target will be executed on all minions which have
a grain called ``role`` with a value of ``storage``.
.. note::
Remember, salt-run is always executed on the master.
Remember, salt-run is *always* executed on the master.
.. _orchestrate-runner-parsing-results-programatically:
@ -591,11 +590,11 @@ loadable and parsable format:
}
The Oxygen release includes a couple fixes to make parsing this data easier and
The 2018.3.0 release includes a couple fixes to make parsing this data easier and
more accurate. The first is the ability to set a :ref:`return code
<orchestrate-runner-return-codes-runner-wheel>` in a custom runner or wheel
function, as noted above. The second is a change to how failures are included
in the return data. Prior to the Oxygen release, minions that failed a
in the return data. Prior to the 2018.3.0 release, minions that failed a
``salt.state`` orchestration job would show up in the ``comment`` field of the
return data, in a human-readable string that was not easily parsed. They are
now included in the ``changes`` dictionary alongside the minions that
@ -603,3 +602,32 @@ succeeded. In addition, ``salt.function`` jobs which failed because the
:ref:`fail function <orchestrate-runner-fail-functions>` returned ``False``
used to handle their failures in the same way ``salt.state`` jobs did, and this
has likewise been corrected.
Running States on the Master without a Minion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The orchestrate runner can be used to execute states on the master without
using a minion. For example, assume that ``salt://foo.sls`` contains the
following SLS:
.. code-block:: yaml
/etc/foo.conf:
file.managed:
- source: salt://files/foo.conf
- mode: 0600
In this case, running ``salt-run state.orchestrate foo`` would be the
equivalent of running a ``state.sls foo``, but it would execute on the master
only, and would not require a minion daemon to be running on the master.
This is not technically orchestration, but it can be useful in certain use
cases.
Limitations
^^^^^^^^^^^
Only one SLS target can be run at a time using this method, while using
:py:func:`state.sls <salt.modules.state.sls>` allows for multiple SLS files to
be passed in a comma-separated list.

View File

@ -157,7 +157,8 @@ will need to be restarted to pick up any changes. A corresponding utility funct
In addition, a salt.utils helper function called `is_proxy()` was added to make
it easier to tell when the running minion is a proxy minion. **NOTE: This
function was renamed to salt.utils.platform.is_proxy() for the Oxygen release**
function was renamed to salt.utils.platform.is_proxy() for the 2018.3.0
release**
New in 2015.8
-------------

View File

@ -115,11 +115,10 @@ Name Description
============================== ==================================================================================
.. note::
The ``local`` and ``caller`` reaction types will be renamed for the Oxygen
release. These reaction types were named after Salt's internal client
interfaces, and are not intuitively named. Both ``local`` and ``caller``
will continue to work in Reactor SLS files, but for the Oxygen release the
documentation will be updated to reflect the new preferred naming.
The ``local`` and ``caller`` reaction types will likely be renamed in a
future release. These reaction types were named after Salt's internal
client interfaces, and are not intuitively named. Both ``local`` and
``caller`` will continue to work in Reactor SLS files, however.
Where to Put Reactor SLS Files
==============================

View File

@ -9,17 +9,45 @@ Changes for v2017.7.3..v2017.7.4
Extended changelog courtesy of Todd Stansell (https://github.com/tjstansell/salt-changelogs):
*Generated at: 2018-02-13T16:29:07Z*
*Generated at: 2018-02-16T16:44:38Z*
Statistics:
- Total Merges: **4**
- Total Issue references: **3**
- Total PR references: **7**
- Total Merges: **7**
- Total Issue references: **4**
- Total PR references: **11**
Changes:
- **PR** `#46066`_: (*rallytime*) Pin tornado version in requirements file
@ *2018-02-16T16:40:05Z*
- **ISSUE** `#45790`_: (*bdarnell*) Test with Tornado 5.0b1
| refs: `#46066`_
* 32f3d00e44 Merge pull request `#46066`_ from rallytime/pin-tornado
* 6dc1a3b9dc Pin tornado version in requirements file
- **PR** `#46036`_: (*terminalmage*) git.latest: Fix regression with identity file usage
@ *2018-02-16T13:57:23Z*
* 85761ee650 Merge pull request `#46036`_ from terminalmage/issue43769
* e2140d9a84 Mock the ssh.key_is_encrypted utils func
* 169924b3fe Move ssh.key_is_encrypted to a utils module temporarily
* 54f4d78f7a Only keep ssh.py in the Windows installer
* 5f04531e1b Keep ssh state and execution modules in the installer
* f2b69f703d git.latest: Fix regression with identity file usage
- **PR** `#46009`_: (*Ch3LL*) Add 2017.7.4 Release Notes with PRs
@ *2018-02-13T16:40:30Z*
* 6d534c6e7e Merge pull request `#46009`_ from Ch3LL/rn_7.4
* ac0baf4b34 Add 2017.7.4 Release Notes with PRs
- **PR** `#45981`_: (*gtmanfred*) use local config for vault when masterless
@ *2018-02-13T15:22:01Z*
@ -66,6 +94,7 @@ Changes:
.. _`#45742`: https://github.com/saltstack/salt/pull/45742
.. _`#45790`: https://github.com/saltstack/salt/issues/45790
.. _`#45893`: https://github.com/saltstack/salt/issues/45893
.. _`#45902`: https://github.com/saltstack/salt/pull/45902
.. _`#45915`: https://github.com/saltstack/salt/issues/45915
@ -75,6 +104,9 @@ Changes:
.. _`#45953`: https://github.com/saltstack/salt/pull/45953
.. _`#45976`: https://github.com/saltstack/salt/issues/45976
.. _`#45981`: https://github.com/saltstack/salt/pull/45981
.. _`#46009`: https://github.com/saltstack/salt/pull/46009
.. _`#46036`: https://github.com/saltstack/salt/pull/46036
.. _`#46066`: https://github.com/saltstack/salt/pull/46066
.. _`bp-45742`: https://github.com/saltstack/salt/pull/45742
.. _`bp-45902`: https://github.com/saltstack/salt/pull/45902
.. _`bp-45928`: https://github.com/saltstack/salt/pull/45928

View File

@ -0,0 +1,5 @@
===========================
Salt 2017.7.5 Release Notes
===========================
Version 2017.7.5 is a bugfix release for :ref:`2017.7.0 <release-2017-7-0>`.

View File

@ -1,8 +1,8 @@
:orphan:
.. _release-2018-3-0:
====================================
Salt Release Notes - Codename Oxygen
====================================
=============================================
Salt 2018.3.0 Release Notes - Codename Oxygen
=============================================
Lots of Docker Improvements
---------------------------
@ -353,7 +353,7 @@ Prior to this release, fileservers would be updated as part of a dedicated
performed. This tied the update interval to the :conf_master:`loop_interval`
config option, and also forced all fileservers to update at the same interval.
Oxygen adds the following configuration options for the various fileserver
2018.3.0 adds the following configuration options for the various fileserver
backends:
- :conf_master:`roots_update_interval`
@ -1680,8 +1680,8 @@ Utils Deprecations
The ``salt.utils.cloud.py`` file had the following change:
- The ``fire_event`` function now requires a ``sock_dir`` argument. It was previously
optional.
- The ``fire_event`` function now requires a ``sock_dir`` argument. It was
previously optional.
Other Miscellaneous Deprecations
================================
@ -1690,9 +1690,9 @@ The ``version.py`` file had the following changes:
- The ``rc_info`` function was removed. Please use ``pre_info`` instead.
Warnings for moving away from the ``env`` option were removed. ``saltenv`` should be
used instead. The removal of these warnings does not have a behavior change. Only
the warning text was removed.
Warnings for moving away from the ``env`` option were removed. ``saltenv``
should be used instead. The removal of these warnings does not have a behavior
change. Only the warning text was removed.
Sentry Log Handler
------------------
@ -1705,6 +1705,6 @@ RAET transport
--------------
We haven't been doing development on RAET for quite some time and decided that
Oxygen is the time to announce the deprecation. RAET support will be removed in
Neon. Please consider to move to ``zeromq`` or ``tcp`` transport instead of
2018.3.0 is the time to announce the deprecation. RAET support will be removed
in Neon. Please consider to move to ``zeromq`` or ``tcp`` transport instead of
``raet``.

View File

@ -20,6 +20,7 @@ Previous Releases
:maxdepth: 1
:glob:
2018.3.*
2017.7.*
2016.11.*
2016.3.*

View File

@ -8,7 +8,7 @@ Installing/Testing a Salt Release Candidate
It's time for a new feature release of Salt! Follow the instructions below to
install the latest release candidate of Salt, and try :ref:`all the shiny new
features <release-2017-7-0>`! Be sure to report any bugs you find on `Github
features <release-2018-3-0>`! Be sure to report any bugs you find on `Github
<https://github.com/saltstack/salt/issues/new/>`_.
Installing Using Packages
@ -47,14 +47,14 @@ You can install a release candidate of Salt using `Salt Bootstrap
.. code-block:: bash
curl -o install_salt.sh -L https://bootstrap.saltstack.com
sudo sh install_salt.sh -P git v2017.7.0rc1
sudo sh install_salt.sh -P git v2018.3.0rc1
If you want to also install a master using Salt Bootstrap, use the ``-M`` flag:
.. code-block:: bash
curl -o install_salt.sh -L https://bootstrap.saltstack.com
sudo sh install_salt.sh -P -M git v2017.7.0rc1
sudo sh install_salt.sh -P -M git v2018.3.0rc1
If you want to install only a master and not a minion using Salt Bootstrap, use
the ``-M`` and ``-N`` flags:
@ -62,13 +62,13 @@ the ``-M`` and ``-N`` flags:
.. code-block:: bash
curl -o install_salt.sh -L https://bootstrap.saltstack.com
sudo sh install_salt.sh -P -M -N git v2017.7.0rc1
sudo sh install_salt.sh -P -M -N git v2018.3.0rc1
Installing Using PyPI
=====================
Installing from the `source archive
<https://pypi.python.org/packages/5c/cf/13c14f8bcd7b5076b9a8c3580f9582c1c4ea8b0458793ac6744ea66c0baf/salt-2017.7.0rc1.tar.gz>`_ on
<https://pypi.python.org/pypi?:action=display&name=salt&version=2018.3.0rc1>`_ on
`PyPI <https://pypi.python.org/pypi>`_ is fairly straightforward.
.. note::
@ -106,4 +106,4 @@ Then install salt using the following command:
.. code-block:: bash
sudo pip install salt==2017.7.0rc1
sudo pip install salt==2018.3.0rc1

View File

@ -34,7 +34,7 @@ Assigned codenames:
- Boron: ``2016.3.0``
- Carbon: ``2016.11.0``
- Nitrogen: ``2017.7.0``
- Oxygen: ``TBD``
- Oxygen: ``2018.3.0``
- Fluorine: ``TBD``
Example
@ -69,10 +69,10 @@ Example arguments for `git checkout`:
+------------+----------------------------------------------------------------------------+
| v2016.11.1 | Tag signaling the commit that the 2016.11.1 release is based on. |
+------------+----------------------------------------------------------------------------+
Further reading on `release branch and develop branch
Further reading on `release branch and develop branch
<https://docs.saltstack.com/en/latest/topics/development/contributing.html#which-salt-branch>`_.
Influence of the `git checkout` argument on `git describe`:
+------------+----------------------------+-----------------------------------------------+
@ -97,4 +97,4 @@ Some details of v2016.11.1-220-g9a1550d (from `git describe` after `git checkout
|220 | Commits on top of the most recent tag, relative to your local git fetch |
+---------------+-------------------------------------------------------------------------+
|gf2eb3dc | 'g' + git SHA ("abbreviated name") of the most recent commit |
+---------------+-------------------------------------------------------------------------+
+---------------+-------------------------------------------------------------------------+

View File

@ -4,7 +4,7 @@
Slots
=====
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
.. note:: This functionality is under development and could be changed in the
future releases

View File

@ -4,7 +4,7 @@
Autoaccept minions from Grains
==============================
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
To automatically accept minions based on certain characteristics, e.g. the ``uuid``
you can specify certain grain values on the salt master. Minions with matching grains

View File

@ -196,7 +196,7 @@ master:
- gitfs
.. note::
``git`` also works here. Prior to the Oxygen release, *only* ``git``
``git`` also works here. Prior to the 2018.3.0 release, *only* ``git``
would work.
2. Specify one or more ``git://``, ``https://``, ``file://``, or ``ssh://``
@ -314,9 +314,9 @@ configured gitfs remotes):
* :conf_master:`gitfs_privkey` (**pygit2 only**, new in 2014.7.0)
* :conf_master:`gitfs_passphrase` (**pygit2 only**, new in 2014.7.0)
* :conf_master:`gitfs_refspecs` (new in 2017.7.0)
* :conf_master:`gitfs_disable_saltenv_mapping` (new in Oxygen)
* :conf_master:`gitfs_ref_types` (new in Oxygen)
* :conf_master:`gitfs_update_interval` (new in Oxygen)
* :conf_master:`gitfs_disable_saltenv_mapping` (new in 2018.3.0)
* :conf_master:`gitfs_ref_types` (new in 2018.3.0)
* :conf_master:`gitfs_update_interval` (new in 2018.3.0)
.. note::
pygit2 only supports disabling SSL verification in versions 0.23.2 and
@ -370,7 +370,7 @@ tremendous amount of customization. Here's some example usage:
``name``, ``saltenv``, and ``all_saltenvs`` parameters, which are only
available to per-remote configurations.
The ``all_saltenvs`` parameter is new in the Oxygen release.
The ``all_saltenvs`` parameter is new in the 2018.3.0 release.
In the example configuration above, the following is true:
@ -526,7 +526,7 @@ would only fetch branches and tags (the default).
Global Remotes
==============
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The ``all_saltenvs`` per-remote configuration parameter overrides the logic
Salt uses to map branches/tags to fileserver environments (i.e. saltenvs). This
@ -553,7 +553,7 @@ single branch.
Update Intervals
================
Prior to the Oxygen release, GitFS would update its fileserver backends as part
Prior to the 2018.3.0 release, GitFS would update its fileserver backends as part
of a dedicated "maintenance" process, in which various routine maintenance
tasks were performed. This tied the update interval to the
:conf_master:`loop_interval` config option, and also forced all fileservers to

View File

@ -4,7 +4,7 @@
Using Apache Libcloud for declarative and procedural multi-cloud orchestration
==============================================================================
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
.. note::

View File

@ -86,8 +86,8 @@ option on the master:
- minionfs
.. note::
``minion`` also works here. Prior to the Oxygen release, *only* ``minion``
would work.
``minion`` also works here. Prior to the 2018.3.0 release, *only*
``minion`` would work.
Also, as described earlier, ``file_recv: True`` is needed to enable the
master to receive files pushed from minions. As always, changes to the

View File

@ -81,7 +81,7 @@ the ``foo`` utility module with a ``__virtual__`` function.
def bar():
return 'baz'
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Instantiating objects from classes declared in util modules works with
Master side modules, such as Runners, Outputters, etc.

View File

@ -389,7 +389,7 @@ class LoadAuth(object):
def check_authentication(self, load, auth_type, key=None, show_username=False):
'''
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Go through various checks to see if the token/eauth/user can be authenticated.

View File

@ -2,7 +2,7 @@
'''
Provide authentication using local files
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
The `file` auth module allows simple authentication via local files. Different
filetypes are supported, including:

View File

@ -12,6 +12,8 @@ from salt.ext import six
# Import salt libs
from salt.exceptions import CommandExecutionError, SaltInvocationError
import salt.utils.stringutils
import salt.utils.data
log = logging.getLogger(__name__)
# Import third party libs
@ -39,6 +41,7 @@ __defopts__ = {'auth.ldap.basedn': '',
'auth.ldap.persontype': 'person',
'auth.ldap.groupclass': 'posixGroup',
'auth.ldap.activedirectory': False,
'auth.ldap.freeipa': False,
'auth.ldap.minion_stripdomains': [],
}
@ -290,10 +293,10 @@ def auth(username, password):
if bind:
log.debug('LDAP authentication successful')
return True
else:
log.error('LDAP _bind authentication FAILED')
return False
return bind
log.error('LDAP _bind authentication FAILED')
return False
def groups(username, **kwargs):
@ -312,14 +315,7 @@ def groups(username, **kwargs):
'''
group_list = []
# If bind credentials are configured, use them instead of user's
if _config('binddn', mandatory=False) and _config('bindpw', mandatory=False):
bind = _bind_for_search(anonymous=_config('anonymous', mandatory=False))
else:
bind = _bind(username, kwargs.get('password', ''),
anonymous=_config('auth_by_group_membership_only', mandatory=False)
and _config('anonymous', mandatory=False))
bind = auth(username, kwargs.get('password', None))
if bind:
log.debug('ldap bind to determine group membership succeeded!')
@ -331,7 +327,7 @@ def groups(username, **kwargs):
_config('persontype'))
user_dn_results = bind.search_s(_config('basedn'),
ldap.SCOPE_SUBTREE,
get_user_dn_search, ['distinguishedName'])
get_user_dn_search, [str('distinguishedName')]) # future lint: disable=blacklisted-function
except Exception as e:
log.error('Exception thrown while looking up user DN in AD: %s', e)
return group_list
@ -346,13 +342,13 @@ def groups(username, **kwargs):
search_results = bind.search_s(_config('basedn'),
ldap.SCOPE_SUBTREE,
ldap_search_string,
[_config('accountattributename'), 'cn'])
[salt.utils.stringutils.to_str(_config('accountattributename')), str('cn')]) # future lint: disable=blacklisted-function
except Exception as e:
log.error('Exception thrown while retrieving group membership in AD: %s', e)
return group_list
for _, entry in search_results:
if 'cn' in entry:
group_list.append(entry['cn'][0])
group_list.append(salt.utils.stringutils.to_unicode(entry['cn'][0]))
log.debug('User %s is a member of groups: %s', username, group_list)
elif _config('freeipa'):
@ -362,11 +358,11 @@ def groups(username, **kwargs):
search_results = bind.search_s(search_base,
ldap.SCOPE_SUBTREE,
search_string,
[_config('accountattributename'), 'cn', _config('groupattribute'), 'cn'])
[salt.utils.stringutils.to_str(_config('accountattributename')), str('cn')]) # future lint: disable=blacklisted-function
for entry, result in search_results:
for user in result[_config('accountattributename'), _config('groupattribute')]:
if username == user.split(',')[0].split('=')[-1]:
if username == salt.utils.stringutils.to_unicode(user).split(',')[0].split('=')[-1]:
group_list.append(entry.split(',')[0].split('=')[-1])
log.debug('User %s is a member of groups: %s', username, group_list)
@ -384,14 +380,16 @@ def groups(username, **kwargs):
search_results = bind.search_s(search_base,
ldap.SCOPE_SUBTREE,
search_string,
[_config('accountattributename'), 'cn', _config('groupattribute')])
[salt.utils.stringutils.to_str(_config('accountattributename')),
str('cn'), # future lint: disable=blacklisted-function
salt.utils.stringutils.to_str(_config('groupattribute'))])
for _, entry in search_results:
if username in entry[_config('accountattributename')]:
group_list.append(entry['cn'][0])
if username in salt.utils.data.decode(entry[_config('accountattributename')]):
group_list.append(salt.utils.stringutils.to_unicode(entry['cn'][0]))
for user, entry in search_results:
if username == user.split(',')[0].split('=')[-1]:
for group in entry[_config('groupattribute')]:
group_list.append(group.split(',')[0].split('=')[-1])
if username == salt.utils.stringutils.to_unicode(user).split(',')[0].split('=')[-1]:
for group in salt.utils.data.decode(entry[_config('groupattribute')]):
group_list.append(salt.utils.stringutils.to_unicode(group).split(',')[0].split('=')[-1])
log.debug('User %s is a member of groups: %s', username, group_list)
# Only test user auth on first call for job.
@ -445,7 +443,7 @@ def __expand_ldap_entries(entries, opts=None):
search_results = bind.search_s(search_base,
ldap.SCOPE_SUBTREE,
search_string,
['cn'])
[str('cn')]) # future lint: disable=blacklisted-function
for ldap_match in search_results:
try:
minion_id = ldap_match[1]['cn'][0].lower()

View File

@ -2,7 +2,7 @@
'''
Beacon to fire event when we notice a AIX user is locked due to many failed login attempts.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:depends: none
'''

View File

@ -3,7 +3,7 @@
NAPALM functions
================
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Watch NAPALM functions and fire events on specific triggers.

View File

@ -57,11 +57,6 @@ from salt.exceptions import (
# Import third party libs
from salt.ext import six
# pylint: disable=import-error
try:
import zmq
HAS_ZMQ = True
except ImportError:
HAS_ZMQ = False
# Try to import range from https://github.com/ytoolshed/range
HAS_RANGE = False

View File

@ -384,7 +384,11 @@ class SyncClientMixin(object):
# Initialize a context for executing the method.
with tornado.stack_context.StackContext(self.functions.context_dict.clone):
data['return'] = self.functions[fun](*args, **kwargs)
func = self.functions[fun]
try:
data['return'] = func(*args, **kwargs)
except TypeError as exc:
data['return'] = '\nPassed invalid arguments: {0}\n\nUsage:\n{1}'.format(exc, func.__doc__)
try:
data['success'] = self.context.get('retcode', 0) == 0
except AttributeError:

View File

@ -60,11 +60,7 @@ try:
HAS_WINSHELL = False
except ImportError:
HAS_WINSHELL = False
try:
import zmq
HAS_ZMQ = True
except ImportError:
HAS_ZMQ = False
from salt.utils.zeromq import zmq
# The directory where salt thin is deployed
DEFAULT_THIN_DIR = '/var/tmp/.%%USER%%_%%FQDNUUID%%_salt'
@ -214,7 +210,7 @@ class SSH(object):
def __init__(self, opts):
self.__parsed_rosters = {SSH.ROSTER_UPDATE_FLAG: True}
pull_sock = os.path.join(opts['sock_dir'], 'master_event_pull.ipc')
if os.path.exists(pull_sock) and HAS_ZMQ:
if os.path.exists(pull_sock) and zmq:
self.event = salt.utils.event.get_event(
'master',
opts['sock_dir'],
@ -444,7 +440,7 @@ class SSH(object):
if target.get('passwd', False) or self.opts['ssh_passwd']:
self._key_deploy_run(host, target, False)
return ret
if ret[host].get('stderr', '').count('Permission denied'):
if (ret[host].get('stderr') or '').count('Permission denied'):
target = self.targets[host]
# permission denied, attempt to auto deploy ssh key
print(('Permission denied for host {0}, do you want to deploy '
@ -662,7 +658,9 @@ class SSH(object):
host = next(six.iterkeys(ret))
self.cache_job(jid, host, ret[host], fun)
if self.event:
_, data = next(six.iteritems(ret))
id_, data = next(six.iteritems(ret))
if 'id' not in data:
data['id'] = id_
data['jid'] = jid # make the jid in the payload the same as the jid in the tag
self.event.fire_event(
data,
@ -755,7 +753,7 @@ class SSH(object):
self.cache_job(jid, host, ret[host], fun)
ret = self.key_deploy(host, ret)
if isinstance(ret[host], dict) and ret[host].get('stderr', '').startswith('ssh:'):
if isinstance(ret[host], dict) and (ret[host].get('stderr') or '').startswith('ssh:'):
ret[host] = ret[host]['stderr']
if not isinstance(ret[host], dict):
@ -773,7 +771,9 @@ class SSH(object):
outputter,
self.opts)
if self.event:
_, data = next(six.iteritems(ret))
id_, data = next(six.iteritems(ret))
if 'id' not in data:
data['id'] = id_
data['jid'] = jid # make the jid in the payload the same as the jid in the tag
self.event.fire_event(
data,

View File

@ -125,7 +125,7 @@ class FunctionWrapper(object):
'stderr': stderr,
'retcode': retcode}
try:
ret = salt.utils.json.loads(stdout, object_hook=salt.utils.data.decode_dict)
ret = salt.utils.json.loads(stdout)
if len(ret) < 2 and 'local' in ret:
ret = ret['local']
ret = ret.get('return', {})

View File

@ -197,7 +197,7 @@ def sls(mods, saltenv='base', test=None, exclude=None, **kwargs):
# Read in the JSON data and return the data structure
try:
return salt.utils.json.loads(stdout, object_hook=salt.utils.data.decode_dict)
return salt.utils.json.loads(stdout)
except Exception as e:
log.error("JSON Render failed for: %s\n%s", stdout, stderr)
log.error(six.text_type(e))
@ -341,7 +341,7 @@ def low(data, **kwargs):
# Read in the JSON data and return the data structure
try:
return salt.utils.json.loads(stdout, object_hook=salt.utils.data.decode_dict)
return salt.utils.json.loads(stdout)
except Exception as e:
log.error("JSON Render failed for: %s\n%s", stdout, stderr)
log.error(six.text_type(e))
@ -432,7 +432,7 @@ def high(data, **kwargs):
# Read in the JSON data and return the data structure
try:
return salt.utils.json.loads(stdout, object_hook=salt.utils.data.decode_dict)
return salt.utils.json.loads(stdout)
except Exception as e:
log.error("JSON Render failed for: %s\n%s", stdout, stderr)
log.error(six.text_type(e))
@ -677,7 +677,7 @@ def highstate(test=None, **kwargs):
# Read in the JSON data and return the data structure
try:
return salt.utils.json.loads(stdout, object_hook=salt.utils.data.decode_dict)
return salt.utils.json.loads(stdout)
except Exception as e:
log.error("JSON Render failed for: %s\n%s", stdout, stderr)
log.error(six.text_type(e))
@ -760,7 +760,7 @@ def top(topfn, test=None, **kwargs):
# Read in the JSON data and return the data structure
try:
return salt.utils.json.loads(stdout, object_hook=salt.utils.data.decode_dict)
return salt.utils.json.loads(stdout)
except Exception as e:
log.error("JSON Render failed for: %s\n%s", stdout, stderr)
log.error(six.text_type(e))
@ -1133,7 +1133,7 @@ def single(fun, name, test=None, **kwargs):
# Read in the JSON data and return the data structure
try:
return salt.utils.json.loads(stdout, object_hook=salt.utils.data.decode_dict)
return salt.utils.json.loads(stdout)
except Exception as e:
log.error("JSON Render failed for: %s\n%s", stdout, stderr)
log.error(six.text_type(e))

View File

@ -823,7 +823,7 @@ def query(params=None):
content = request.text
result = salt.utils.json.loads(content, object_hook=salt.utils.data.encode_dict)
result = salt.utils.json.loads(content)
if 'Code' in result:
raise SaltCloudSystemExit(
pprint.pformat(result.get('Message', {}))

View File

@ -10,9 +10,16 @@ Azure ARM Cloud Module
The Azure ARM cloud module is used to control access to Microsoft Azure Resource Manager
:depends:
* `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure>`_ >= 2.0rc6
* `Microsoft Azure Storage SDK for Python <https://pypi.python.org/pypi/azure-storage>`_ >= 0.32
* `AutoRest swagger generator Python client runtime (Azure-specific module) <https://pypi.python.org/pypi/msrestazure>`_ >= 0.4
* `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0rc6
* `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.4
* `azure-mgmt <https://pypi.python.org/pypi/azure-mgmt>`_ >= 0.30.0rc6
* `azure-mgmt-compute <https://pypi.python.org/pypi/azure-mgmt-compute>`_ >= 0.33.0
* `azure-mgmt-network <https://pypi.python.org/pypi/azure-mgmt-network>`_ >= 0.30.0rc6
* `azure-mgmt-resource <https://pypi.python.org/pypi/azure-mgmt-resource>`_ >= 0.30.0
* `azure-mgmt-storage <https://pypi.python.org/pypi/azure-mgmt-storage>`_ >= 0.30.0rc6
* `azure-mgmt-web <https://pypi.python.org/pypi/azure-mgmt-web>`_ >= 0.30.0rc6
* `azure-storage <https://pypi.python.org/pypi/azure-storage>`_ >= 0.32.0
* `msrestazure <https://pypi.python.org/pypi/msrestazure>`_ >= 0.4.21
:configuration:
Required provider parameters:
@ -774,6 +781,25 @@ def create_network_interface(call=None, kwargs=None):
ip_kwargs = {}
ip_configurations = None
if 'load_balancer_backend_address_pools' in kwargs:
pool_dicts = kwargs['load_balancer_backend_address_pools']
if isinstance(pool_dicts, dict):
pool_ids = []
for load_bal, be_pools in pool_dicts.items():
for pool in be_pools:
try:
lbbep_data = netconn.load_balancer_backend_address_pools.get(
kwargs['resource_group'],
load_bal,
pool,
)
pool_ids.append({'id': lbbep_data.as_dict()['id']})
except CloudError as exc:
log.error('There was a cloud error: %s', six.text_type(exc))
except KeyError as exc:
log.error('There was an error getting the Backend Pool ID: %s', six.text_type(exc))
ip_kwargs['load_balancer_backend_address_pools'] = pool_ids
if 'private_ip_address' in kwargs.keys():
ip_kwargs['private_ip_address'] = kwargs['private_ip_address']
ip_kwargs['private_ip_allocation_method'] = IPAllocationMethod.static
@ -930,6 +956,11 @@ def request_instance(vm_):
compute_models, 'VirtualMachineSizeTypes'
)
subscription_id = config.get_cloud_config_value(
'subscription_id',
get_configured_provider(), __opts__, search_global=False
)
if vm_.get('driver') is None:
vm_['driver'] = 'azurearm'
@ -1039,6 +1070,24 @@ def request_instance(vm_):
)
os_kwargs['admin_password'] = vm_password
availability_set = config.get_cloud_config_value(
'availability_set',
vm_,
__opts__,
search_global=False,
default=None
)
if availability_set is not None and isinstance(availability_set, six.string_types):
availability_set = {
'id': '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Compute/availabilitySets/{2}'.format(
subscription_id,
vm_['resource_group'],
availability_set
)
}
else:
availability_set = None
cloud_env = _get_cloud_environment()
storage_endpoint_suffix = cloud_env.suffixes.storage_endpoint
@ -1147,7 +1196,10 @@ def request_instance(vm_):
img_pub, img_off, img_sku, img_ver = vm_['image'].split('|')
source_image = None
os_type = None
os_disk = None
os_disk = OSDisk(
create_option=DiskCreateOptionTypes.from_image,
disk_size_gb=vm_.get('os_disk_size_gb')
)
img_ref = ImageReference(
publisher=img_pub,
offer=img_off,
@ -1235,6 +1287,7 @@ def request_instance(vm_):
NetworkInterfaceReference(vm_['iface_id']),
],
),
availability_set=availability_set,
)
__utils__['cloud.fire_event'](
@ -1257,15 +1310,15 @@ def request_instance(vm_):
parameters=params
)
vm_create.wait()
vm_result = vm_create.result()
vm_result = vm_result.as_dict()
if custom_extension:
create_or_update_vmextension(kwargs=custom_extension)
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', exc.message)
vm_result = {}
try:
return show_instance(vm_['name'], call='action')
except CloudError:
return {}
return vm_result
def create(vm_):
@ -1304,7 +1357,12 @@ def create(vm_):
log.info('Creating Cloud VM %s in %s', vm_['name'], location)
request_instance(vm_=vm_)
vm_request = request_instance(vm_=vm_)
if not vm_request or 'error' in vm_request:
err_message = 'Error creating VM {0}! ({1})'.format(vm_['name'], six.text_type(vm_request))
log.error(err_message)
raise SaltCloudSystemExit(err_message)
def _query_node_data(name, bootstrap_interface):
'''

View File

@ -42,10 +42,11 @@ from salt.ext import six
# pylint: disable=import-error
try:
from libcloud.compute.drivers.cloudstack import CloudStackNetwork
# This work-around for Issue #32743 is no longer needed for libcloud >= 1.4.0.
# However, older versions of libcloud must still be supported with this work-around.
# This work-around can be removed when the required minimum version of libcloud is
# 2.0.0 (See PR #40837 - which is implemented in Salt Oxygen).
# This work-around for Issue #32743 is no longer needed for libcloud >=
# 1.4.0. However, older versions of libcloud must still be supported with
# this work-around. This work-around can be removed when the required
# minimum version of libcloud is 2.0.0 (See PR #40837 - which is
# implemented in Salt 2018.3.0).
if _LooseVersion(libcloud.__version__) < _LooseVersion('1.4.0'):
# See https://github.com/saltstack/salt/issues/32743
import libcloud.security

View File

@ -40,10 +40,11 @@ try:
from libcloud.loadbalancer.types import Provider as Provider_lb
from libcloud.loadbalancer.providers import get_driver as get_driver_lb
# This work-around for Issue #32743 is no longer needed for libcloud >= 1.4.0.
# However, older versions of libcloud must still be supported with this work-around.
# This work-around can be removed when the required minimum version of libcloud is
# 2.0.0 (See PR #40837 - which is implemented in Salt Oxygen).
# This work-around for Issue #32743 is no longer needed for libcloud >=
# 1.4.0. However, older versions of libcloud must still be supported with
# this work-around. This work-around can be removed when the required
# minimum version of libcloud is 2.0.0 (See PR #40837 - which is
# implemented in Salt 2018.3.0).
if _LooseVersion(libcloud.__version__) < _LooseVersion('1.4.0'):
# See https://github.com/saltstack/salt/issues/32743
import libcloud.security

View File

@ -70,10 +70,11 @@ try:
ResourceInUseError,
ResourceNotFoundError,
)
# This work-around for Issue #32743 is no longer needed for libcloud >= 1.4.0.
# However, older versions of libcloud must still be supported with this work-around.
# This work-around can be removed when the required minimum version of libcloud is
# 2.0.0 (See PR #40837 - which is implemented in Salt Oxygen).
# This work-around for Issue #32743 is no longer needed for libcloud >=
# 1.4.0. However, older versions of libcloud must still be supported with
# this work-around. This work-around can be removed when the required
# minimum version of libcloud is 2.0.0 (See PR #40837 - which is
# implemented in Salt 2018.3.0).
if _LooseVersion(libcloud.__version__) < _LooseVersion('1.4.0'):
# See https://github.com/saltstack/salt/issues/32743
import libcloud.security

View File

@ -758,7 +758,7 @@ def get_template_image(kwargs=None, call=None):
'''
Returns a template's image from the given template name.
.. versionadded:: oxygen
.. versionadded:: 2018.3.0
.. code-block:: bash
@ -921,7 +921,7 @@ def _get_device_template(disk, disk_info, template=None):
'''
Returns the template format to create a disk in open nebula
.. versionadded:: oxygen
.. versionadded:: 2018.3.0
'''
def _require_disk_opts(*args):

View File

@ -188,7 +188,7 @@ def query(params=None):
log.debug(request.url)
content = request.text
result = salt.utils.json.loads(content, object_hook=salt.utils.data.encode_dict)
result = salt.utils.json.loads(content)
# print('response:')
# pprint.pprint(result)

View File

@ -9,7 +9,7 @@ The Saltify module is designed to install Salt on a remote machine, virtual or
bare metal, using SSH. This module is useful for provisioning machines which
are already installed, but not Salted.
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
The wake_on_lan capability, and actions destroy, reboot, and query functions were added.
Use of this module requires some configuration in cloud profile and provider
@ -88,7 +88,7 @@ def avail_images(call=None):
returns a list of available profiles.
..versionadded:: Oxygen
..versionadded:: 2018.3.0
'''
vm_ = get_configured_provider()
@ -118,7 +118,7 @@ def list_nodes(call=None):
returns a list of dictionaries of defined standard fields.
..versionadded:: Oxygen
..versionadded:: 2018.3.0
'''
nodes = _list_nodes_full(call)
@ -164,7 +164,7 @@ def list_nodes_full(call=None):
for 'saltify' minions, returns dict of grains (enhanced).
..versionadded:: Oxygen
..versionadded:: 2018.3.0
'''
ret = _list_nodes_full(call)
@ -399,7 +399,7 @@ def _verify(vm_):
def destroy(name, call=None):
''' Destroy a node.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Disconnect a minion from the master, and remove its keys.
@ -489,7 +489,7 @@ def reboot(name, call=None):
'''
Reboot a saltify minion.
..versionadded:: Oxygen
..versionadded:: 2018.3.0
name
The name of the VM to reboot.

View File

@ -10,7 +10,7 @@ Use of this module requires some configuration in cloud profile and provider
files as described in the
:ref:`Getting Started with Vagrant <getting-started-with-vagrant>` documentation.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
'''

View File

@ -1528,6 +1528,7 @@ DEFAULT_MASTER_OPTS = {
'pillarenv': None,
'default_top': 'base',
'file_client': 'local',
'local': True,
# Update intervals
'roots_update_interval': DEFAULT_INTERVAL,
@ -1814,7 +1815,6 @@ DEFAULT_MASTER_OPTS = {
'schedule': {},
'auth_events': True,
'minion_data_cache_events': True,
'enable_ssh': False,
'enable_ssh_minions': False,
}

View File

@ -806,7 +806,7 @@ class AsyncAuth(object):
pubkey_path = os.path.join(self.opts['pki_dir'], self.mpub)
pub = get_rsa_pub_key(pubkey_path)
if HAS_M2:
payload['token'] = pub.public_encrypt(six.b(self.token), RSA.pkcs1_oaep_padding)
payload['token'] = pub.public_encrypt(self.token, RSA.pkcs1_oaep_padding)
else:
cipher = PKCS1_OAEP.new(pub)
payload['token'] = cipher.encrypt(self.token)
@ -845,7 +845,8 @@ class AsyncAuth(object):
log.debug('Decrypting the current master AES key')
key = self.get_keys()
if HAS_M2:
key_str = key.private_decrypt(six.b(payload['aes']), RSA.pkcs1_oaep_padding)
key_str = key.private_decrypt(payload['aes'],
RSA.pkcs1_oaep_padding)
else:
cipher = PKCS1_OAEP.new(key)
key_str = cipher.decrypt(payload['aes'])
@ -876,7 +877,8 @@ class AsyncAuth(object):
else:
if 'token' in payload:
if HAS_M2:
token = key.private_decrypt(six.b(payload['token']), RSA.pkcs1_oaep_padding)
token = key.private_decrypt(payload['token'],
RSA.pkcs1_oaep_padding)
else:
token = cipher.decrypt(payload['token'])
return key_str, token

View File

@ -62,7 +62,10 @@ def jobber_check(self):
rms.append(jid)
data = self.shells.value[jid]
stdout, stderr = data['proc'].communicate()
ret = salt.utils.json.loads(stdout, object_hook=salt.utils.data.encode_dict)['local']
ret = salt.utils.json.loads(
stdout,
object_hook=salt.utils.data.encode_dict if six.PY2 else None
)['local']
route = {'src': (self.stack.value.local.name, 'manor', 'jid_ret'),
'dst': (data['msg']['route']['src'][0], None, 'remote_cmd')}
ret['cmd'] = '_return'

View File

@ -15,16 +15,12 @@ import errno
# Import ioflo libs
import ioflo.base.deeding
# Import third party libs
try:
import zmq
import salt.master
import salt.crypt
import salt.daemons.masterapi
import salt.payload
import salt.utils.stringutils
HAS_ZMQ = True
except ImportError:
HAS_ZMQ = False
from salt.utils.zeromq import zmq
import salt.master
import salt.crypt
import salt.daemons.masterapi
import salt.payload
import salt.utils.stringutils
log = logging.getLogger(__name__)
@ -160,7 +156,7 @@ class SaltZmqPublisher(ioflo.base.deeding.Deed):
'''
Set up tracking value(s)
'''
if not HAS_ZMQ:
if not zmq:
return
self.created = False
self.serial = salt.payload.Serial(self.opts.value)

View File

@ -6,7 +6,7 @@ HTTP Logstash engine
An engine that reads messages from the salt event bus and pushes
them onto a logstash endpoint via HTTP requests.
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
.. note::
By default, this engine take everything from the Salt bus and exports into

View File

@ -173,11 +173,7 @@ from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import third party libraries
try:
import zmq
HAS_ZMQ = True
except ImportError:
HAS_ZMQ = False
from salt.utils.zeromq import zmq
try:
# pylint: disable=W0611
@ -209,7 +205,7 @@ def __virtual__():
'''
Load only if napalm-logs is installed.
'''
if not HAS_NAPALM_LOGS or not HAS_ZMQ:
if not HAS_NAPALM_LOGS or not zmq:
return (False, 'napalm_syslog could not be loaded. \
Please install napalm-logs library amd ZeroMQ.')
return True

View File

@ -37,7 +37,7 @@ def inet_pton(address_family, ip_string):
# This will catch IP Addresses such as 10.1.2
if address_family == socket.AF_INET:
try:
ipaddress.ip_address(six.u(ip_string))
ipaddress.ip_address(six.text_type(ip_string))
except ValueError:
raise socket.error('illegal IP address string passed to inet_pton')
return socket.inet_aton(ip_string)

View File

@ -12,9 +12,9 @@ the Master config file.
fileserver_backend:
- azurefs
Starting in Oxygen, this fileserver requires the standalone Azure Storage SDK
for Python. Theoretically any version >= v0.20.0 should work, but it was
developed against the v0.33.0 version.
Starting in Salt 2018.3.0, this fileserver requires the standalone Azure
Storage SDK for Python. Theoretically any version >= v0.20.0 should work, but
it was developed against the v0.33.0 version.
Each storage container will be mapped to an environment. By default, containers
will be mapped to the ``base`` environment. You can override this behavior with

View File

@ -14,7 +14,7 @@ Master config file.
- gitfs
.. note::
``git`` also works here. Prior to the Oxygen release, *only* ``git``
``git`` also works here. Prior to the 2018.3.0 release, *only* ``git``
would work.
The Git fileserver backend supports both pygit2_ and GitPython_, to provide the

View File

@ -11,7 +11,7 @@ Master config file.
- hgfs
.. note::
``hg`` also works here. Prior to the Oxygen release, *only* ``hg`` would
``hg`` also works here. Prior to the 2018.3.0 release, *only* ``hg`` would
work.
After enabling this backend, branches, bookmarks, and tags in a remote

View File

@ -17,8 +17,8 @@ allowed to push files to the Master), and ``minionfs`` must be added to the
- minionfs
.. note::
``minion`` also works here. Prior to the Oxygen release, *only* ``minion``
would work.
``minion`` also works here. Prior to the 2018.3.0 release, *only*
``minion`` would work.
Other minionfs settings include: :conf_master:`minionfs_whitelist`,
:conf_master:`minionfs_blacklist`, :conf_master:`minionfs_mountpoint`, and

View File

@ -13,8 +13,8 @@ Master config file.
- svnfs
.. note::
``svn`` also works here. Prior to the Oxygen release, *only* ``svn`` would
work.
``svn`` also works here. Prior to the 2018.3.0 release, *only* ``svn``
would work.
This backend assumes a standard svn layout with directories for ``branches``,
``tags``, and ``trunk``, at the repository root.

View File

@ -24,6 +24,13 @@ import uuid
from errno import EACCES, EPERM
import datetime
# pylint: disable=import-error
try:
import dateutil.tz
_DATEUTIL_TZ = True
except ImportError:
_DATEUTIL_TZ = False
__proxyenabled__ = ['*']
__FQDN__ = None
@ -1333,19 +1340,22 @@ def _get_interfaces():
return _INTERFACES
def _parse_os_release():
def _parse_os_release(os_release_files):
'''
Parse /etc/os-release and return a parameter dictionary
Parse os-release and return a parameter dictionary
See http://www.freedesktop.org/software/systemd/man/os-release.html
for specification of the file format.
'''
filename = '/etc/os-release'
if not os.path.isfile(filename):
filename = '/usr/lib/os-release'
data = dict()
for filename in os_release_files:
if os.path.isfile(filename):
break
else:
# None of the specified os-release files exist
return data
with salt.utils.files.fopen(filename) as ifile:
regex = re.compile('^([\\w]+)=(?:\'|")?(.*?)(?:\'|")?$')
for line in ifile:
@ -1540,13 +1550,15 @@ def os_data():
# to be incorrectly set to "Arch".
grains['osfullname'] = 'Antergos Linux'
elif 'lsb_distrib_id' not in grains:
if os.path.isfile('/etc/os-release') or os.path.isfile('/usr/lib/os-release'):
os_release = _parse_os_release()
os_release = _parse_os_release(['/etc/os-release', '/usr/lib/os-release'])
if os_release:
if 'NAME' in os_release:
grains['lsb_distrib_id'] = os_release['NAME'].strip()
if 'VERSION_ID' in os_release:
grains['lsb_distrib_release'] = os_release['VERSION_ID']
if 'PRETTY_NAME' in os_release:
if 'VERSION_CODENAME' in os_release:
grains['lsb_distrib_codename'] = os_release['VERSION_CODENAME']
elif 'PRETTY_NAME' in os_release:
codename = os_release['PRETTY_NAME']
# https://github.com/saltstack/salt/issues/44108
if os_release['ID'] == 'debian':
@ -1810,7 +1822,7 @@ def os_data():
grains['osrelease_info']
)
os_name = grains['os' if grains.get('os') in (
'FreeBSD', 'OpenBSD', 'NetBSD', 'Mac', 'Raspbian') else 'osfullname']
'Debian', 'FreeBSD', 'OpenBSD', 'NetBSD', 'Mac', 'Raspbian') else 'osfullname']
grains['osfinger'] = '{0}-{1}'.format(
os_name, grains['osrelease'] if os_name in ('Ubuntu',) else grains['osrelease_info'][0])
@ -1840,6 +1852,8 @@ def locale_info():
grains['locale_info']['defaultlanguage'] = 'unknown'
grains['locale_info']['defaultencoding'] = 'unknown'
grains['locale_info']['detectedencoding'] = __salt_system_encoding__
if _DATEUTIL_TZ:
grains['locale_info']['timezone'] = datetime.datetime.now(dateutil.tz.tzlocal()).tzname()
return grains
@ -2517,13 +2531,16 @@ def _linux_iqn():
ret = []
initiator = '/etc/iscsi/initiatorname.iscsi'
if os.path.isfile(initiator):
try:
with salt.utils.files.fopen(initiator, 'r') as _iscsi:
for line in _iscsi:
line = line.strip()
if line.startswith('InitiatorName='):
ret.append(line.split('=', 1)[1])
except IOError as ex:
if ex.errno != os.errno.ENOENT:
log.debug("Error while accessing '%s': %s", initiator, ex)
return ret

View File

@ -7,7 +7,7 @@ ZFS grain provider
:depends: salt.utils, salt.module.cmdmod
:platform: illumos,freebsd,linux
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
'''
from __future__ import absolute_import, print_function, unicode_literals

View File

@ -24,21 +24,9 @@ import salt.serializers.msgpack
# pylint: disable=import-error,no-name-in-module,redefined-builtin
from salt.ext import six
from salt.ext.six.moves import range
from salt.utils.zeromq import zmq, ZMQDefaultLoop, install_zmq, ZMQ_VERSION_INFO
# pylint: enable=import-error,no-name-in-module,redefined-builtin
try:
import zmq
import zmq.eventloop.ioloop
# support pyzmq 13.0.x, TODO: remove once we force people to 14.0.x
if not hasattr(zmq.eventloop.ioloop, 'ZMQIOLoop'):
zmq.eventloop.ioloop.ZMQIOLoop = zmq.eventloop.ioloop.IOLoop
LOOP_CLASS = zmq.eventloop.ioloop.ZMQIOLoop
HAS_ZMQ = True
except ImportError:
import tornado.ioloop
LOOP_CLASS = tornado.ioloop.IOLoop
HAS_ZMQ = False
import tornado.gen # pylint: disable=F0401
# Import salt libs
@ -498,23 +486,13 @@ class Master(SMaster):
:param dict: The salt options
'''
if HAS_ZMQ:
# Warn if ZMQ < 3.2
try:
zmq_version_info = zmq.zmq_version_info()
except AttributeError:
# PyZMQ <= 2.1.9 does not have zmq_version_info, fall back to
# using zmq.zmq_version() and build a version info tuple.
zmq_version_info = tuple(
[int(x) for x in zmq.zmq_version().split('.')]
)
if zmq_version_info < (3, 2):
log.warning(
'You have a version of ZMQ less than ZMQ 3.2! There are '
'known connection keep-alive issues with ZMQ < 3.2 which '
'may result in loss of contact with minions. Please '
'upgrade your ZMQ!'
)
if zmq and ZMQ_VERSION_INFO < (3, 2):
log.warning(
'You have a version of ZMQ less than ZMQ 3.2! There are '
'known connection keep-alive issues with ZMQ < 3.2 which '
'may result in loss of contact with minions. Please '
'upgrade your ZMQ!'
)
SMaster.__init__(self, opts)
def __set_max_open_files(self):
@ -993,9 +971,8 @@ class MWorker(salt.utils.process.SignalHandlingMultiprocessingProcess):
Bind to the local port
'''
# using ZMQIOLoop since we *might* need zmq in there
if HAS_ZMQ:
zmq.eventloop.ioloop.install()
self.io_loop = LOOP_CLASS()
install_zmq()
self.io_loop = ZMQDefaultLoop()
self.io_loop.make_current()
for req_channel in self.req_channels:
req_channel.post_fork(self._handle_payload, io_loop=self.io_loop) # TODO: cleaner? Maybe lazily?
@ -2028,6 +2005,7 @@ class ClearFuncs(object):
)
minions = _res.get('minions', list())
missing = _res.get('missing', list())
ssh_minions = _res.get('ssh_minions', False)
# Check for external auth calls and authenticate
auth_type, err_name, key, sensitive_load_keys = self._prep_auth_info(extra)
@ -2095,7 +2073,7 @@ class ClearFuncs(object):
payload = self._prep_pub(minions, jid, clear_load, extra, missing)
# Send it!
minions.extend(self._send_ssh_pub(payload))
self._send_ssh_pub(payload, ssh_minions=ssh_minions)
self._send_pub(payload)
return {
@ -2158,20 +2136,19 @@ class ClearFuncs(object):
chan = salt.transport.server.PubServerChannel.factory(opts)
chan.publish(load)
def _send_ssh_pub(self, load):
@property
def ssh_client(self):
if not hasattr(self, '_ssh_client'):
self._ssh_client = salt.client.ssh.client.SSHClient(mopts=self.opts)
return self._ssh_client
def _send_ssh_pub(self, load, ssh_minions=False):
'''
Take a load and send it across the network to connected minions
Take a load and send it across the network to ssh minions
'''
minions = []
if self.opts['enable_ssh_minions'] is True and isinstance(load['tgt'], six.string_types):
# The isinstances makes sure that syndics work
log.debug('Use SSHClient for rostered minions')
ssh = salt.client.ssh.client.SSHClient()
ssh_minions = ssh._prep_ssh(**load).targets.keys()
if ssh_minions:
minions.extend(ssh_minions)
threading.Thread(target=ssh.cmd, kwargs=load).start()
return minions
if self.opts['enable_ssh_minions'] is True and ssh_minions is True:
log.debug('Send payload to ssh minions')
threading.Thread(target=self.ssh_client.cmd, kwargs=load).start()
def _prep_pub(self, minions, jid, clear_load, extra, missing):
'''

View File

@ -31,23 +31,11 @@ if six.PY3:
else:
import salt.ext.ipaddress as ipaddress
from salt.ext.six.moves import range
from salt.utils.zeromq import zmq, ZMQDefaultLoop, install_zmq, ZMQ_VERSION_INFO
# pylint: enable=no-name-in-module,redefined-builtin
# Import third party libs
try:
import zmq
# TODO: cleanup
import zmq.eventloop.ioloop
# support pyzmq 13.0.x, TODO: remove once we force people to 14.0.x
if not hasattr(zmq.eventloop.ioloop, 'ZMQIOLoop'):
zmq.eventloop.ioloop.ZMQIOLoop = zmq.eventloop.ioloop.IOLoop
LOOP_CLASS = zmq.eventloop.ioloop.ZMQIOLoop
HAS_ZMQ = True
except ImportError:
import tornado.ioloop
LOOP_CLASS = tornado.ioloop.IOLoop
HAS_ZMQ = False
HAS_RANGE = False
try:
import seco.range
@ -690,7 +678,7 @@ class MinionBase(object):
if self.opts['transport'] == 'detect':
self.opts['detect_mode'] = True
for trans in ('zeromq', 'tcp'):
if trans == 'zeromq' and not HAS_ZMQ:
if trans == 'zeromq' and not zmq:
continue
self.opts['transport'] = trans
pub_channel = salt.transport.client.AsyncPubChannel.factory(self.opts, **factory_kwargs)
@ -793,10 +781,8 @@ class SMinion(MinionBase):
# Clean out the proc directory (default /var/cache/salt/minion/proc)
if (self.opts.get('file_client', 'remote') == 'remote'
or self.opts.get('use_master_when_local', False)):
if self.opts['transport'] == 'zeromq' and HAS_ZMQ:
io_loop = zmq.eventloop.ioloop.ZMQIOLoop()
else:
io_loop = LOOP_CLASS.current()
install_zmq()
io_loop = ZMQDefaultLoop.current()
io_loop.run_sync(
lambda: self.eval_master(self.opts, failed=True)
)
@ -931,9 +917,8 @@ class MinionManager(MinionBase):
self.minions = []
self.jid_queue = []
if HAS_ZMQ:
zmq.eventloop.ioloop.install()
self.io_loop = LOOP_CLASS.current()
install_zmq()
self.io_loop = ZMQDefaultLoop.current()
self.process_manager = ProcessManager(name='MultiMinionProcessManager')
self.io_loop.spawn_callback(self.process_manager.run, async=True)
@ -1086,23 +1071,14 @@ class Minion(MinionBase):
self.periodic_callbacks = {}
if io_loop is None:
if HAS_ZMQ:
zmq.eventloop.ioloop.install()
self.io_loop = LOOP_CLASS.current()
install_zmq()
self.io_loop = ZMQDefaultLoop.current()
else:
self.io_loop = io_loop
# Warn if ZMQ < 3.2
if HAS_ZMQ:
try:
zmq_version_info = zmq.zmq_version_info()
except AttributeError:
# PyZMQ <= 2.1.9 does not have zmq_version_info, fall back to
# using zmq.zmq_version() and build a version info tuple.
zmq_version_info = tuple(
[int(x) for x in zmq.zmq_version().split('.')] # pylint: disable=no-member
)
if zmq_version_info < (3, 2):
if zmq:
if ZMQ_VERSION_INFO < (3, 2):
log.warning(
'You have a version of ZMQ less than ZMQ 3.2! There are '
'known connection keep-alive issues with ZMQ < 3.2 which '
@ -2161,6 +2137,8 @@ class Minion(MinionBase):
self.schedule.disable_job(name, persist)
elif func == 'postpone_job':
self.schedule.postpone_job(name, data)
elif func == 'skip_job':
self.schedule.skip_job(name, data)
elif func == 'reload':
self.schedule.reload(schedule)
elif func == 'list':
@ -2889,9 +2867,8 @@ class SyndicManager(MinionBase):
self.jid_forward_cache = set()
if io_loop is None:
if HAS_ZMQ:
zmq.eventloop.ioloop.install()
self.io_loop = LOOP_CLASS.current()
install_zmq()
self.io_loop = ZMQDefaultLoop.current()
else:
self.io_loop = io_loop

View File

@ -2,7 +2,7 @@
'''
Manage account locks on AIX systems
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:depends: none
'''

View File

@ -2,7 +2,7 @@
'''
Aptly Debian repository manager.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals

View File

@ -497,7 +497,7 @@ def install(name=None,
Install a specific version of the package, e.g. 1.2.3~0ubuntu0. Ignored
if "pkgs" or "sources" is passed.
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
version can now contain comparison operators (e.g. ``>1.2.3``,
``<=2.0``, etc.)
@ -518,7 +518,7 @@ def install(name=None,
ignored when comparing the currently-installed version to the desired
version.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Multiple Package Installation Options:
@ -1086,7 +1086,7 @@ def upgrade(refresh=True, dist_upgrade=False, **kwargs):
download_only
Only donwload the packages, don't unpack or install them
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
force_conf_new
Always install the new version of any configuration files.
@ -2160,7 +2160,7 @@ def mod_repo(repo, saltenv='base', **kwargs):
key_text
GPG key in string form to add to the APT GPG keyring
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
consolidate : False
If ``True``, will attempt to de-duplicate and consolidate sources

View File

@ -157,7 +157,7 @@ def list_(name,
re-downloading the archive if the cached copy matches the specified
hash.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
.. _tarfile: https://docs.python.org/2/library/tarfile.html
.. _xz: http://tukaani.org/xz/
@ -1135,7 +1135,7 @@ def is_encrypted(name, clean=False, saltenv='base', source_hash=None):
re-downloading the archive if the cached copy matches the specified
hash.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
CLI Examples:

View File

@ -0,0 +1,714 @@
# -*- coding: utf-8 -*-
'''
Azure (ARM) Compute Execution Module
.. versionadded:: Fluorine
:maintainer: <devops@decisionlab.io>
:maturity: new
:depends:
* `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0
* `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8
* `azure-mgmt <https://pypi.python.org/pypi/azure-mgmt>`_ >= 1.0.0
* `azure-mgmt-compute <https://pypi.python.org/pypi/azure-mgmt-compute>`_ >= 1.0.0
* `azure-mgmt-network <https://pypi.python.org/pypi/azure-mgmt-network>`_ >= 1.7.1
* `azure-mgmt-resource <https://pypi.python.org/pypi/azure-mgmt-resource>`_ >= 1.1.0
* `azure-mgmt-storage <https://pypi.python.org/pypi/azure-mgmt-storage>`_ >= 1.0.0
* `azure-mgmt-web <https://pypi.python.org/pypi/azure-mgmt-web>`_ >= 0.32.0
* `azure-storage <https://pypi.python.org/pypi/azure-storage>`_ >= 0.34.3
* `msrestazure <https://pypi.python.org/pypi/msrestazure>`_ >= 0.4.21
:platform: linux
:configuration: This module requires Azure Resource Manager credentials to be passed as keyword arguments
to every function in order to work properly.
Required provider parameters:
if using username and password:
* ``subscription_id``
* ``username``
* ``password``
if using a service principal:
* ``subscription_id``
* ``tenant``
* ``client_id``
* ``secret``
Optional provider parameters:
**cloud_environment**: Used to point the cloud driver to different API endpoints, such as Azure GovCloud.
Possible values:
* ``AZURE_PUBLIC_CLOUD`` (default)
* ``AZURE_CHINA_CLOUD``
* ``AZURE_US_GOV_CLOUD``
* ``AZURE_GERMAN_CLOUD``
'''
# Python libs
from __future__ import absolute_import
import logging
# Azure libs
HAS_LIBS = False
try:
import azure.mgmt.compute.models # pylint: disable=unused-import
from msrest.exceptions import SerializationError
from msrestazure.azure_exceptions import CloudError
HAS_LIBS = True
except ImportError:
pass
__virtualname__ = 'azurearm_compute'
log = logging.getLogger(__name__)
def __virtual__():
if not HAS_LIBS:
return (
False,
'The following dependencies are required to use the AzureARM modules: '
'Microsoft Azure SDK for Python >= 2.0rc6, '
'MS REST Azure (msrestazure) >= 0.4'
)
return __virtualname__
def availability_set_create_or_update(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: Fluorine
Create or update an availability set.
:param name: The availability set to create.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_set_create_or_update testset testgroup
'''
if 'location' not in kwargs:
rg_props = __salt__['azurearm_resource.resource_group_get'](
resource_group, **kwargs
)
if 'error' in rg_props:
log.error(
'Unable to determine location from resource group specified.'
)
return False
kwargs['location'] = rg_props['location']
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
# Use VM names to link to the IDs of existing VMs.
if isinstance(kwargs.get('virtual_machines'), list):
vm_list = []
for vm_name in kwargs.get('virtual_machines'):
vm_instance = __salt__['azurearm_compute.virtual_machine_get'](
name=vm_name,
resource_group=resource_group,
**kwargs
)
if 'error' not in vm_instance:
vm_list.append({'id': str(vm_instance['id'])})
kwargs['virtual_machines'] = vm_list
try:
setmodel = __utils__['azurearm.create_object_model']('compute', 'AvailabilitySet', **kwargs)
except TypeError as exc:
result = {'error': 'The object model could not be built. ({1})'.format(str(exc))}
return result
try:
av_set = compconn.availability_sets.create_or_update(
resource_group_name=resource_group,
availability_set_name=name,
parameters=setmodel
)
result = av_set.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
except SerializationError as exc:
result = {'error': 'The object model could not be parsed. ({0})'.format(str(exc))}
return result
def availability_set_delete(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Delete an availability set.
:param name: The availability set to delete.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_set_delete testset testgroup
'''
result = False
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
compconn.availability_sets.delete(
resource_group_name=resource_group,
availability_set_name=name
)
result = True
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
return result
def availability_set_get(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Get a dictionary representing an availability set's properties.
:param name: The availability set to get.
:param resource_group: The resource group name assigned to the
availability set.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_set_get testset testgroup
'''
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
av_set = compconn.availability_sets.get(
resource_group_name=resource_group,
availability_set_name=name
)
result = av_set.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def availability_sets_list(resource_group, **kwargs):
'''
.. versionadded:: Fluorine
List all availability sets within a resource group.
:param resource_group: The resource group name to list availability
sets within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_sets_list testgroup
'''
result = {}
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
avail_sets = __utils__['azurearm.paged_object_to_list'](
compconn.availability_sets.list(
resource_group_name=resource_group
)
)
for avail_set in avail_sets:
result[avail_set['name']] = avail_set
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def availability_sets_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: Fluorine
List all available virtual machine sizes that can be used to
to create a new virtual machine in an existing availability set.
:param name: The availability set name to list available
virtual machine sizes within.
:param resource_group: The resource group name to list available
availability set sizes within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.availability_sets_list_available_sizes testset testgroup
'''
result = {}
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
sizes = __utils__['azurearm.paged_object_to_list'](
compconn.availability_sets.list_available_sizes(
resource_group_name=resource_group,
availability_set_name=name
)
)
for size in sizes:
result[size['name']] = size
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machine_capture(name, destination_name, resource_group, prefix='capture-', overwrite=False, **kwargs):
'''
.. versionadded:: Fluorine
Captures the VM by copying virtual hard disks of the VM and outputs
a template that can be used to create similar VMs.
:param name: The name of the virtual machine.
:param destination_name: The destination container name.
:param resource_group: The resource group name assigned to the
virtual machine.
:param prefix: (Default: 'capture-') The captured virtual hard disk's name prefix.
:param overwrite: (Default: False) Overwrite the destination disk in case of conflict.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machine_capture testvm testcontainer testgroup
'''
# pylint: disable=invalid-name
VirtualMachineCaptureParameters = getattr(
azure.mgmt.compute.models, 'VirtualMachineCaptureParameters'
)
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
# pylint: disable=invalid-name
vm = compconn.virtual_machines.capture(
resource_group_name=resource_group,
vm_name=name,
parameters=VirtualMachineCaptureParameters(
vhd_prefix=prefix,
destination_container_name=destination_name,
overwrite_vhds=overwrite
)
)
vm.wait()
vm_result = vm.result()
result = vm_result.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machine_get(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Retrieves information about the model view or the instance view of a
virtual machine.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machine_get testvm testgroup
'''
expand = kwargs.get('expand')
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
# pylint: disable=invalid-name
vm = compconn.virtual_machines.get(
resource_group_name=resource_group,
vm_name=name,
expand=expand
)
result = vm.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machine_convert_to_managed_disks(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: Fluorine
Converts virtual machine disks from blob-based to managed disks. Virtual
machine must be stop-deallocated before invoking this operation.
:param name: The name of the virtual machine to convert.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machine_convert_to_managed_disks testvm testgroup
'''
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
# pylint: disable=invalid-name
vm = compconn.virtual_machines.convert_to_managed_disks(
resource_group_name=resource_group,
vm_name=name
)
vm.wait()
vm_result = vm.result()
result = vm_result.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machine_deallocate(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Power off a virtual machine and deallocate compute resources.
:param name: The name of the virtual machine to deallocate.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machine_deallocate testvm testgroup
'''
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
# pylint: disable=invalid-name
vm = compconn.virtual_machines.deallocate(
resource_group_name=resource_group,
vm_name=name
)
vm.wait()
vm_result = vm.result()
result = vm_result.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machine_generalize(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Set the state of a virtual machine to 'generalized'.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machine_generalize testvm testgroup
'''
result = False
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
compconn.virtual_machines.generalize(
resource_group_name=resource_group,
vm_name=name
)
result = True
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
return result
def virtual_machines_list(resource_group, **kwargs):
'''
.. versionadded:: Fluorine
List all virtual machines within a resource group.
:param resource_group: The resource group name to list virtual
machines within.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list testgroup
'''
result = {}
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
vms = __utils__['azurearm.paged_object_to_list'](
compconn.virtual_machines.list(
resource_group_name=resource_group
)
)
for vm in vms: # pylint: disable=invalid-name
result[vm['name']] = vm
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machines_list_all(**kwargs):
'''
.. versionadded:: Fluorine
List all virtual machines within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list_all
'''
result = {}
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
vms = __utils__['azurearm.paged_object_to_list'](
compconn.virtual_machines.list_all()
)
for vm in vms: # pylint: disable=invalid-name
result[vm['name']] = vm
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machines_list_available_sizes(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: Fluorine
Lists all available virtual machine sizes to which the specified virtual
machine can be resized.
:param name: The name of the virtual machine.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machines_list_available_sizes testvm testgroup
'''
result = {}
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
sizes = __utils__['azurearm.paged_object_to_list'](
compconn.virtual_machines.list_available_sizes(
resource_group_name=resource_group,
vm_name=name
)
)
for size in sizes:
result[size['name']] = size
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machine_power_off(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Power off (stop) a virtual machine.
:param name: The name of the virtual machine to stop.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machine_power_off testvm testgroup
'''
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
# pylint: disable=invalid-name
vm = compconn.virtual_machines.power_off(
resource_group_name=resource_group,
vm_name=name
)
vm.wait()
vm_result = vm.result()
result = vm_result.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machine_restart(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Restart a virtual machine.
:param name: The name of the virtual machine to restart.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machine_restart testvm testgroup
'''
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
# pylint: disable=invalid-name
vm = compconn.virtual_machines.restart(
resource_group_name=resource_group,
vm_name=name
)
vm.wait()
vm_result = vm.result()
result = vm_result.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machine_start(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Power on (start) a virtual machine.
:param name: The name of the virtual machine to start.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machine_start testvm testgroup
'''
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
# pylint: disable=invalid-name
vm = compconn.virtual_machines.start(
resource_group_name=resource_group,
vm_name=name
)
vm.wait()
vm_result = vm.result()
result = vm_result.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result
def virtual_machine_redeploy(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Redeploy a virtual machine.
:param name: The name of the virtual machine to redeploy.
:param resource_group: The resource group name assigned to the
virtual machine.
CLI Example:
.. code-block:: bash
salt-call azurearm_compute.virtual_machine_redeploy testvm testgroup
'''
compconn = __utils__['azurearm.get_client']('compute', **kwargs)
try:
# pylint: disable=invalid-name
vm = compconn.virtual_machines.redeploy(
resource_group_name=resource_group,
vm_name=name
)
vm.wait()
vm_result = vm.result()
result = vm_result.as_dict()
except CloudError as exc:
__utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
result = {'error': str(exc)}
return result

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
'''
Connection module for Amazon CloudFront
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:depends: boto3

View File

@ -1865,7 +1865,7 @@ def get_all_tags(filters=None, region=None, key=None, keyid=None, profile=None):
'''
Describe all tags matching the filter criteria, or all tags in the account otherwise.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
filters
(dict) - Additional constraints on which volumes to return. Note that valid filters vary

View File

@ -343,7 +343,7 @@ def create_healthcheck(ip_addr=None, fqdn=None, region=None, key=None, keyid=Non
'''
Create a Route53 healthcheck
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
ip_addr

View File

@ -2,7 +2,7 @@
'''
Connection module for Amazon S3 using boto3
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:configuration: This module accepts explicit AWS credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles or

View File

@ -432,7 +432,7 @@ def install(name,
execution_timeout (str):
Chocolatey execution timeout value you want to pass to the installation process. Default is None.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Returns:
str: The output of the ``chocolatey`` command

View File

@ -947,7 +947,7 @@ def run(cmd,
:param str prepend_path: $PATH segment to prepend (trailing ':' not
necessary) to $PATH
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str template: If this setting is applied then the named templating
engine will be used to render the downloaded file. Currently jinja,
@ -972,7 +972,7 @@ def run(cmd,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -995,7 +995,7 @@ def run(cmd,
This is separate from ``output_loglevel``, which only handles how
Salt logs to the minion log.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param int timeout: A timeout in seconds for the executed process to return.
@ -1192,7 +1192,7 @@ def shell(cmd,
:param str prepend_path: $PATH segment to prepend (trailing ':' not necessary)
to $PATH
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str template: If this setting is applied then the named templating
engine will be used to render the downloaded file. Currently jinja,
@ -1217,7 +1217,7 @@ def shell(cmd,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -1240,7 +1240,7 @@ def shell(cmd,
This is separate from ``output_loglevel``, which only handles how
Salt logs to the minion log.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param int timeout: A timeout in seconds for the executed process to
return.
@ -1404,7 +1404,7 @@ def run_stdout(cmd,
:param str prepend_path: $PATH segment to prepend (trailing ':' not necessary)
to $PATH
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str template: If this setting is applied then the named templating
engine will be used to render the downloaded file. Currently jinja,
@ -1429,7 +1429,7 @@ def run_stdout(cmd,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -1452,7 +1452,7 @@ def run_stdout(cmd,
This is separate from ``output_loglevel``, which only handles how
Salt logs to the minion log.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param int timeout: A timeout in seconds for the executed process to
return.
@ -1515,26 +1515,6 @@ def run_stdout(cmd,
success_retcodes=success_retcodes,
**kwargs)
log_callback = _check_cb(log_callback)
lvl = _check_loglevel(output_loglevel)
if lvl is not None:
if not ignore_retcode and ret['retcode'] != 0:
if lvl < LOG_LEVELS['error']:
lvl = LOG_LEVELS['error']
msg = (
'Command \'{0}\' failed with return code: {1}'.format(
cmd,
ret['retcode']
)
)
log.error(log_callback(msg))
if ret['stdout']:
log.log(lvl, 'stdout: %s', log_callback(ret['stdout']))
if ret['stderr']:
log.log(lvl, 'stderr: %s', log_callback(ret['stderr']))
if ret['retcode']:
log.log(lvl, 'retcode: %s', ret['retcode'])
return ret['stdout'] if not hide_output else ''
@ -1613,7 +1593,7 @@ def run_stderr(cmd,
:param str prepend_path: $PATH segment to prepend (trailing ':' not
necessary) to $PATH
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str template: If this setting is applied then the named templating
engine will be used to render the downloaded file. Currently jinja,
@ -1638,7 +1618,7 @@ def run_stderr(cmd,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -1661,7 +1641,7 @@ def run_stderr(cmd,
This is separate from ``output_loglevel``, which only handles how
Salt logs to the minion log.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param int timeout: A timeout in seconds for the executed process to
return.
@ -1724,26 +1704,6 @@ def run_stderr(cmd,
success_retcodes=success_retcodes,
**kwargs)
log_callback = _check_cb(log_callback)
lvl = _check_loglevel(output_loglevel)
if lvl is not None:
if not ignore_retcode and ret['retcode'] != 0:
if lvl < LOG_LEVELS['error']:
lvl = LOG_LEVELS['error']
msg = (
'Command \'{0}\' failed with return code: {1}'.format(
cmd,
ret['retcode']
)
)
log.error(log_callback(msg))
if ret['stdout']:
log.log(lvl, 'stdout: %s', log_callback(ret['stdout']))
if ret['stderr']:
log.log(lvl, 'stderr: %s', log_callback(ret['stderr']))
if ret['retcode']:
log.log(lvl, 'retcode: %s', ret['retcode'])
return ret['stderr'] if not hide_output else ''
@ -1824,7 +1784,7 @@ def run_all(cmd,
:param str prepend_path: $PATH segment to prepend (trailing ':' not
necessary) to $PATH
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str template: If this setting is applied then the named templating
engine will be used to render the downloaded file. Currently jinja,
@ -1849,7 +1809,7 @@ def run_all(cmd,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -1872,7 +1832,7 @@ def run_all(cmd,
This is separate from ``output_loglevel``, which only handles how
Salt logs to the minion log.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param int timeout: A timeout in seconds for the executed process to
return.
@ -1883,7 +1843,7 @@ def run_all(cmd,
:param bool encoded_cmd: Specify if the supplied command is encoded.
Only applies to shell 'powershell'.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param bool redirect_stderr: If set to ``True``, then stderr will be
redirected to stdout. This is helpful for cases where obtaining both
@ -1960,27 +1920,6 @@ def run_all(cmd,
success_retcodes=success_retcodes,
**kwargs)
log_callback = _check_cb(log_callback)
lvl = _check_loglevel(output_loglevel)
if lvl is not None:
if not ignore_retcode and ret['retcode'] != 0:
if lvl < LOG_LEVELS['error']:
lvl = LOG_LEVELS['error']
msg = (
'Command \'{0}\' failed with return code: {1}'.format(
cmd,
ret['retcode']
)
)
log.error(log_callback(msg))
if ret['stdout']:
log.log(lvl, 'stdout: %s', log_callback(ret['stdout']))
if ret['stderr']:
log.log(lvl, 'stderr: %s', log_callback(ret['stderr']))
if ret['retcode']:
log.log(lvl, 'retcode: %s', ret['retcode'])
if hide_output:
ret['stdout'] = ret['stderr'] = ''
return ret
@ -2078,7 +2017,7 @@ def retcode(cmd,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -2154,22 +2093,6 @@ def retcode(cmd,
password=password,
success_retcodes=success_retcodes,
**kwargs)
log_callback = _check_cb(log_callback)
lvl = _check_loglevel(output_loglevel)
if lvl is not None:
if not ignore_retcode and ret['retcode'] != 0:
if lvl < LOG_LEVELS['error']:
lvl = LOG_LEVELS['error']
msg = (
'Command \'{0}\' failed with return code: {1}'.format(
cmd,
ret['retcode']
)
)
log.error(log_callback(msg))
log.log(lvl, 'output: %s', log_callback(ret['stdout']))
return ret['retcode']
@ -2326,7 +2249,7 @@ def script(source,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -2349,7 +2272,7 @@ def script(source,
This is separate from ``output_loglevel``, which only handles how
Salt logs to the minion log.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param int timeout: If the command has not terminated after timeout
seconds, send the subprocess sigterm, and if sigterm is ignored, follow
@ -2569,7 +2492,7 @@ def script_retcode(source,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -2875,7 +2798,7 @@ def run_chroot(root,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -2898,7 +2821,7 @@ def run_chroot(root,
This is separate from ``output_loglevel``, which only handles how
Salt logs to the minion log.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param int timeout:
A timeout in seconds for the executed process to return.
@ -3345,7 +3268,7 @@ def powershell(cmd,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -3368,7 +3291,7 @@ def powershell(cmd,
This is separate from ``output_loglevel``, which only handles how
Salt logs to the minion log.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param int timeout: A timeout in seconds for the executed process to return.
@ -3558,7 +3481,7 @@ def powershell_all(cmd,
salt '*' cmd.run_all '$PSVersionTable.CLRVersion' shell=powershell
salt '*' cmd.run_all 'Get-NetTCPConnection' shell=powershell
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
.. warning::
@ -3638,7 +3561,7 @@ def powershell_all(cmd,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -3860,7 +3783,7 @@ def run_bg(cmd,
the `locale` line in the output of :py:func:`test.versions_report
<salt.modules.test.versions_report>`.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str output_loglevel: Control the loglevel at which the output from
the command is logged to the minion log.
@ -3910,7 +3833,7 @@ def run_bg(cmd,
:param str prepend_path: $PATH segment to prepend (trailing ':' not
necessary) to $PATH
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:param str template: If this setting is applied then the named templating
engine will be used to render the downloaded file. Currently jinja,

View File

@ -240,7 +240,7 @@ def get_file(path,
gzip=None,
**kwargs):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
``dest`` can now be a directory
Used to get a single file from the salt master
@ -354,7 +354,7 @@ def get_dir(path, dest, saltenv='base', template=None, gzip=None, **kwargs):
def get_url(path, dest='', saltenv='base', makedirs=False, source_hash=None):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
``dest`` can now be a directory
Used to get a single file from a URL.
@ -391,7 +391,7 @@ def get_url(path, dest='', saltenv='base', makedirs=False, source_hash=None):
minion's file cache, this option can be passed to keep the minion from
re-downloading the file if the cached copy matches the specified hash.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
CLI Example:
@ -445,7 +445,7 @@ def cache_file(path, saltenv='base', source_hash=None):
minion's file cache, this option can be passed to keep the minion from
re-downloading the file if the cached copy matches the specified hash.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
CLI Example:

View File

@ -2,7 +2,7 @@
'''
Salt module to manage Unix cryptsetup jobs and the crypttab file
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
'''
# Import python libraries

View File

@ -12,6 +12,7 @@ import re
# Import salt libs
import salt.utils.path
import salt.utils.files
import salt.utils.stringutils
import salt.utils.versions
log = logging.getLogger(__name__)
@ -128,7 +129,7 @@ def set_(package, question, type, value, *extra):
fd_, fname = salt.utils.files.mkstemp(prefix="salt-", close_fd=False)
line = "{0} {1} {2} {3}".format(package, question, type, value)
os.write(fd_, line)
os.write(fd_, salt.utils.stringutils.to_bytes(line))
os.close(fd_)
_set_file(fname)

View File

@ -229,7 +229,7 @@ def status(name, sig=None):
If the name contains globbing, a dict mapping service name to True/False
values is returned.
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
The service name can now be a glob (e.g. ``salt*``)
Args:

View File

@ -789,7 +789,7 @@ def get_client_args(limit=None):
.. versionchanged:: 2017.7.0
Replaced the container config args with the ones from the API's
``create_container`` function.
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Added ability to limit the input to specific client functions
Many functions in Salt have been written to support the full list of
@ -884,7 +884,7 @@ def _get_create_kwargs(skip_translate=None,
def compare_containers(first, second, ignore=None):
'''
.. versionadded:: 2017.7.0
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Renamed from ``docker.compare_container`` to
``docker.compare_containers`` (old function name remains as an alias)
@ -967,7 +967,7 @@ compare_container = salt.utils.functools.alias_function(
def compare_container_networks(first, second):
'''
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Returns the differences between two containers' networks. When a network is
only present one of the two containers, that network's diff will simply be
@ -1204,7 +1204,7 @@ def compare_container_networks(first, second):
def compare_networks(first, second, ignore='Name,Id,Created,Containers'):
'''
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Compare two networks and return any differences between the two
@ -1277,7 +1277,7 @@ def compare_networks(first, second, ignore='Name,Id,Created,Containers'):
def connected(name, verbose=False):
'''
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Return a list of running containers attached to the specified network
@ -1866,7 +1866,7 @@ def list_tags():
def resolve_image_id(name):
'''
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Given an image name (or partial image ID), return the full image ID. If no
match is found among the locally-pulled images, then ``False`` will be
@ -1897,7 +1897,7 @@ def resolve_image_id(name):
def resolve_tag(name, tags=None, **kwargs):
'''
.. versionadded:: 2017.7.2
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Instead of matching against pulled tags using
:py:func:`docker.list_tags <salt.modules.dockermod.list_tags>`, this
function now simply inspects the passed image name using
@ -1920,10 +1920,10 @@ def resolve_tag(name, tags=None, **kwargs):
is found but there are no tags, then a list will still be returned, but
it will simply contain the image ID.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
tags
.. deprecated:: Oxygen
.. deprecated:: 2018.3.0
Ignored if passed, will be removed in the Neon release.
CLI Examples:
@ -1972,7 +1972,7 @@ def resolve_tag(name, tags=None, **kwargs):
def logs(name, **kwargs):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Support for all of docker-py's `logs()`_ function's arguments, with the
exception of ``stream``.
@ -2393,7 +2393,7 @@ def create(image,
start : False
If ``True``, start container after creating it
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
skip_translate
This function translates Salt CLI or SLS input into the format which
@ -2764,7 +2764,7 @@ def create(image,
- ``labels=foo,bar=baz``
- ``labels="['foo', 'bar=baz']"``
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Labels both with and without values can now be mixed. Earlier
releases only permitted one method or the other.
@ -3158,7 +3158,7 @@ def run_container(image,
networks=None,
**kwargs):
'''
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Equivalent to ``docker run`` on the Docker CLI. Runs the container, waits
for it to exit, and returns the container's logs when complete.
@ -3762,7 +3762,7 @@ def rm_(name, force=False, volumes=False, **kwargs):
Optional timeout to be passed to :py:func:`docker.stop
<salt.modules.dockermod.stop>` if stopping the container.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
volumes : False
Also remove volumes associated with container
@ -3839,7 +3839,7 @@ def build(path=None,
buildargs=None,
image=None):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
If the built image should be tagged, then the repository and tag must
now be passed separately using the ``repository`` and ``tag``
arguments, rather than together in the (now deprecated) ``image``
@ -3853,15 +3853,15 @@ def build(path=None,
repository
Optional repository name for the image being built
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
tag : latest
Tag name for the image (required if ``repository`` is passed)
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
image
.. deprecated:: Oxygen
.. deprecated:: 2018.3.0
Use both ``repository`` and ``tag`` instead
cache : True
@ -4020,7 +4020,7 @@ def commit(name,
author=None,
image=None):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
The repository and tag must now be passed separately using the
``repository`` and ``tag`` arguments, rather than together in the (now
deprecated) ``image`` argument.
@ -4034,15 +4034,15 @@ def commit(name,
repository
Repository name for the image being committed
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
tag : latest
Tag name for the image
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
image
.. deprecated:: Oxygen
.. deprecated:: 2018.3.0
Use both ``repository`` and ``tag`` instead
message
@ -4168,7 +4168,7 @@ def import_(source,
api_response=False,
image=None):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
The repository and tag must now be passed separately using the
``repository`` and ``tag`` arguments, rather than together in the (now
deprecated) ``image`` argument.
@ -4185,15 +4185,15 @@ def import_(source,
repository
Repository name for the image being imported
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
tag : latest
Tag name for the image
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
image
.. deprecated:: Oxygen
.. deprecated:: 2018.3.0
Use both ``repository`` and ``tag`` instead
api_response : False
@ -4276,7 +4276,7 @@ def import_(source,
def load(path, repository=None, tag=None, image=None):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
If the loaded image should be tagged, then the repository and tag must
now be passed separately using the ``repository`` and ``tag``
arguments, rather than together in the (now deprecated) ``image``
@ -4298,16 +4298,16 @@ def load(path, repository=None, tag=None, image=None):
<salt.modules.dockermod.tag_>`. If a repository name is provided, then
the ``tag`` argument is also required.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
tag
Tag name to go along with the repository name, if the loaded image is
to be tagged.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
image
.. deprecated:: Oxygen
.. deprecated:: 2018.3.0
Use both ``repository`` and ``tag`` instead
@ -4433,7 +4433,7 @@ def pull(image,
api_response=False,
client_timeout=salt.utils.docker.CLIENT_TIMEOUT):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
If no tag is specified in the ``image`` argument, all tags for the
image will be pulled. For this reason is it recommended to pass
``image`` using the ``repo:tag`` notation.
@ -4900,7 +4900,7 @@ def save(name,
def tag_(name, repository, tag='latest', force=False, image=None):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
The repository and tag must now be passed separately using the
``repository`` and ``tag`` arguments, rather than together in the (now
deprecated) ``image`` argument.
@ -4914,15 +4914,15 @@ def tag_(name, repository, tag='latest', force=False, image=None):
repository
Repository name for the image to be built
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
tag : latest
Tag name for the image to be built
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
image
.. deprecated:: Oxygen
.. deprecated:: 2018.3.0
Use both ``repository`` and ``tag`` instead
force : False
@ -4964,7 +4964,7 @@ def networks(names=None, ids=None):
.. versionchanged:: 2017.7.0
The ``names`` and ``ids`` can be passed as a comma-separated list now,
as well as a Python list.
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
The ``Containers`` key for each network is no longer always empty.
List existing networks
@ -5008,7 +5008,7 @@ def create_network(name,
client_timeout=salt.utils.docker.CLIENT_TIMEOUT,
**kwargs):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Support added for network configuration options other than ``driver``
and ``driver_opts``, as well as IPAM configuration.
@ -5053,7 +5053,7 @@ def create_network(name,
- docker-py `low-level API`_
- `Docker Engine API`_
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
ignore_collisions : False
Since many of docker-py's arguments differ in name from their CLI
@ -5064,7 +5064,7 @@ def create_network(name,
will be raised. Set this argument to ``True`` to suppress these errors
and keep the docker-py version of the argument.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
validate_ip_addrs : True
For parameters which accept IP addresses as input, IP address
@ -5076,7 +5076,7 @@ def create_network(name,
portion will be validated, and the subnet size will be checked to
confirm it is a valid number (1-32 for IPv4, 1-128 for IPv6).
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
.. _salt-modules-dockermod-create-network-netconf:
@ -5312,7 +5312,7 @@ def connect_container_to_network(container, net_id, **kwargs):
.. versionadded:: 2015.8.3
.. versionchanged:: 2017.7.0
Support for ``ipv4_address`` argument added
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
All arguments are now passed through to
`connect_container_to_network()`_, allowing for any new arguments added
to this function to be supported automagically.
@ -5396,7 +5396,7 @@ def disconnect_container_from_network(container, network_id):
def disconnect_all_containers_from_network(network_id):
'''
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
Runs :py:func:`docker.disconnect_container_from_network
<salt.modules.dockermod.disconnect_container_from_network>` on all
@ -5860,6 +5860,106 @@ def wait(name, ignore_already_stopped=False, fail_on_exit_status=False):
return result
def prune(containers=False, networks=False, images=False,
build=False, volumes=False, system=None, **filters):
'''
.. versionadded:: Fluorine
Prune Docker's various subsystems
.. note::
This requires docker-py version 2.1.0 or later.
containers : False
If ``True``, prunes stopped containers (documentation__)
.. __: https://docs.docker.com/engine/reference/commandline/container_prune/#filtering
images : False
If ``True``, prunes unused images (documentation__)
.. __: https://docs.docker.com/engine/reference/commandline/image_prune/#filtering
networks : False
If ``False``, prunes unreferenced networks (documentation__)
.. __: https://docs.docker.com/engine/reference/commandline/network_prune/#filtering)
build : False
If ``True``, clears the builder cache
.. note::
Only supported in Docker 17.07.x and newer. Additionally, filters
do not apply to this argument.
volumes : False
If ``True``, prunes unreferenced volumes (documentation__)
.. __: https://docs.docker.com/engine/reference/commandline/volume_prune/
system
If ``True``, prunes containers, images, networks, and builder cache.
Assumed to be ``True`` if none of ``containers``, ``images``,
``networks``, or ``build`` are set to ``True``.
.. note::
``volumes=True`` must still be used to prune volumes
filters
- ``dangling=True`` (images only) - remove only dangling images
- ``until=<timestamp>`` - only remove objects created before given
timestamp. Not applicable to volumes. See the documentation links
above for examples of valid time expressions.
- ``label`` - only remove objects matching the label expression. Valid
expressions include ``labelname`` or ``labelname=value``.
CLI Examples:
.. code-block:: bash
salt myminion docker.prune system=True
salt myminion docker.prune system=True until=12h
salt myminion docker.prune images=True dangling=True
salt myminion docker.prune images=True label=foo,bar=baz
'''
if system is None and not any((containers, images, networks, build)):
system = True
filters = __utils__['args.clean_kwargs'](**filters)
for fname in list(filters):
if not isinstance(filters[fname], bool):
# support comma-separated values
filters[fname] = salt.utils.args.split_input(filters[fname])
ret = {}
if system or containers:
ret['containers'] = _client_wrapper('prune_containers', filters=filters)
if system or images:
ret['images'] = _client_wrapper('prune_images', filters=filters)
if system or networks:
ret['networks'] = _client_wrapper('prune_networks', filters=filters)
if system or build:
try:
# Doesn't exist currently in docker-py as of 3.0.1
ret['build'] = _client_wrapper('prune_build', filters=filters)
except SaltInvocationError:
# It's not in docker-py yet, POST directly to the API endpoint
ret['build'] = _client_wrapper(
'_result',
_client_wrapper(
'_post',
_client_wrapper('_url', '/build/prune')
),
True
)
if volumes:
ret['volumes'] = _client_wrapper('prune_volumes', filters=filters)
return ret
# Functions to run commands inside containers
@_refresh_mine_cache
def _run(name,
@ -6582,7 +6682,7 @@ def sls(name, mods=None, **kwargs):
:conf_minion:`pillarenv` minion config option nor this CLI argument is
used, all Pillar environments will be merged together.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
pillar
Custom Pillar values, passed as a dictionary of key-value pairs
@ -6591,7 +6691,7 @@ def sls(name, mods=None, **kwargs):
Values passed this way will override Pillar values set via
``pillar_roots`` or an external Pillar source.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
CLI Example:
@ -6678,7 +6778,7 @@ def sls_build(repository,
dryrun=False,
**kwargs):
'''
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
The repository and tag must now be passed separately using the
``repository`` and ``tag`` arguments, rather than together in the (now
deprecated) ``image`` argument.
@ -6692,15 +6792,15 @@ def sls_build(repository,
repository
Repository name for the image to be built
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
tag : latest
Tag name for the image to be built
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
name
.. deprecated:: Oxygen
.. deprecated:: 2018.3.0
Use both ``repository`` and ``tag`` instead
base : opensuse/python
@ -6721,7 +6821,7 @@ def sls_build(repository,
:conf_minion:`pillarenv` minion config option nor this CLI argument is
used, all Pillar environments will be merged together.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
pillar
Custom Pillar values, passed as a dictionary of key-value pairs
@ -6730,7 +6830,7 @@ def sls_build(repository,
Values passed this way will override Pillar values set via
``pillar_roots`` or an external Pillar source.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
dryrun: False
when set to True the container will not be commited at the end of

View File

@ -505,7 +505,7 @@ def chgrp(path, group):
def _cmp_attrs(path, attrs):
'''
.. versionadded: Oxygen
.. versionadded:: 2018.3.0
Compare attributes of a given file to given attributes.
Returns a pair (list) where first item are attributes to
@ -534,7 +534,7 @@ def _cmp_attrs(path, attrs):
def lsattr(path):
'''
.. versionadded: Oxygen
.. versionadded:: 2018.3.0
Obtain the modifiable attributes of the given file. If path
is to a directory, an empty list is returned.
@ -565,7 +565,7 @@ def lsattr(path):
def chattr(*args, **kwargs):
'''
.. versionadded: Oxygen
.. versionadded:: 2018.3.0
Change the attributes of files
@ -3974,7 +3974,7 @@ def get_managed(
attrs
Attributes of file
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
context
Variables to add to the template context
@ -4729,7 +4729,7 @@ def check_file_meta(
attrs
Destination file attributes
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
saltenv
Salt environment used to resolve source files
@ -4835,14 +4835,14 @@ def get_diff(file1,
file1
The first file to feed into the diff utility
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Can now be either a local or remote file. In earlier releases,
thuis had to be a file local to the minion.
file2
The second file to feed into the diff utility
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
Can now be either a local or remote file. In earlier releases, this
had to be a file on the salt fileserver (i.e.
``salt://somefile.txt``)
@ -4861,7 +4861,7 @@ def get_diff(file1,
except for within states, with the ``obfuscate_templates`` option set
to ``True``.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
source_hash_file1
If ``file1`` is an http(s)/ftp URL and the file exists in the minion's
@ -4869,7 +4869,7 @@ def get_diff(file1,
re-downloading the archive if the cached copy matches the specified
hash.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
source_hash_file2
If ``file2`` is an http(s)/ftp URL and the file exists in the minion's
@ -4877,7 +4877,7 @@ def get_diff(file1,
re-downloading the archive if the cached copy matches the specified
hash.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
CLI Examples:
@ -5015,7 +5015,7 @@ def manage_file(name,
attrs
attributes to be set on file: '' means remove all of them
.. versionadded: Oxygen
.. versionadded:: 2018.3.0
makedirs
make directories if they do not exist

View File

@ -484,7 +484,7 @@ def status(name, sig=None, jail=None):
.. versionchanged:: 2016.3.4
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
The service name can now be a glob (e.g. ``salt*``)
Args:

View File

@ -6,7 +6,7 @@ and the set of routes for a particular VM is called its routing table.
For each packet leaving a virtual machine, the system searches that machine's
routing table for a single best matching route.
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
This module will create a route to send traffic destined to the Internet
through your gateway instance.

View File

@ -242,7 +242,7 @@ def status(name, sig=None):
If the name contains globbing, a dict mapping service name to True/False
values is returned.
.. versionchanged:: Oxygen
.. versionchanged:: 2018.3.0
The service name can now be a glob (e.g. ``salt*``)
Args:

View File

@ -186,6 +186,28 @@ def _format_git_opts(opts):
return _format_opts(opts)
def _find_ssh_exe():
'''
Windows only: search for Git's bundled ssh.exe in known locations
'''
# Known locations for Git's ssh.exe in Windows
globmasks = [os.path.join(os.getenv('SystemDrive'), os.sep,
'Program Files*', 'Git', 'usr', 'bin',
'ssh.exe'),
os.path.join(os.getenv('SystemDrive'), os.sep,
'Program Files*', 'Git', 'bin',
'ssh.exe')]
for globmask in globmasks:
ssh_exe = glob.glob(globmask)
if ssh_exe and os.path.isfile(ssh_exe[0]):
ret = ssh_exe[0]
break
else:
ret = None
return ret
def _git_run(command, cwd=None, user=None, password=None, identity=None,
ignore_retcode=False, failhard=True, redirect_stderr=False,
saltenv='base', **kwargs):
@ -246,22 +268,12 @@ def _git_run(command, cwd=None, user=None, password=None, identity=None,
)
tmp_ssh_wrapper = None
if salt.utils.platform.is_windows():
# Known locations for Git's ssh.exe in Windows
globmasks = [os.path.join(os.getenv('SystemDrive'), os.sep,
'Program Files*', 'Git', 'usr', 'bin',
'ssh.exe'),
os.path.join(os.getenv('SystemDrive'), os.sep,
'Program Files*', 'Git', 'bin',
'ssh.exe')]
for globmask in globmasks:
ssh_exe = glob.glob(globmask)
if ssh_exe and os.path.isfile(ssh_exe[0]):
env['GIT_SSH_EXE'] = ssh_exe[0]
break
else:
ssh_exe = _find_ssh_exe()
if ssh_exe is None:
raise CommandExecutionError(
'Failed to find ssh.exe, unable to use identity file'
)
env['GIT_SSH_EXE'] = ssh_exe
# Use the windows batch file instead of the bourne shell script
ssh_id_wrapper += '.bat'
env['GIT_SSH'] = ssh_id_wrapper
@ -275,7 +287,7 @@ def _git_run(command, cwd=None, user=None, password=None, identity=None,
env['GIT_SSH'] = tmp_ssh_wrapper
if 'salt-call' not in _salt_cli \
and __salt__['ssh.key_is_encrypted'](id_file):
and __utils__['ssh.key_is_encrypted'](id_file):
errors.append(
'Identity file {0} is passphrase-protected and cannot be '
'used in a non-interactive command. Using salt-call from '
@ -302,25 +314,33 @@ def _git_run(command, cwd=None, user=None, password=None, identity=None,
redirect_stderr=redirect_stderr,
**kwargs)
finally:
# Cleanup the temporary ssh wrapper file
try:
__salt__['file.remove'](tmp_ssh_wrapper)
log.debug('Removed ssh wrapper file %s', tmp_ssh_wrapper)
except AttributeError:
# No wrapper was used
pass
except (SaltInvocationError, CommandExecutionError) as exc:
log.warning('Failed to remove ssh wrapper file %s: %s', tmp_ssh_wrapper, exc)
if tmp_ssh_wrapper:
# Cleanup the temporary ssh wrapper file
try:
__salt__['file.remove'](tmp_ssh_wrapper)
log.debug('Removed ssh wrapper file %s', tmp_ssh_wrapper)
except AttributeError:
# No wrapper was used
pass
except (SaltInvocationError, CommandExecutionError) as exc:
log.warning(
'Failed to remove ssh wrapper file %s: %s',
tmp_ssh_wrapper, exc
)
# Cleanup the temporary identity file
try:
__salt__['file.remove'](tmp_identity_file)
log.debug('Removed identity file %s', tmp_identity_file)
except AttributeError:
# No identify file was used
pass
except (SaltInvocationError, CommandExecutionError) as exc:
log.warning('Failed to remove identity file %s: %s', tmp_identity_file, exc)
if tmp_identity_file:
# Cleanup the temporary identity file
try:
__salt__['file.remove'](tmp_identity_file)
log.debug('Removed identity file %s', tmp_identity_file)
except AttributeError:
# No identify file was used
pass
except (SaltInvocationError, CommandExecutionError) as exc:
log.warning(
'Failed to remove identity file %s: %s',
tmp_identity_file, exc
)
# If the command was successful, no need to try additional IDs
if result['retcode'] == 0:

View File

@ -2,7 +2,7 @@
'''
Glance module for interacting with OpenStack Glance
.. versionadded:: Oxygen
.. versionadded:: 2018.3.0
:depends:shade

Some files were not shown because too many files have changed in this diff Show More