Skip to content

Commit ca74c1d

Browse files
authored
Merge branch 'master' into schedule_modify_no_function_fix
2 parents 1927601 + caec765 commit ca74c1d

File tree

117 files changed

+6533
-395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+6533
-395
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Versions are `MAJOR.PATCH`.
2626

2727
### Changed
2828

29+
- [#54013](https://github.com/saltstack/salt/pull/54103) - Set `session_id`
30+
cookie in the rest_tornado backend.
2931
- [SEP 14](https://github.com/saltstack/salt-enhancement-proposals/pull/20) - Changed to numeric versions.
3032
- [SEP 1](https://github.com/saltstack/salt-enhancement-proposals/blob/master/accepted/0001-changelog-format.md), [SEP 14](https://github.com/saltstack/salt-enhancement-proposals/pull/20) - Adopted keepachangelog format.
3133

doc/man/salt.7

-5
Original file line numberDiff line numberDiff line change
@@ -387835,7 +387835,6 @@ A more involved example involves pulling from a custom repository.
387835387835
.ft C
387836387836
base:
387837387837
pkgrepo.managed:
387838-
\- humanname: Logstash PPA
387839387838
\- name: ppa:wolfnet/logstash
387840387839
\- dist: precise
387841387840
\- file: /etc/apt/sources.list.d/logstash.list
@@ -387859,7 +387858,6 @@ state module
387859387858
.ft C
387860387859
dotdeb.repo:
387861387860
pkgrepo.managed:
387862-
\- humanname: Dotdeb
387863387861
\- name: deb http://packages.dotdeb.org wheezy\-php55 all
387864387862
\- dist: wheezy\-php55
387865387863
\- file: /etc/apt/sources.list.d/dotbeb.list
@@ -389734,7 +389732,6 @@ base:
389734389732
.ft C
389735389733
base:
389736389734
pkgrepo.managed:
389737-
\- humanname: Logstash PPA
389738389735
\- name: deb http://ppa.launchpad.net/wolfnet/logstash/ubuntu precise main
389739389736
\- dist: precise
389740389737
\- file: /etc/apt/sources.list.d/logstash.list
@@ -389757,7 +389754,6 @@ base:
389757389754
.ft C
389758389755
base:
389759389756
pkgrepo.managed:
389760-
\- humanname: deb\-multimedia
389761389757
\- name: deb http://www.deb\-multimedia.org stable main
389762389758
\- file: /etc/apt/sources.list.d/deb\-multimedia.list
389763389759
\- key_url: salt://deb\-multimedia/files/marillat.pub
@@ -389772,7 +389768,6 @@ base:
389772389768
.ft C
389773389769
base:
389774389770
pkgrepo.managed:
389775-
\- humanname: Google Chrome
389776389771
\- name: deb http://dl.google.com/linux/chrome/deb/ stable main
389777389772
\- dist: stable
389778389773
\- file: /etc/apt/sources.list.d/chrome\-browser.list

doc/ref/modules/all/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ execution modules
4848
bigip
4949
bluez_bluetooth
5050
boto3_elasticache
51+
boto3_elasticsearch
5152
boto3_route53
5253
boto_apigateway
5354
boto_asg
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
salt.modules.boto3_elasticsearch module
2+
=======================================
3+
4+
.. automodule:: salt.modules.boto3_elasticsearch
5+
:members:

doc/ref/states/all/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ state modules
3131
bigip
3232
blockdev
3333
boto3_elasticache
34+
boto3_elasticsearch
3435
boto3_route53
3536
boto_apigateway
3637
boto_asg
@@ -244,6 +245,7 @@ state modules
244245
rabbitmq_cluster
245246
rabbitmq_plugin
246247
rabbitmq_policy
248+
rabbitmq_upstream
247249
rabbitmq_user
248250
rabbitmq_vhost
249251
rbac_solaris
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
salt.states.boto3_elasticsearch module
2+
======================================
3+
4+
.. automodule:: salt.states.boto3_elasticsearch
5+
:members:
6+
:undoc-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
=============================
2+
salt.states.rabbitmq_upstream
3+
=============================
4+
5+
.. automodule:: salt.states.rabbitmq_upstream
6+
:members:

doc/topics/cloud/cloudstack.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Using Salt for CloudStack, requires an ``API key`` and a ``secret key`` along wi
2222
2323
exoscale:
2424
driver: cloudstack
25-
host: api.exoscale.ch
25+
host: api.exoscale.com
2626
path: /compute
2727
apikey: EXOAPIKEY
2828
secretkey: EXOSECRETKEYINYOURACCOUNT
@@ -48,9 +48,10 @@ Set up an initial profile at ``/etc/salt/cloud.profiles`` or in the
4848
4949
exoscale-ubuntu:
5050
provider: exoscale-config
51-
image: Ubuntu 16.04
51+
image: Linux Ubuntu 18.04
5252
size: Small
5353
location: ch-gva-2
54+
ssh_username: ubuntu
5455
5556
Locations can be obtained using the ``--list-locations`` option for the ``salt-cloud``
5657
command:

doc/topics/cloud/saltify.rst

+48
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ example of how to use the Saltify driver with a map file follows:
168168
ssh_username: root
169169
password: another-bad-pass
170170
171+
In this example, the names ``my-instance-0`` and ``my-instance-1`` will be the
172+
identifiers of the deployed minions.
173+
174+
Note: The ``ssh_host`` directive is also used for Windows hosts, even though they do
175+
not typically run the SSH service. It indicates IP address or host name for the target
176+
system.
177+
171178
Note: When using a cloud map with the Saltify driver, the name of the profile
172179
to use, in this case ``make_salty``, must be defined in a profile config. For
173180
example:
@@ -197,6 +204,47 @@ Connectivity to the new "Salted" instances can now be verified with Salt:
197204
198205
salt 'my-instance-*' test.version
199206
207+
Bulk Deployments
208+
----------------
209+
210+
When deploying large numbers of Salt Minions using Saltify, it may be
211+
preferable to organize the configuration in a way that duplicates data
212+
as little as possible. For example, if a group of target systems have
213+
the same credentials, they can be specified in the profile, rather than
214+
in a map file.
215+
216+
.. code-block:: yaml
217+
218+
# /etc/salt/cloud.profiles.d/saltify.conf
219+
220+
make_salty:
221+
provider: my-saltify-config
222+
ssh_username: root
223+
password: very-bad-password
224+
225+
.. code-block:: yaml
226+
227+
# /etc/salt/saltify-map
228+
229+
make_salty:
230+
- my-instance-0:
231+
ssh_host: 12.34.56.78
232+
- my-instance-1:
233+
ssh_host: 44.33.22.11
234+
235+
If ``ssh_host`` is not provided, its default value will be the Minion identifier
236+
(``my-instance-0`` and ``my-instance-1``, in the example above). For deployments with
237+
working DNS resolution, this can save a lot of redundant data in the map. Here is an
238+
example map file using DNS names instead of IP addresses:
239+
240+
.. code-block:: yaml
241+
242+
# /etc/salt/saltify-map
243+
244+
make_salty:
245+
- my-instance-0
246+
- my-instance-1
247+
200248
Credential Verification
201249
=======================
202250

doc/topics/execution/remote_execution.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ Arguments are formatted as YAML:
8181

8282
.. code-block:: bash
8383
84-
salt '*' cmd.run 'echo "Hello: $FIRST_NAME"' saltenv='{FIRST_NAME: "Joe"}'
84+
salt '*' cmd.run 'echo "Hello: $FIRST_NAME"' env='{FIRST_NAME: "Joe"}'
8585
86-
Note: dictionaries must have curly braces around them (like the ``saltenv``
86+
Note: dictionaries must have curly braces around them (like the ``env``
8787
keyword argument above). This was changed in 0.15.1: in the above example,
8888
the first argument used to be parsed as the dictionary
8989
``{'echo "Hello': '$FIRST_NAME"'}``. This was generally not the expected
@@ -94,7 +94,7 @@ If you want to test what parameters are actually passed to a module, use the
9494

9595
.. code-block:: bash
9696
97-
salt '*' test.arg_repr 'echo "Hello: $FIRST_NAME"' saltenv='{FIRST_NAME: "Joe"}'
97+
salt '*' test.arg_repr 'echo "Hello: $FIRST_NAME"' env='{FIRST_NAME: "Joe"}'
9898
9999
Finding available minion functions
100100
``````````````````````````````````

doc/topics/jinja/index.rst

+44-1
Original file line numberDiff line numberDiff line change
@@ -1343,9 +1343,52 @@ Returns:
13431343
13441344
'default'
13451345
1346+
1347+
.. jinja_ref:: json_query
1348+
1349+
``json_query``
1350+
--------------
1351+
1352+
.. versionadded:: Neon
1353+
1354+
A port of Ansible ``json_query`` Jinja filter to make queries against JSON data using `JMESPath language`_.
1355+
Could be used to filter ``pillar`` data, ``yaml`` maps, and together with :jinja_ref:`http_query`.
1356+
Depends on the `jmespath`_ Python module.
1357+
1358+
Examples:
1359+
1360+
.. code-block:: jinja
1361+
1362+
Example 1: {{ [1, 2, 3, 4, [5, 6]] | json_query('[]') }}
1363+
1364+
Example 2: {{
1365+
{"machines": [
1366+
{"name": "a", "state": "running"},
1367+
{"name": "b", "state": "stopped"},
1368+
{"name": "c", "state": "running"}
1369+
]} | json_query("machines[?state=='running'].name") }}
1370+
1371+
Example 3: {{
1372+
{"services": [
1373+
{"name": "http", "host": "1.2.3.4", "port": 80},
1374+
{"name": "smtp", "host": "1.2.3.5", "port": 25},
1375+
{"name": "ssh", "host": "1.2.3.6", "port": 22},
1376+
]} | json_query("services[].port") }}
1377+
1378+
Returns:
1379+
1380+
.. code-block:: text
1381+
1382+
Example 1: [1, 2, 3, 4, 5, 6]
1383+
1384+
Example 2: ['a', 'c']
1385+
1386+
Example 3: [80, 25, 22]
1387+
13461388
.. _`builtin filters`: http://jinja.pocoo.org/docs/templates/#builtin-filters
13471389
.. _`timelib`: https://github.com/pediapress/timelib/
1348-
1390+
.. _`JMESPath language`: http://jmespath.org/
1391+
.. _`jmespath`: https://github.com/jmespath/jmespath.py
13491392

13501393
.. jinja_ref:: to_snake_case
13511394

doc/topics/releases/neon.rst

+41-1
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ as well as managing keystore files.
8282
-----END CERTIFICATE-----
8383
8484
85+
Jinja enhancements
86+
==================
87+
8588
Troubleshooting Jinja map files
86-
===============================
89+
-------------------------------
8790

8891
A new :py:func:`execution module <salt.modules.jinja>` for ``map.jinja`` troubleshooting
8992
has been added.
@@ -109,6 +112,18 @@ The module can be also used to test ``json`` and ``yaml`` maps:
109112
salt myminion jinja.import_json myformula/defaults.json
110113
111114
115+
json_query filter
116+
-----------------
117+
118+
A port of Ansible :jinja_ref:`json_query` Jinja filter has been added. It allows
119+
making queries against JSON data using `JMESPath language`_. Could be used to
120+
filter ``pillar`` data, ``yaml`` maps, and also useful with :jinja_ref:`http_query`.
121+
122+
Depends on the `jmespath`_ Python module.
123+
124+
.. _`JMESPath language`: http://jmespath.org/
125+
.. _`jmespath`: https://github.com/jmespath/jmespath.py
126+
112127
Slot Syntax Updates
113128
===================
114129

@@ -135,13 +150,38 @@ The slot syntax has been updated to support parsing dictionary responses and to
135150
Duration: 1.229 ms
136151
Changes:
137152
153+
Also, slot parsing is now supported inside of nested state data structures (dicts, lists, unless/onlyif args):
154+
155+
.. code-block:: yaml
156+
157+
demo slot parsing for nested elements:
158+
file.managed:
159+
- name: /tmp/slot.txt
160+
- source: salt://slot.j2
161+
- template: jinja
162+
- context:
163+
# Slot inside of the nested context dictionary
164+
variable: __slot__:salt:test.echo(a_value)
165+
- unless:
166+
- fun: file.search
167+
args:
168+
# Slot as unless argument
169+
- __slot__:salt:test.echo(/tmp/slot.txt)
170+
- "DO NOT OVERRIDE"
171+
ignore_if_missing: True
172+
138173
139174
State Changes
140175
=============
141176

142177
- Added new :py:func:`ssh_auth.manage <salt.states.ssh_auth.manage>` state to
143178
ensure only the specified ssh keys are present for the specified user.
144179

180+
Module Changes
181+
==============
182+
183+
- Added new :py:func:`boto_ssm <salt.modules.boto_ssm>` module to set and query
184+
secrets in AWS SSM parameters.
145185

146186
Deprecations
147187
============

noxfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def _install_requirements(session, transport, *extra_requirements):
349349

350350

351351
def _run_with_coverage(session, *test_cmd):
352-
session.install('--progress-bar=off', 'coverage==4.5.3', silent=PIP_INSTALL_SILENT)
352+
session.install('--progress-bar=off', 'coverage==5.0.1', silent=PIP_INSTALL_SILENT)
353353
session.run('coverage', 'erase')
354354
python_path_env_var = os.environ.get('PYTHONPATH') or None
355355
if python_path_env_var is None:

pkg/windows/modules/start-process-and-test-exitcode.psm1

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Function Start_Process_and_test_exitcode {
1515
Begin { Write-Host "Executing Command: $fun $args" }
1616

1717
Process {
18-
$p = Start-Process "$fun" -ArgumentList "$args" -Wait -NoNewWindow -PassThru
19-
If ( $($p.ExitCode) -ne 0) {
20-
Write-Error "$descr returned exitcode $($p.ExitCode). "
21-
exit $($p.ExitCode)
18+
$p = Start-Process "$fun" -ArgumentList "$args" -Wait -PassThru
19+
If ($p.ExitCode -ne 0) {
20+
Write-Error "$descr returned exitcode $p.ExitCode."
21+
exit $p.ExitCode
2222
}
2323
}
2424

requirements/pytest.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PyTest
22
pytest >=4.6.6,<4.7 # PyTest 4.6.x are the last Py2 and Py3 releases
3-
pytest-salt >= 2019.12.18
3+
pytest-salt >= 2019.12.27
44
pytest-tempdir >= 2019.10.12
55
pytest-helpers-namespace >= 2019.1.8
66
pytest-salt-runtests-bridge >= 2019.7.10

requirements/static/darwin.in

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ croniter>=0.3.0,!=0.3.22
66
dnspython
77
docker
88
futures>=2.0; python_version < '3.0'
9+
jmespath
910
jsonschema
1011
junos-eznc
1112
jxmlease

requirements/static/linux.in

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ docker
1010
futures>=2.0; python_version < '3.0'
1111
GitPython
1212
hgtools
13+
jmespath
1314
jsonschema
1415
junos-eznc
1516
jxmlease

requirements/static/py2.7/darwin.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ importlib-metadata==0.23 # via pluggy, pytest
5353
ipaddress==1.0.22
5454
jaraco.functools==2.0 # via tempora
5555
jinja2==2.10.1
56-
jmespath==0.9.4 # via boto3, botocore
56+
jmespath==0.9.4
5757
jsondiff==1.1.1 # via moto
5858
jsonpickle==1.1 # via aws-xray-sdk
5959
jsonschema==2.6.0
@@ -92,7 +92,7 @@ pyparsing==2.4.5 # via packaging
9292
pyserial==3.4 # via junos-eznc
9393
pytest-helpers-namespace==2019.1.8
9494
pytest-salt-runtests-bridge==2019.7.10
95-
pytest-salt==2019.12.18
95+
pytest-salt==2019.12.27
9696
pytest-tempdir==2019.10.12
9797
pytest==4.6.6
9898
python-dateutil==2.8.0

0 commit comments

Comments
 (0)