Compare commits

...

955 commits

Author SHA1 Message Date
Sandra McCann
5daf37d89e add eol banner 2019-08-08 13:00:32 -07:00
Sandra McCann
a31f72d69d add eol banner (#59254)
(cherry picked from commit 00699735e9)
2019-08-08 13:00:32 -07:00
Dag Wieers
b8af7335ac Add canonical link support to 2.4 theme (#53801)
* Add canonical link support to 2.4 theme
* fix so 2.4 docs build
2019-03-15 12:05:18 -07:00
Matt Clay
38522e374b Flush output from timing script.
(cherry picked from commit 771768966f)
2018-09-05 16:20:35 -07:00
Matt Clay
2b7edb9eb2 Get packages for dnf and yum tests from S3.
(cherry picked from commit 22d5f5d97f)
2018-09-05 15:32:48 -07:00
Jesse Pretorius
1e6ca60314 openstack: Document the python-novaclient requirement (#40842)
Without also installing the python-novaclient library, these modules
simply do not work.

Rather than backporting the fixes implemented in 2.6+ we simply make
sure that we document the requirement.

Fixes: #35484
2018-09-05 10:13:36 -05:00
Toshio Kuratomi
737d8a0abb
2.4.7 has not yet been released. 2018-09-05 07:06:24 -07:00
Matt Clay
302a36db99 Remove obsolete test/utils/docker/ directory.
(cherry picked from commit 78bd020429)
2018-08-30 09:12:31 -07:00
Matt Clay
3a5b1a1517 List quay.io images during Shippable run.
(cherry picked from commit a96a51b0c6)
2018-08-30 09:12:31 -07:00
Matt Clay
b1aef381f8 Switch distro test containers to quay.io images.
(cherry picked from commit 773c0982b0)
2018-08-30 09:12:31 -07:00
Matt Clay
ebcba98b38 Fix change detection on retried Shippable jobs.
(cherry picked from commit c0aaf0fff7)
2018-08-30 09:12:31 -07:00
Matt Clay
4c1d64cc94 Ignore CentOS 6.10 for passwordstore test.
(cherry picked from commit 18da873531)
2018-08-30 09:12:31 -07:00
Matt Clay
044399527e Restore repos after zypper_repository test runs.
This also allows the test to run on newer containers by not
manipulating any of the pre-configured repositories.

(cherry picked from commit cac51e6da8)
2018-08-30 09:12:31 -07:00
Jesse Pretorius
ccc963a51f Correct the OpenStack plugin example config
The current example configuration is not
quite right, so this patch implements a
fix which corrects it

The 'inventory_hostname' argument is removed
as it's the same value as the default.

(cherry picked from commit 12218f33a5c429676da8f3db0f91553c63a0314f)
2018-08-27 21:47:18 -07:00
Toshio Kuratomi
b7e31ddb63 [stable-2.4] Fix another corner case of too many warnings for world readable current working directory
There should be no warning if there is no ansible.cfg file i nthe
current working directory.
(cherry picked from commit f46c943)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2018-08-23 23:28:41 -07:00
Matt Clay
a3bc0ac6cf Use runtime instead of datetime for test output.
(cherry picked from commit 31a5b874a1)
2018-08-23 14:17:26 -07:00
Matt Clay
a045535ecf Fix path handling in hacking/env-setup.
(cherry picked from commit 0392dbeba1)
2018-08-23 11:18:37 -07:00
Toshio Kuratomi
cdfdced5d8 [stable-2.4] Only print warning when ansible.cfg is actually skipped (#43583)
Only print warning when ansible.cfg is actually skipped

* Also add unittests for the find_ini_config_file function
* Add documentation on world writable current working directory
  config files can no longer be loaded from a world writable current
  working directory but the end user is allowed to specify that
  explicitly.  Give appropriate warnings and information on how.

Fixes #42388.
(cherry picked from commit 30662bedad)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2018-08-03 10:51:51 -07:00
Matt Clay
9d08bc8242 Disable uri tests on RHEL, FreeBSD and OSX.
The httpbin.org test endpoint is too unstable for the tests to pass reliably.
2018-07-16 09:30:26 -07:00
Matt Clay
dbf28d7f8f Disable get_url tests on RHEL, FreeBSD and OSX.
The httpbin.org test endpoint is too unstable for the tests to pass reliably.
2018-07-10 16:36:50 -07:00
Matt Clay
96b53bd40a Remove unwanted containers at CI job start.
(cherry picked from commit 528de5b82f)
2018-07-09 21:50:56 -07:00
Toshio Kuratomi
1fde4e49df New release v2.4.6.0-1 2018-07-05 11:18:41 -07:00
Toshio Kuratomi
d21eadccdd Update version information 2018-07-05 11:13:46 -07:00
Toshio Kuratomi
715ed8d283 Fix changelog 2018-07-03 14:47:30 -07:00
Brian Coca
f32c42c37a [stable-2.4] ignore ansible.cfg in world writable cwd (#42070)
* ignore ansible.cfg in world writable cwd
 * also added 'warnings' to config
 * updated man page template.
(cherry picked from commit b6f2aad600)

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2018-07-03 09:38:28 -07:00
Toshio Kuratomi
84e7772523 Fix changelog to match the PR which was merged 2018-07-03 08:37:16 -07:00
Brian Coca
44874addc7 [stable-2.4] avoid loading vars on unspecified basedir (cwd) (#42067)
* avoid loading vars on unspecified basedir (cwd)
(cherry picked from commit de0e11c)

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2018-07-02 10:38:59 -07:00
Toshio Kuratomi
2a18883cb2 New release v2.4.5.0-1 2018-06-21 15:29:42 -07:00
Toshio Kuratomi
c1f7f5a324 Update changelog for release date of 2.4.5 2018-06-21 15:09:26 -07:00
Toshio Kuratomi
c8b1b271c6 Bump versions on release_and_maintenance doc 2018-06-21 14:57:33 -07:00
Toshio Kuratomi
1cf3abe811 Bump version number for playbook 2018-06-21 14:57:21 -07:00
Matt Clay
90580f96e9 Temporarily disable gem test on osx.
Disabled due to lack of newer TLS version support on the test system.

(cherry picked from commit dce708e63e)
2018-06-19 17:02:50 -07:00
Toshio Kuratomi
05fd86c82f New release v2.4.5.0-0.1.rc1 2018-06-13 11:35:50 -07:00
Toshio Kuratomi
1329d814d6 Add release info to the stable-2.4 vars file
The release playbook is no longer being run from the devel branch
because the release playbook is only for the 2.4 branch now.  Sync
information to the 2.4 branch that is needed to make that release there.
2018-06-13 09:01:44 -07:00
Toshio Kuratomi
9a2ef71d2d Tasks that are expected to fail need to begin with a special string
https://github.com/ansible/ansible/pull/41462

Commit: a5fd86c
2018-06-12 16:51:21 -07:00
Toshio Kuratomi
a53140532d Changelog entry for the no_log fix 2018-06-12 11:21:23 -07:00
Brian Coca
17830a01ba no_log even when task_result doesn't provide key
- now also checks task property
 - added reproducer to tests for unreachable status on item loop

(cherry picked from commit 336b3762b2)
2018-06-12 11:20:14 -07:00
Nilashish Chakraborty
b3a1761365
Fixes ios_logging idempotency issues in 2.4 (#41076)
* Fixes ios_logging & Added more tests

* Fixes buffered dest Shippable errors

* Fixed review comments

* Added entry to CHANGELOG.md
2018-06-05 17:24:04 +05:30
Nilashish Chakraborty
eedb78a8ba
Fix eos_logging idempotency issue CP into 2.4 (#40933)
* Fixes eos_logging idempotence issue #31862 (#40604)

* eos_logging idempotence fix

* fixed eos_logging idempotence issue

* Fixed pylint and pep8 errors

* Added tests for eos_logging & minor fix

* Removed q statements

(cherry picked from commit b9ea646839)

* Added eos_logging fix in CHANGELOG
2018-05-31 12:06:27 +05:30
Matt Clay
0967cc0c70 Fix FreeBSD package install in test setup.sh.
(cherry picked from commit c3d3b6cedc)
2018-05-30 09:26:15 -07:00
Sviatoslav Sydorenko
ea68bb33d0
[backport] Detect separate git dir and set git config path value appropriately
PR #38016

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit 0a701ff)

Co-authored-by: Senya <senya@riseup.net>
2018-05-23 22:48:37 +02:00
Matt Clay
e450722867 Fix uri test on Python 2.6.
(cherry picked from commit 5c124876fa)
2018-05-16 15:36:40 -07:00
Trishna Guha
e583d63144
nxos enable mode fix (#39898)
* nxos enable mode fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* update changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Address review comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-05-09 17:24:42 +05:30
George Wilson
9e1ce48b1c Backport part of #33221 (commit: 8fa1373a67da1801bd1df121851d6a619d002499) to fix azure functionapp ansible modules fataling due to a bad URL (#36322) 2018-05-02 17:34:28 -07:00
Matt Clay
d68900d728 Use HTTPS instead of HTTP for httpbin tests. (#39457)
The httpbin.org site is now redirecting HTTP to HTTPS.

(cherry picked from commit b92ef8e54a)
2018-05-01 20:56:17 -07:00
Matt Clay
169cfbb25b Disable failing tests.
(cherry picked from commit f9ba5bc5e9)
2018-04-27 16:15:45 -07:00
Matt Clay
ddc9708557 Update the cloudstack test container reference.
(cherry picked from commit ac1fbbeabc)
2018-04-25 12:32:00 -07:00
Matt Clay
05d6b2086f Fix mysql-server install/upgrade on Ubuntu 16.04. (#39241)
* Fix mysql-server install/upgrade on Ubuntu 16.04.
* Prevent service restart in docker_secret test.

(cherry picked from commit 996f9c2467)
2018-04-24 13:53:05 -07:00
Jordan Borean
74f14ac23d
win_setup: backport 2.4 fix for machine sid to work in domains with lots of users (#39040)
* win_setup: fix for machine sid to work in domains with lots of users (#38646)

(cherry picked from commit 2fc3ac3516)

* Added changelog entry for windows setup.ps1 fix
2018-04-21 06:57:08 +10:00
Matt Clay
b34402178e Update httptester container reference.
(cherry picked from commit 35748e5228)
2018-04-17 22:32:08 -07:00
Matt Clay
cff1cc6cc8 Restore docker_secret test on RHEL.
(cherry picked from commit 57f1298074)
2018-04-17 13:59:02 -07:00
Matt Clay
2cffb28b3d Disable failing fortios_* tests.
(cherry picked from commit 938625add7)
2018-04-17 13:58:55 -07:00
Matt Clay
e985272791 Use new vcenter simulator container location.
(cherry picked from commit 1d5c933ecf)
2018-04-16 16:29:56 -07:00
James Tanner
0ee146fef2 Fallback to the newer object type for dvswitch
(cherry picked from commit 940bf1f627)
2018-04-16 16:29:56 -07:00
John R Barker
00348c3db0
Explicitly exclude W504 (#38539) (#38553)
pycodestyle 2.4 has changed the default for W504
(cherry picked from commit 38491fe93d)
2018-04-11 09:47:58 +01:00
Markos Chandras
608d30ba9b modules: zypper: Optimize the 'search' subcommand (#37191)
When looking for installed packages we do not need to query
repositories since we only care about the rpmdb. As such, we can
disable all the repositories operations in order to improve the
performance of that step

Before this patch, when using 'state: present' in the zypper module,
the operation was taking about 12 seconds to complete:

time ansible-playbook foo.yml 1>/dev/null

real	0m12.614s
user	0m10.880s
sys	0m0.683s

After this patch:

time ansible-playbook foo.yml 1>/dev/null

real	0m4.193s
user	0m2.560s
sys	0m0.575s

see:
https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
(cherry picked from commit 5234b78b5f)
2018-04-09 11:55:13 -07:00
Trishna Guha
9be623dd95
fix nxos_snapshot test assert (#38458)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-04-09 01:58:12 -04:00
Ganesh Nalawade
69f917ab6a Encode xml data to utf8 standard (#34079) (#38259)
(cherry picked from commit 5089122a32)
2018-04-06 12:45:40 -07:00
Toshio Kuratomi
f1f8b9f32f Add openssl_certificate python3 fix to the changelog 2018-04-06 12:45:40 -07:00
Toshio Kuratomi
7d91872fbb Add template fix to changelog 2018-04-06 12:45:40 -07:00
Jordan Borean
37901bba41
win_copy: added fix for win_copy deleting local tmp folder (#37978) 2018-04-06 07:18:53 +10:00
Sam Doran
971697052b Update installation docs for RHEL based distributions. (#38055)
Upstream rpms are no longer in Extras but EPEL as well as releases.ansible.com.
Add instructions for adding Ansible Engine repo to RHEL.
2018-04-05 10:47:20 -07:00
Toshio Kuratomi
0adcd7bd1a New release v2.4.4.0-1 2018-04-04 15:18:14 -07:00
Toshio Kuratomi
89c17724fd Update the docs with the 2.4.4 release date 2018-04-04 14:41:42 -07:00
Toshio Kuratomi
a2522ac581 New release v2.4.4.0-1 2018-04-04 13:10:52 -07:00
Toshio Kuratomi
2a07da2255 New release v2.4.4.0-0.3.rc2 2018-03-29 19:26:08 -07:00
Toshio Kuratomi
89b681a271 Add changelog entries for nxos_* fixes 2018-03-29 19:07:56 -07:00
Trishna Guha
846bfbf378 add nxos_snapshot test for missing required param (#37248)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 2501834c42)
2018-03-29 19:03:08 -07:00
Trishna Guha
88bd45b354 fix required args for nxos_snapshot and docs improvement (#37232)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit a10df8b0b5)
2018-03-29 19:01:55 -07:00
Toshio Kuratomi
60c540c29b Add changelog for consul module state=absent fix 2018-03-29 18:54:25 -07:00
Toshio Kuratomi
9dd41cf47c Add changelog entry for jira py3 fix 2018-03-29 17:34:29 -07:00
Tim Werner
07ab4a9d20 make jira authentication Python3 compatible (#33862)
* make jira authentication Python3 compatible

(cherry picked from commit a51a699314)
2018-03-29 17:34:05 -07:00
Toshio Kuratomi
95f043c199 Add vagrant dyn inv fix to changelog 2018-03-29 17:33:11 -07:00
Hideki Saito
2ae7a892b9 Fix dynamic inventory for vagrant does not work on python3 (#37631)
* Fix dynamic inventory for vagrant does not work on python3 #35129

(cherry picked from commit 1b121fc9e4)
2018-03-29 17:32:47 -07:00
Toshio Kuratomi
5025cdb6a2 Add digital ocean py3 fix to changelog 2018-03-29 17:30:36 -07:00
Abhijeet Kasurde
3323eecfb0 DigitalOcean: typecast map function for Python3 (#37126)
In Python2, `map` returns list whereas Python3, `map` function
 returns iterator. This fix typecast map function for Python3.

Fixes: #37114

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 8f3f7f104f)
2018-03-29 17:23:44 -07:00
Toshio Kuratomi
d02dd8d8dd changelog for ansible-pull python3 fix 2018-03-29 15:17:17 -07:00
Toshio Kuratomi
133afbaebe Compare byte strings to byte strings
* Fix a traceback in ansible-pull on python3 comparing output from
  subprocess with a text string.
* Rename variables that hold byte strings so we are clear that those are
  not text strings.
* Use to_text() to transform variable that's being displayed as it's
  less fragile than str().

Fixes #36962

(cherry picked from commit b98ad3a12b)
2018-03-29 15:16:51 -07:00
Toshio Kuratomi
783f901919 Add ec2 python3 fix to changelog 2018-03-29 15:15:26 -07:00
Toshio Kuratomi
4beaa03ae6 Fix use of user_data field with spot_price in ec2 module (#37628)
The user_data field is base64 encoded inside of the boto library.  In
Python3, base64 must be used with byte strings.  So we make sure to
encode the user_data into a byte string before passing it on to the boto
library.

Fixes #34978

(cherry picked from commit 0d55081ba8)
2018-03-29 15:14:24 -07:00
Toshio Kuratomi
cf557f0dc1 Add csvfile py3 fix to changelog 2018-03-29 15:13:05 -07:00
Toshio Kuratomi
f7d14a78eb Fix csvfile traceback on Python3 (#37625)
* Fix csvfile traceback on Python3

The csvfile lookup uses some custom iterators.  These needed to be
ported to handle the python3 iterator protocol.  In addition, the
csvfile module takes an iterator of byte strings in Python2 and an
iterator of text strings in Python3

Fixes #36808

(cherry picked from commit 09325b619e)
2018-03-29 15:10:28 -07:00
Toshio Kuratomi
ff2a4eadd8 add haproxy py3 fix 2018-03-29 14:58:53 -07:00
Ravi
8c0b91cdb5 Fix python3 interpreter issue (#34811) (#35176)
* Fix python3 interpreter issue (#34811)

* Update ansible.module_utils._text (#34811)

* Convert to text later to account for multibyte characters

(cherry picked from commit 340064bfb9)
2018-03-29 14:57:54 -07:00
Toshio Kuratomi
c40e62d38f Cherry pick fix for interface_files
https://github.com/ansible/ansible/pull/37818/files
2018-03-29 14:45:12 -07:00
Alvaro Aleman
5d604d7ecd Fix consul module service deregistration (#34847)
* Fix consul module service deregistration

Upstream pr in the python-consul library:
https://github.com/cablehead/python-consul/pull/174

This is based on work from https://github.com/bobh

Fixes ansible/ansible#34628

* Pass ACL token when deregistering consul service

(cherry picked from commit c9cb0016a0)
2018-03-29 14:12:42 -07:00
Matt Martz
b9c94cc0c4 Add changelog entry for #36470 2018-03-28 09:20:42 -07:00
Matt Martz
07449d7e3d Fix py3 issue in wait_for_connection (#37646)
(cherry picked from commit 6c3e565ba3)
2018-03-28 09:20:42 -07:00
Matt Clay
dff97aa252 Fix docker_secret test on RHEL.
(cherry picked from commit f1899f784b)
2018-03-22 12:35:36 -07:00
Matt Clay
03245022a2 Pin httptester SHA.
(cherry picked from commit 8232c95f42)
2018-03-20 12:20:30 -07:00
Matt Clay
a1abc2788d Fix uri test on Python 2.6.
(cherry picked from commit 1fd9a616a4)
2018-03-19 23:19:42 -07:00
Marc Mercer
ff8f3120ef Fixing tab indent on elb_target_group.py example 2018-03-19 16:39:34 -07:00
Toshio Kuratomi
0b0d8a0c03 Add changelog entry for error message wrapping 2018-03-19 08:11:20 -07:00
Pilou
4f071bdc2f Connection error messages are unsafe: wrap them (#37329)
* Check that connection error msg are not unsafe

* Connection error messages are unsafe: wrap them

For example, in case of error, docker connection plugin returns exception
message containing Go template. These messages weren't tagged as unsafe
and were consequently rendered:

The conditional check 'result is failed' failed. The error was:
{
  'msg': u'Docker version check ([\'/usr/bin/docker\', \'version\', \'--format\', "\'{{.Server.Version}}\'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied\n',
  'failed': True
}:
template error while templating string: unexpected '.'.
String: Docker version check (['/usr/bin/docker', 'version', '--format', "'{{.Server.Version}}'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied

(cherry picked from commit 4378542ac7)
2018-03-19 08:10:10 -07:00
Toshio Kuratomi
850224dd5e Add ovirt_vms fix to changelog 2018-03-19 07:59:09 -07:00
Ondra Machacek
2e30e2c8f2 ovirt_vms: Pass correct VM entity to create method (#37460)
(cherry picked from commit 9f02fea15b)
2018-03-19 07:52:19 -07:00
Toshio Kuratomi
0df8924b35 Add openssl_certificate python3 fix to the changelog
(cherry picked from commit 282fbfa7764fee5ec56046d1b248813e42107b6c)
2018-03-19 07:50:40 -07:00
Michael Scherer
0f8b06a8f6 write need bytes object on python 3 (#35143)
Otherwise, it fail with:

    Traceback (most recent call last):
      File \"/tmp/ansible_c1zmq3i9/ansible_module_openssl_certificate.py\", line 808, in <module>
        main()
      File \"/tmp/ansible_c1zmq3i9/ansible_module_openssl_certificate.py\", line 787, in main
        certificate.generate(module)
      File \"/tmp/ansible_c1zmq3i9/ansible_module_openssl_certificate.py\", line 692, in generate
        certfile.write(str(crt))
    TypeError: a bytes-like object is required, not 'str'

(cherry picked from commit 347b5d1e50)
2018-03-19 07:50:40 -07:00
s-hertel
02e591746c Use hyphens in bucket name instead of underscores
As of March 1st underscores are not supported in us-east-1
2018-03-15 13:27:11 -07:00
Matt Clay
7fdc56724a Disable failing github_issue integration test.
(cherry picked from commit 30bb70cf2d)
2018-03-14 16:16:41 -07:00
jjshoe
3fe258e7d5 Document that this module was renamed recently (#37420)
(cherry picked from commit ff15a9e7e2)
2018-03-14 11:37:29 -07:00
Jordan Borean
1f888d9f51 powershell: backport of environment key and value fix 2018-03-08 15:00:37 -08:00
James Mighion
df0f9d1d91 Fixing module docs so they dont show up as a list on ansible docs. (#37203)
* Fixing module docs so they dont show up as a list on ansible docs.

* Fixing spacing in description.
2018-03-08 13:03:20 -08:00
John R Barker
b025f7ea7c yum is Python 2 only. If Python 3 use dnf (#37140)
* PY3 = dnf

Red Hat are unlikely to provide a Python 2 version of the yum bindings
as they are moving to `dnf`.

If Ansible can't find the yum Python library give the user a hint about
dnf and Python 3

(cherry picked from commit 6c8d40f653)
2018-03-08 00:37:25 -08:00
Toshio Kuratomi
3667a0d1cc Add unarchive fix to changelog 2018-03-07 18:43:21 -08:00
Toshio Kuratomi
c37e2e5d6e Fix unarchive with strip-components in extra_opts (#37048)
* Fix unarchive with strip-components in extra_opts

When unarchive is given extra_opts to strip all leading directories, it
could end up trying to change the permissions on the root directory.
Tar archives shouldn't contain absolute paths anyways so make sure that
all paths are relative as we handle them.

Fixes #21397

(cherry picked from commit cca0ccaf97)
2018-03-07 18:42:44 -08:00
Matt Martz
7264d13991 Backport #37151 for 2.4 (#37153)
* Add ansible-config and ansible-inventory to setup.py scripts (#37151)

(cherry picked from commit bd43776acf)

* Add changelog entry for #37151
2018-03-07 15:02:00 -08:00
Toshio Kuratomi
3bf0a50716 Clarify docker SDK rather than docker API 2018-03-06 09:01:15 -08:00
Toshio Kuratomi
87c11663c1 Add docker 3 API fixes to the changelog 2018-03-06 07:01:35 -08:00
skylerbunny
d6f150cbb8 Add compatibility for docker-py version 3 (#36973)
(cherry picked from commit d984afa5ba)
2018-03-06 06:58:09 -08:00
Toshio Kuratomi
612b99a217 Add py3 znode and maven_artifact fixes to the changelog 2018-03-05 18:50:23 -08:00
Toshio Kuratomi
e0bc936b56 Python3 issues in maven_artifact (#37035)
Fixes #33761

(cherry picked from commit 1bc860fafd)
2018-03-05 18:49:48 -08:00
Grigory Starinkin
98b5ffec04 fix python3 compatibility for znode module
kazoo client requires bytes and not string

(cherry picked from commit 2d98a2de68)
2018-03-05 13:02:40 -08:00
David Newswanger
5911ee813a fix python 3 dictionary issue 2018-03-05 09:07:27 -08:00
Toshio Kuratomi
5328bfd99b New release v2.4.4-0.2.rc1 2018-03-01 13:50:04 -08:00
Sam Doran
47eccd366b
Cherry pick Tower credential fixes to stable-2.4 (#36807)
* Fix credentials for Tower API V2

(cherry picked from commit 640749d54f)

* tower cred: implement credential /api/v1/ kind compatability

(cherry picked from commit 9cb4b70e27)

* tower cred: filter user name lookup by the proper key

(cherry picked from commit cd6855275e)

* tower cred: update kind options in documentation

(cherry picked from commit 8a41233202)

* tower cred: support credential kind/type for /api/v1/ and /api/v2/ (#36662)

older versions of Tower (3.1) don't have a concept of CredentialTypes
(this was introduced in Tower 3.2).  This change detects older versions
of pre-3.2 tower-cli that *only* support the deprecated `kind`
attribute.

(cherry picked from commit 641f8b4ef6)

* Add CHANGELOG entry for Ansible Tower module credential fix

* properly detect the absence of credential_type in older tower-cli (#36908)

(cherry picked from commit a82043939b)

* Do not import HAS_TOWER_CLI since it does not exist in stable-2.4

* properly pass /api/v1/ credential fields for older Towers (#36917)

(cherry picked from commit 0e7106b106)
2018-03-01 15:54:15 -05:00
Brian Coca
0d57282a1a remove extra fields from debug output
fixes #35493

updated tests

(cherry picked from commit a79378fccb)
2018-03-01 12:06:40 -05:00
Brian Coca
4546e7d1d7 fix loop_control templating (#36124)
* fix loop_control templating

- properly template ALL properites for loop_control
- loop_control inherits from base, it should not, but needs validate/attribute functionality

fixes #24719

(cherry picked from commit 8de4f7cd9f)
2018-03-01 11:53:19 -05:00
Toshio Kuratomi
990254efb1 Add protection for inventory plugins using verify incorrectly to changelog 2018-02-28 19:07:19 -08:00
Brian Coca
18359b0cec protect against plugins using verify incorrectly
assume false on any errors

(cherry picked from commit ef40e5e3b2)
2018-02-28 19:06:27 -08:00
Trishna Guha
92cea82a4e
vyos_l3_interface fix (#36721)
* vyos_l3_interface fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* update test and changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-02-27 08:52:37 +05:30
Matt Clay
2d05ecb26c Temporarily disable subversion test on osx.
(cherry picked from commit f283edcb19)
2018-02-26 13:26:35 -08:00
Matt Clay
1f43d5fc75 Fix rst link syntax. 2018-02-26 11:31:55 -08:00
Matt Clay
29e7d5ecd9 Fix unclosed anchor in changelog. 2018-02-26 10:08:10 -08:00
Matt Martz
668a17cfba
Backport #36602 for stable-2.4 (#36607)
* Start of tests for modify_module, specifically to ensure proper shebang replacement on old style modules (#36602)

(cherry picked from commit a7062b7587)

* Modify test to work on 2.4 due to lacking templar kwarg
2018-02-22 17:52:47 -06:00
Deepak Agrawal
3b0686ffe8
vyos_config IndexError in sanitize_config (#36375) (#36566)
* Bug in del(list) logic. Say you have a list of 4 elements a[0-3]
and you have to remove index 1 and 3, if you remove index 1 first
then list is cut short a[0-2] and does not have index 3

Fix: Remove indexes in reverse sorted order e.g. 3 and 1 in above
example so that order of indexes remain preserved even after deleting

fix is to remove indexes in reverse sorted order

* Add test cases for failed case

(cherry picked from commit 0bbea9a579)
2018-02-22 20:20:49 +05:30
Toshio Kuratomi
52c85f6c66 New release v2.4.4-0.1.beta1 2018-02-21 20:29:49 -08:00
Toshio Kuratomi
fe7e44a5d7 Add python3 ansible_*_interpreter fix to the changelog 2018-02-21 18:09:22 -08:00
Matt Martz
a8582663b1 Fix types when evaluating interpreter (#36541)
* Fix types when evaluating interpreter. Fixes #36536
* Rename variables that contain bytes to b_*
* Get rid of to_text() and to_bytes() calls that do nothing (because the
  data is already the proper type)

(cherry picked from commit a4df4d33ac)
2018-02-21 18:09:16 -08:00
Sam Doran
23289bd2f2 Check for regexp match when using insertbefore or insertafter (#36474)
Add tests to cover this scenario
Fixes #36156

(cherry picked from commit 723daf3e3a)

# Conflicts:
#	lib/ansible/modules/files/lineinfile.py
2018-02-21 17:06:27 -05:00
Sam Doran
0231cd9c93 Add note to use script module rather than inline here documents (#32863)
* Add example on how to use a here document with shell module

* Remove here doc example and add note to use script module instead

(cherry picked from commit 5e7ee9df0a)
2018-02-21 15:09:18 -05:00
Matt Martz
4e4cd7ee67
cherry-pick #36470 for 2.4 (#36526)
* Re-use logic from StrategyBase._load_included_file in StrategyModule.run for free and linear (#36470)

This improves include_role performance and recursion limits

(cherry picked from commit 10fefc7156)

* Add changelog for 36470
2018-02-21 11:30:21 -06:00
Abhijeet Kasurde
101578b63f
VMware: set extra configs for virtual machine (#36521)
This fixes implementation of extra config for virtual machine.

Fixes: #32004

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 80fb836ce5)
2018-02-21 21:44:44 +05:30
Jordan Borean
a3e02a2417
fetch: changed docs around behaviour for default fail_on_missing 2018-02-21 18:14:27 +10:00
Sam Doran
8b6184472b Update CHANGELOG 2018-02-20 20:01:22 -05:00
Sam Doran
6598c8e361
Always show prompt, even if seconds or minutes are specified (#36258)
Fixes #36057
2018-02-20 19:57:11 -05:00
Jordan Borean
55f903eafd
winrm: Fix kerberos auth encoding for Python 3 (#36465) 2018-02-21 08:43:02 +10:00
Toshio Kuratomi
f3a395b783 Add deb packaging fix for ubuntu12.04 to changelog 2018-02-19 13:41:04 -08:00
Grant Slater
858a1f802f Use pycrypto backend, rather than python-cryptography, on Ubuntu Precise
(cherry picked from commit e3192fb3a4)
2018-02-19 13:40:27 -08:00
David Newswanger
a98700917f added support for --testcase flag in ansible-test (#36134)
* added support for --testcase flag in ansible-test

* fixed command format

* added tab completion

* fixed sanity issues

* added documenation for --testcase

* don't autocomplete when multiple modules are selected

(cherry picked from commit 3f5caf659e)
2018-02-19 09:01:38 -08:00
Toshio Kuratomi
4a08e07da0 Add changelog entries for some more 2.4.4 fixes 2018-02-15 14:28:09 -08:00
Adam Miller
1ab84b1cfd fix new EC2 C5 instance virtualization_type identification (#35063)
* fix new EC2 C5 instance virtualization_type identification

Fixes #35051

Signed-off-by: Adam Miller <admiller@redhat.com>

(cherry picked from commit f95adcce8e)
2018-02-15 14:23:37 -08:00
John R Barker
37334ca3ee Clarify when and how to enable ANSIBLE_DEBUG (#35220)
(cherry picked from commit 181085821b)
2018-02-15 14:21:50 -08:00
Dag Wieers
0d5aa161e8 Improve convert_bool error message
The error message as it was confused me when the value was 'enabled' and
there was also a module parameter named 'enabled'.

    enabled is not a valid boolean.  Valid booleans include: yes, on, 1, true, ...

So by clearly describing it as a value, the confusion would have been
avoided.

    The value 'enabled' is not a valid boolean.  Valid booleans include: yes, on, 1, true, ...

(cherry picked from commit 487cf0ee8d)
2018-02-15 14:19:42 -08:00
Adam Miller
291c1eb57d make v2_playbook_on_notify method signatures consistent
This was causing an exception in the TaskQueueManager when a third
party handler plugin was processed that inherited or explicitly
called the callback method from super because the method signature
was incorrect in callback/__init__ and it processed the arguments as
incorrect data types as a side effect.

Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit dd9b2c0774)
2018-02-15 16:06:29 -05:00
Adrian Likins
7e32010bdb Fix ansible-console always asking for vault passwords
ansible-console was calling setup_vault_secrets
twice. Once directly and once via _play_prereqs()

The direct invocation was not setting auto_prompt=False.

However, the direct invocation isn't need at all so
this removes it so only _play_reqs() is used.
That fixes the unrequested vault password
prompting.

Fixes #33027

(cherry picked from commit 810fa7046b)
2018-02-15 16:06:28 -05:00
tedder
7d6e3f3bba fix spelling. Seriously, that's it.
(cherry picked from commit e8fc269cd3)
2018-02-15 16:06:17 -05:00
Martin Krizek
acea14b392 add_host: check if name or hostname arg is provided
(cherry picked from commit 39d9496282)
2018-02-15 16:00:38 -05:00
Brian Coca
dfa3ecaf84 fixes to virtual facts
fixes #36038

(cherry picked from commit 97b6e99479)
2018-02-15 15:57:00 -05:00
Michael Nugent
0c4f6c3f68 False matches the docs and intentions of the previous developer (#35762)
(cherry picked from commit d212ca11b3)
2018-02-15 15:45:37 -05:00
Toshio Kuratomi
5c937b21f3 Add oom_killer fix for docker_container to the changelog 2018-02-15 09:07:29 -08:00
PikachuEXE
14e7432467 Backport fix in PR #30712 into 2.4
https://github.com/ansible/ansible/pull/30712
2018-02-15 09:06:15 -08:00
Jordan Borean
71b1a1e982
updated changelog for win_uri fix 2018-02-15 07:22:35 +11:00
Jordan Borean
f37cba14ac
win_uri: fix creates/remotes - manual cherry-picking for pull 36016 for stable-2.4 2018-02-15 07:21:49 +11:00
Matt Martz
cc7dfdeb52 Add changelog entry for reparenting fix (#36075) 2018-02-13 09:35:33 -06:00
Matt Martz
103e569f5e Prevent reparenting a block with itself (#36075)
* Prevent reparenting a block with itself

* Move __eq__ to Block, to avoid some unexpected problems

(cherry picked from commit 76ff3e9efc)
2018-02-13 09:33:57 -06:00
Trishna Guha
9fcff68ae1
Fix nxos_igmp_interface for diff nxos versions (#35959) (#36020)
* Fix nxos_igmp_interface for diff nxos versions (#35959)

(cherry picked from commit 7a711cf942)

* update CHANGELOG

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-02-12 10:42:07 +05:30
Matt Martz
c6a5a27531 Add changelog entry for memory ballooning fix 2018-02-09 11:40:24 -06:00
Matt Martz
a889576d39 Address memory ballooning caused by task caching changes (#35921)
* Exclude parent when copying included task to avoid memory issues. Fixes #35796

* Simplify implicit block squashing to pre-group, instead of post re-parenting

(cherry picked from commit 7d1eb88ecf)
2018-02-09 11:37:59 -06:00
Trishna Guha
7c4e343864
networking fix cherry-pick (#35936)
* Add minor conditional checks to nxos_bgp sanity test (#35476)

* Add minor conditional checks to nxos_bgp sanity test

* Make ansibot happy

(cherry picked from commit 5a198e1e6a)

* fixing the removed_in_version to 2.6. (#35853)

(cherry picked from commit 73650cf854)

* fix eos_config second-level indent idempotece (#35588)

* fix eos_config second-level indent idempotece

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* address ganeshrn's comment - update doc

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit b30f3b9f4d)

* update CHANGELOG

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-02-09 11:37:02 +05:30
Toshio Kuratomi
458968ed00 Add dest in copy return fix to changelog 2018-02-08 16:23:21 -08:00
Tomasz Kontusz
0ac4722b29 Fix for #31477: return 'dest' from copy when file wasn't changed
(cherry picked from commit 89ad40b129)
2018-02-08 16:22:39 -08:00
Trishna Guha
3c4d6a25ed
fix connection gets overridden by network_cli for transport nxapi,eapi net_* modules (#35590)
* fix connection gets overridden by network_cli for transport nxapi,eapi net_* modules

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* pep8 fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-02-08 18:51:14 +05:30
Abhijeet Kasurde
9a64ee4d87
device operations are recursive if serialized (#35727)
(cherry picked from commit 0bb3c4379c)
2018-02-07 10:32:57 +05:30
Matt Clay
61fe2efa48 Temp install of setuptools for import coverage. (#35752)
(cherry picked from commit f46f6c8dec)
2018-02-06 14:04:43 -08:00
Sam Doran
ed5a73251b Fix lineinfile to insert line when pattern exists elsewhere in the file. (#33393)
* Insert lines before or after when the regexp exists elsewhere in the file

* Correct filter syntax in lineinfile integration test

* Use multi-line YAML syntax on lineinfile tests

Unify indentation

* Add lineinfile tests for same line matched to different regexps

* Remove debug statement from test

(cherry picked from commit f8f2b6d61d)
2018-02-05 17:34:40 -05:00
Toshio Kuratomi
2ae94fc0cd Add winrm ipaddress fix to changelog 2018-02-05 10:53:30 -08:00
Luca Berruti
8d968e5001 Fix: global name 'HAS_IPADDRESS' is not defined.
(cherry picked from commit f0ea2b60e1)
2018-02-05 06:41:46 -08:00
Matt Clay
feea6425f3 Fix pip integration test.
(cherry picked from commit ea70b49b11)
2018-01-31 23:27:31 -08:00
Matt Clay
4fd0cd853e Remove EOL openSUSE Leap 42.2 from CI.
(cherry picked from commit abbc1ed4e6)
2018-01-31 21:51:29 -08:00
Toshio Kuratomi
475cc33546 Revert "Add test for fix using loop_control with delegate_to (#33809)"
This reverts commit adf8927c74.

This test uses features not found in ansible-2.4
2018-01-31 19:54:11 -08:00
Martin Krizek
adf8927c74 Add test for fix using loop_control with delegate_to (#33809)
(cherry picked from commit 5c7f203c33)
2018-01-31 17:37:33 -08:00
Scott Butler
b2c3dd3507 Fixes broken link. 2018-01-31 17:31:52 -08:00
Trishna Guha
21255ae76d Fix networking bugs cherry-picked from devel (#35533)
* fix *os_config module backward diff (#35332)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit cff4a2d26e)

* bug-35431 fixed removing encryption from user on subsequent runs of the task (#35433)

(cherry picked from commit 2293252e52)

* Fix nxos terminal plugin to support certain commands

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* update changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-31 17:31:52 -08:00
Matt Martz
11081cbeda Catch exception comparing role versions, and provide a user friendly error message. Fixes #32301 (#34427)
(cherry picked from commit 42a0d71413)
2018-01-31 17:31:52 -08:00
Matt Martz
32ddcf96df Recursively remove args with omit as as their value, to match suboptions in argument_spec (#35299)
* Recursively remove args with omit as as their value, to match suboptions in argument_spec

* Add test for the new remove_omit function

(cherry picked from commit 7404dc6767)
2018-01-31 17:31:52 -08:00
Dag Wieers
0ac3c990ed Backport of docsite changes to module list/options 2018-01-31 17:31:52 -08:00
Abhijeet Kasurde
c4d3a3d596 VMware: Fix SSL Context checking for Python <2.7.9 (#33683)
Fixes: #33602

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 73abde399c)
2018-01-31 17:31:52 -08:00
Matt Martz
2ded3e1fb1 failed, skipped, and unreachable all seem to be needed for various callbacks. Fixes #34716 (#34724)
(cherry picked from commit d8329e530c)
2018-01-31 17:31:51 -08:00
Jordan Borean
80baeb6a3b updated changelog for azure_rm_virtualmachine fix 2018-01-31 17:31:51 -08:00
Yuwei Zhou
09a244fc13 subnet should in the virtual network resource group (#35038)
(cherry picked from commit bec4dcd66c)
2018-01-31 17:31:51 -08:00
Jordan Borean
38089acae6 Updated changelog for azure_rm_subnet issue 2018-01-31 17:31:51 -08:00
Yuwei Zhou
6b26ca183d delete subnet should be idempotent (#35037)
(cherry picked from commit 7c201fc9bc)
2018-01-31 17:31:51 -08:00
Matt Martz
2924ad1bbf Don't skip an inventory source just because it has a comma (#35002)
* Don't skip an inventory source just because it has a comma, make sure it's also doesn't exist as a path. Fixes #34931

* Add integration test for inventory path with commas

(cherry picked from commit 1ac04ba52e)
2018-01-31 17:31:51 -08:00
Jordan Borean
71f6573bf5 updating changelog with win_dns_client dynamic fix 2018-01-31 17:31:51 -08:00
Ben
5bb1faee42 Fixes issue #34956 (#35149)
(cherry picked from commit 9fdaa86c9f)
2018-01-31 17:31:51 -08:00
Trishna Guha
128ee6f48f fix conflict nxos tests (#35078)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-31 17:31:51 -08:00
saichint
d16b5c23c9 fix vxlan idempotent issue (#34750)
(cherry picked from commit c04cd8642d)
2018-01-31 17:31:51 -08:00
Toshio Kuratomi
fe6f28f570 Add nxapi nxos_banner test to the changelog 2018-01-31 17:31:51 -08:00
Trishna Guha
31519edee6 Enable nxapi nxos_banner test (#35033)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 8a6d699198)
2018-01-31 17:31:51 -08:00
Toshio Kuratomi
e2986cba75 Add nxos_bgp fixes to changelog 2018-01-31 17:31:51 -08:00
saichint
49df1fbafd Fixes for nxos_bgp (#34590)
* fix bgp issues

* add new tests cases

* review comments

(cherry picked from commit 6f8d3ad70d)
2018-01-31 17:31:51 -08:00
Toshio Kuratomi
4449142896 Add nxos_vxlan_vtep_vni fixes to changelog 2018-01-31 17:31:51 -08:00
saichint
c11c35e32a fix for nxos_vxlan_vtep_vni issues (#34946)
* fix vxlan_vtep_vni issues

* pep8 errors

(cherry picked from commit 3a144b290d)
2018-01-31 17:31:51 -08:00
Trishna Guha
968e048b0d Idempotency test for enabled mode nxos_udld_interface (#35031)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit f806a58a5e)
2018-01-31 17:31:51 -08:00
Jordan Borean
dd6b61635b Updated changelog with Digital Ocean tag fix 2018-01-31 17:31:51 -08:00
ABond
4203e9f45d Fix Digital Ocean tags module data type (#33486)
Digital Ocean changed their api to no longer accept an integer as a resource_id.  Fix adds changed data type (from integer to string).

Signed-off-by: Anthony Bond <bond.anthony@outlook.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit f9b138b0ab)
2018-01-31 17:31:51 -08:00
Jordan Borean
a5640a9c9d updated changelog with copy test change 2018-01-31 17:31:51 -08:00
Jordan Borean
159b0f628d copy tests: only create recursive symlink in tests (#35073)
(cherry picked from commit 9106284c1c)
2018-01-31 17:31:51 -08:00
Jordan Borean
02e5c0d0ca Updated changelog with win_scheduled_task info 2018-01-31 17:31:51 -08:00
Jordan Borean
8227687767 Updated win_scheduled_task docs to correctly reflect arguments 2018-01-31 17:31:51 -08:00
Toshio Kuratomi
dc0b4dc316 Add become with ssh piped transfer fix to changelog 2018-01-31 17:31:51 -08:00
Matt Martz
55765c8b1e Fix piped transfer with become (#34584)
* Ignore become if we shouldn't be sudoable

* More explicit passing of kwargs

* dd/piped put should be sudoable=False. Fixes #34523

(cherry picked from commit 03794864c2)
2018-01-31 17:31:51 -08:00
Jordan Borean
6f7e1fa773 added changelog around win_script fixes 2018-01-31 17:31:51 -08:00
Jordan Borean
1ddd9dabd8 win_script: fix large args and misc errors in wrapper 2018-01-31 17:31:51 -08:00
Toshio Kuratomi
8a7f9beab7 New release v2.4.3.0-1 2018-01-31 13:28:08 -08:00
Toshio Kuratomi
c8941cb103 Update version in the versions.yml file 2018-01-31 12:34:42 -08:00
Toshio Kuratomi
252863512a Update changelog with release date 2018-01-31 12:32:53 -08:00
Toshio Kuratomi
de6f60b03c Update the release doc with ansible-2.4.3
(cherry picked from commit 0b4debad53)
2018-01-31 12:32:02 -08:00
Matt Clay
75da39fbce Fix failing zypper_repository integration test.
(cherry picked from commit b1d14d5b06)
(cherry picked from commit 9c0cf0eafa2a7218976d64918ad3f2084580f8aa)
2018-01-25 15:34:32 -08:00
Toshio Kuratomi
6b29b3c638 Add link to maximum recursion depth fix in changelog 2018-01-24 18:52:03 -08:00
Toshio Kuratomi
10eba9494c New release v2.4.3.0-0.6.rc3 2018-01-24 11:24:58 -08:00
James Cammarata
a21f44dc0a Restore the behavior of 2.4 to that before ebf971f9
Fixes #35065
2018-01-23 19:46:26 -08:00
Toshio Kuratomi
055cae3c0f Revert "Integration tests for import/include (#33418)"
This reverts commit 8c822018db.

There's some other bugs in 2.4's import/include that aren't blockers for
2.4.3 (becaues they aren't regressions) that prevent the new integration
tests from passing.  Revert the integration tests.
2018-01-20 13:34:45 -08:00
Sam Doran
8c822018db Integration tests for import/include (#33418)
* First pass at include_role tests

* Reorganize test structure

Do all import and include tests in a single target.

* Build out more tests and test with linear and free strategy for each type

* import_role tests

* Set target host for play test

* Basic import_playbook tests

* Basic import/include_tasks tests

* Add recursion test

* import_playbook tests

* Add import_playbook group_vars test

Issue #33177

* Additional group_var tests for import_playbook

* Enable recursion test

* More work on import_tasks

* Run all tests via run.sh, improve conditional tests, add never tag

Add never tag to certain failining tests and explicitly skip it for now until #34104 is merged. Some tasks need to remain commented out because they cause the entire play to fail and aren't skippable by tags because they are syntax and/or variable checks.

Improve test for whether or not a role was run based on a conditional. Since the [import|include]_role does not register a variable, use a variable that is set inside a role as a canary test for whether or not the role was run.

* Use a fail task rather than trigger a failure via bogus command

This should resolve the "unstable" test results.

* Import tag tests

Fix bug it tests where validate tasks weren't run on tag tests.
Add tests for task import/include with tags.

* Remove test for playbook group_var inheritance

(cherry picked from commit 10a8c6bc25)
2018-01-19 08:24:31 -08:00
Toshio Kuratomi
0f03f82fd5 Add ssh stdin flush() fix to changelog 2018-01-19 08:06:07 -08:00
Matt Martz
bd4b92c0b6 Ensure that the become password is written on py3 in the ssh connection plugin. Fixes #34727
(cherry picked from commit 29c1d5cb5d)
2018-01-19 08:06:07 -08:00
Toshio Kuratomi
95e162dc32 Add another commit related to memory optimization of includes 2018-01-19 08:06:07 -08:00
James Cammarata
4f0c962b4d Don't use the Task object in the dictionary of results for include_role
The short-circuiting of include_role in TaskExecutor was using the _task object
in the result dictionary. This causes the playbook class to be serialized, which
is something we no longer do due to speed/size problems with nested objects.

Simply removing this should fix a lot of memory and speed problems with include_role.

(cherry picked from commit c30ee42fe1)
2018-01-19 08:06:07 -08:00
Toshio Kuratomi
c570a2fff9 Revert "Don't use the Task object in the dictionary of results for include_role"
This reverts commit 0945694252.

This commit causes a behaviour change that may break playbooks so we're
reverting this for now.
2018-01-18 19:43:46 -08:00
Toshio Kuratomi
ff31828ec3 Revert "Add another commit related to memory optimization of includes"
This reverts commit 794c531158.

This commit is proving to cause a behaviur change that may break
playbooks so we're reverting it from 2.4.3 for now
2018-01-18 19:42:49 -08:00
Toshio Kuratomi
649ffc10a2 Revert "Ensure that the become password is written on py3 in the ssh connection plugin. Fixes #34727"
This reverts commit fb9e7a85b3.

We may not have a 2.4.3rc3 so reverting this for now
2018-01-18 19:42:24 -08:00
Toshio Kuratomi
da6834f02c Revert "Add ssh stdin flush() fix to changelog"
This reverts commit 1810e486ec.

We may not have a 2.4.3 rc3 so reverting this for now.
2018-01-18 19:41:49 -08:00
Toshio Kuratomi
1810e486ec Add ssh stdin flush() fix to changelog 2018-01-18 09:36:45 -08:00
Matt Martz
fb9e7a85b3 Ensure that the become password is written on py3 in the ssh connection plugin. Fixes #34727
(cherry picked from commit 29c1d5cb5d)
2018-01-18 09:33:08 -08:00
Toshio Kuratomi
794c531158 Add another commit related to memory optimization of includes 2018-01-18 09:23:48 -08:00
James Cammarata
0945694252 Don't use the Task object in the dictionary of results for include_role
The short-circuiting of include_role in TaskExecutor was using the _task object
in the result dictionary. This causes the playbook class to be serialized, which
is something we no longer do due to speed/size problems with nested objects.

Simply removing this should fix a lot of memory and speed problems with include_role.

(cherry picked from commit c30ee42fe1)
2018-01-18 09:23:48 -08:00
Toshio Kuratomi
64e6eb5086 New release v2.4.3.0-0.5.rc2 2018-01-17 16:45:47 -08:00
Toshio Kuratomi
6ba624b05b Fix number of arguments to format string 2018-01-17 15:57:34 -08:00
Toshio Kuratomi
fa025db5e5 Fix PEP8 issue 2018-01-17 15:18:33 -08:00
Matt Davis
84dab220bf fix minimum client version checking
* bump minimum client versions to match requirements file
* improve prescriptive error messaging to match current recommendations
(cherry-pick of #35018)
2018-01-17 15:12:55 -08:00
Matt Davis
949e2f06e5 revert azure_rm model pinning (#35011)
* reverts #33897/#34682
* revisit in 2.4.4/2.5.0
2018-01-17 13:08:07 -08:00
Toshio Kuratomi
93297fd0d0 Add azure_rm_securitygroup fix to the changelog 2018-01-15 10:45:14 -08:00
ZhijunZhao
f37a776fc8 fix failure got multiple values for keyword argument id (cherry-picked from 99551818a1) 2018-01-15 10:43:13 -08:00
Toshio Kuratomi
79f359ac99 Add nxos_banner and win_dns_client module fixes to changelog 2018-01-15 10:40:20 -08:00
Trishna Guha
0b0b02fd72 fix nxos_banner (#34695)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 303894dd17)
2018-01-15 10:40:17 -08:00
chriskarel
6e594340c2 Adding "-SyncWindow 0" flag to Compare-Object call (#34656)
Adding "-SyncWindow 0" flag to the Compare-Object call used to determine if the existing and proposed IP address lists are the same.  This makes the array comparison mark changes in order as a difference.

Fix for bug #34651

(cherry picked from commit bb9dcb0d2b)
2018-01-15 10:37:52 -08:00
Toshio Kuratomi
4eea0cec58 Add memory usage with includes optimization to changelog 2018-01-15 10:06:07 -08:00
James Cammarata
f1c458303a Backport of b107e397 (Cache tasks as they are queued)
* Cache tasks as they are queued instead of en masse

This also moves the task caching from the PlayIterator to the
StrategyBase class, where it makes more sense (and makes it easier
to not have to change the strategy class methods leading to an API
change).

Fixes #31673

* Cleaning up unit tests due to 502ca780

(cherry picked from commit b107e397cb)
2018-01-15 10:04:08 -08:00
Matt Martz
b971b87aa4 Add note to 2.4 porting guide about initial playbook relative host/group_vars and inheritance (#34769)
* Add note to 2.4 porting guide about initial playbook relative host/group_vars and inheritance

(cherry picked from commit ae49dd65d9)
2018-01-15 10:01:30 -08:00
Toshio Kuratomi
fe9019e646 Add cloudstack fix to changelog 2018-01-15 08:09:58 -08:00
Rene Moser
2df3f310fa cloudstack: fix timeout in ini config file is ignored
(partly cherry picked from commit 1c3bba0bdb)
2018-01-15 08:08:23 -08:00
Toshio Kuratomi
e2e64ed49c New release v2.4.3.0-0.4.rc1 2018-01-10 20:35:01 -08:00
Toshio Kuratomi
126576d430 Add ios_config deprecaation doc change to changelog 2018-01-10 20:28:10 -08:00
James Mighion
2ad755fca1 Ios config save (#33885)
* Fixing save so it still works. Adding changed as an option for save_when.

* Updating description to state that changed was added in 2.5.

* Fixing removal version for deprecated options.

(cherry picked from commit ded4e6ac0f)
2018-01-10 20:24:53 -08:00
Matt Davis
79d1ba35ad
Cherrypick misc Azure test fixes (#34713)
* Fix test case failure for Azure ACS module (#33623)

* fix azure acs test failure

* change acs location

(cherry picked from commit 8e20ae2de4)

* fix azure test case failure for function apps module (#33658)

(cherry picked from commit f8d7e477f0)

* Fix storage endpoint for Azure Stack (#33946)

* Fix storage endpoint for Azure Stack

https://github.com/Azure/msrestazure-for-python/issues/64

* corrected visual indentation

(cherry picked from commit 6643fe821e)

* Fix incorrect formatting call in azure module (#33561)

Fix corrects formatting call in azure_rm_resourcegroup_facts module.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 6654d69569)
2018-01-10 13:27:52 -08:00
Adam Miller
ef0b705c08
Fix Linux blockdevice size computation (#34475) (#34647)
Linux' sysfs _always_ reports device size in 512b sector units,
regardless of the device's actual, physical blocksize.
2018-01-10 06:28:38 -08:00
Matt Clay
564e013534 Fix pylint issue. 2018-01-10 02:17:04 -08:00
Matt Davis
6f679b45de cherry-pick #34442 2018-01-09 23:29:31 -08:00
Matt Davis
bb9577418e
cherry-pick #33897 (#34682)
* resolved a number of conflicts
2018-01-09 23:25:50 -08:00
Trishna Guha
85a181e715
fix nxos_bgp failure for graceful_restart warning (#34630)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-10 10:50:40 +05:30
Matt Clay
02b1d90cf3 Make xattr test conditional on feature support.
(cherry picked from commit 77726b471f)
2018-01-08 23:57:50 -08:00
Jordan Borean
e2fa2526ae Updated changelog with win_iis_website fix 2018-01-08 10:28:27 +10:00
jn-bedag
61ec5c070a Fixing issue with win_iis_website parameter types. Issue #34500 (#34501)
* remidate Windows debugging

Using $complex_args is not working (anymore?). We need to set $params directly.

* Fixing issue with win_iis_website parameter types

There are two types of attributes. "String" and "Configuration Attribute". We need to get the real "value" based on the type.

* Revert "remidate Windows debugging"

This reverts commit df75d3bb0d152b10c24187ce4c643b4733bae336.

(cherry picked from commit 7f59f7d80e)
2018-01-08 10:27:41 +10:00
Jordan Borean
9a5bca5668 fix windows tests after recent patch (#34548)
(cherry picked from commit 460deb08cb)
2018-01-07 14:09:25 +10:00
James Cammarata
0b7d78d67f
Don't use getattr in _get_parent_attribute to avoid recursion issues (#33595) (#34532)
* Don't use getattr in _get_parent_attribute to avoid recursion issues

Fixes #23609

* Move extend/prepend to field attribute

Also removes _get_attr* methods that were basically just calling
_get_parent_attribute because it needed to set those params.

Also modifies _get_parent_attribute() to pull those values from the
FieldAttributes instead of using the ones passed into the function.

* Better fixes for _get_parent_attribute
2018-01-05 23:20:47 -06:00
Trishna Guha
cf31e47cdc
Make eos_vlan idempotent (#34503)
* make eos_vlan idempotent (#34443)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 0f24199012)

* Make eos_vlan idempotent CHANGELOG

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-05 18:35:59 +05:30
Toshio Kuratomi
1546ddb3c3 Fix up the test-set_mode_if_different unittests 2018-01-04 21:05:38 -08:00
Toshio Kuratomi
3b5e9522d2 Add changelog for checkmode with missing files 2018-01-04 20:36:26 -08:00
Pilou
ffd448e0ad If check mode enabled and file missing set changed to true 32676 (#33967)
* basic.py: add mock to os.path.exists

* set_*_if_different: if check_mode enabled & file missing: set changed to True

Fixes #32676
Thanks to mscherer and Spredzy for the distributed triplet programming
session!

(cherry picked from commit e9df2083a3)
2018-01-04 20:35:27 -08:00
Jordan Borean
5f329134c9 Updated changelog for win_mapped_drive doc update 2018-01-05 08:04:16 +10:00
Jordan Borean
91a0ea20c0 win_mapped_drive: add extra note around win_mapped_drive (#34478)
(cherry picked from commit edf56c9743)
2018-01-05 08:03:18 +10:00
Jordan Borean
a4418fffa2 Updated changelog for win_package fix 2018-01-05 07:14:27 +10:00
Jordan Borean
cb92c4bea1 win_package: remove case sensitive check for msi extension (#34476)
(cherry picked from commit da69f5aeae)
2018-01-05 07:13:18 +10:00
Brian Coca
2c53d012bc really disable inventory cache 2018-01-03 20:09:05 -05:00
yungez
3998a485bd add Azure user agent for Visual Studio Code extension (#33366)
(cherry picked from commit 392b55b70b)
2018-01-03 16:45:37 -08:00
Toshio Kuratomi
ccf10e95fc New release v2.4.3-0.3.beta3 2018-01-03 10:46:56 -08:00
Matt Davis
9a45611c02 backport WinRM IPv6 escaping
* https://github.com/ansible/ansible/pull/34072
* cherry-picked from 57ed6a866f
2018-01-03 09:31:35 -08:00
Martin Krizek
307b9b25ca Update CHANGELOG.md 2018-01-03 17:09:25 +01:00
Martin Krizek
888816b437 yum: case for multilib when installing from a file (#32236)
(cherry picked from commit 356901b72d)
2018-01-03 17:07:24 +01:00
Matt Davis
3a853fc9b8 fix win_firewall test failure on 2008/2008r2 (#34391)
* ensure that "starting" profile is known instead of relying on default
2018-01-03 05:36:40 -05:00
Matt Davis
266afc61b8
Update CHANGELOG.md 2018-01-02 20:43:12 -08:00
Matt Davis
cbc07cf9cc backport win_firewall_rule updates
from devel  SHA 89d9444ad560ef5c4a8aac911e2e7abcf7aa9c76
2018-01-02 20:38:00 -08:00
Matt Davis
8708105616 avoid use of Write-Host in config script
(cherry picked from commit 82996d5b267994d9806bbba62ceee2cd6613e9da)
2017-12-20 22:51:54 -08:00
Matt Davis
ae0d7da822 add GlobalHttpFirewallAccess arg
(cherry picked from commit a9ca0389b6cdf2992b04d6bafbd2cb3feb861d12)
2017-12-20 21:34:27 -08:00
Toshio Kuratomi
9dc4e0cec7 New release v2.4.3.0-0.2.beta2 2017-12-20 11:53:43 -08:00
Toshio Kuratomi
48a0cf1148 add cloudscale fix to the changelog 2017-12-19 14:31:39 -08:00
Gaudenz Steinlin
03eccdea19 Send API parameters as JSON in cloudscale_server module
Use JSON to send the POST data to the API instead of an urlencoded
string. Urlencoding is not really a good match for some Python
datatypes.

This fixes an issue when submitting a list of SSH keys which did not get
translated properly.

Partial cherry-pick of the important parts of 4c94c6f9ba.
2017-12-19 14:28:02 -08:00
Brian Coca
b375d5f3ea dont warn on not matching 'all' (#32806)
* dont warn on not matching 'all'

the implicit localhost warning shoudl be enough

* centralized no hosts handling

also extended info on implicit only

(cherry picked from commit 87c75b19dd)
2017-12-19 15:07:31 -05:00
Brian Coca
7d976c6484 fix reconcile to ensure 'ungrouped'
also removed redundant 'hosts to all' as all groups already ensure that inheritance

(cherry picked from commit ad94a3a6a2)
2017-12-19 15:02:44 -05:00
Trishna Guha
284625f18c
NXOS Commit Integration tests to Ansible (part 2) (#28939) (#33964)
* add nxos_aaa_server IT

* add nxos_aaa_server_host ITs

* Add nxos_gir IT

* Add nxos_gir_profile_management IT

* add newly added tests to nxos.yaml

* fix nxos.yaml indentation

* fix indentation again

* skip nxos_git_profile_management IT for titanium

* change idempotency to non-idempotency check

(cherry picked from commit a130549ead)
2017-12-16 10:10:19 +05:30
Toshio Kuratomi
aa50818506 changelog for file attribute fix 2017-12-15 09:51:32 -08:00
Maxime de Roucy
86fbaffc07 fix file attributes changed detection
https://docs.python.org/2/library/stdtypes.html#str.split
str.split([sep[, maxsplit]])
If sep is given, consecutive delimiters are not grouped together and are deemed
to delimit empty strings.

>>> "85563      ----------------C-- /var/lib/libvirt/images".split(' ')[0:2]
['85563', '']
>>> "85563      ----------------C-- /var/lib/libvirt/images".split()[0:2]
['85563', '----------------C--']

(cherry picked from commit c2ac9d0831)
2017-12-15 09:50:29 -08:00
Jordan Borean
e95611980a update changelog for win_iis_webapppool for password fix 2017-12-15 09:53:33 +10:00
Jordan Borean
5dd40349b2 win_iis_webapppool: stop any passwords from being returned (#33931)
(cherry picked from commit 0ca828ebab)
2017-12-15 09:52:52 +10:00
Jardar Marshall Bond
c08ae38a9d Fix example with proceccModel in win_iis_webapppool (#32971)
The attribute processModel.userName have to be written i camelCase. Otherwise this fails silently.

(cherry picked from commit 1eae3b6b59)
2017-12-15 09:34:14 +10:00
Matt Martz
df3b45e0f4 Add changelog entry for #33926 2017-12-14 16:05:31 -06:00
Matt Martz
0850a7635b Handle vault filenames with nonascii chars when displaying messages. Fixes #33879 (#33926)
(cherry picked from commit 0b9f1f7982)
2017-12-14 16:03:28 -06:00
Ganesh Nalawade
2a007e2b4d
Fix ios_interface integration test failure (#33901) 2017-12-14 14:17:08 +05:30
Ganesh Nalawade
13937ce772
ios_config save (#33791) (#33872)
* Fixing save so it still works. Adding changed as an option for save_when.

* Updating unit tests.

* Updating description to state that changed was added in 2.5.

(cherry picked from commit 3a9083cf48)

* Update Changelog
2017-12-13 22:31:09 +05:30
John R Barker
3f7b1ba606
Fix CloudEngine host failed 27876 2017-12-13 13:45:52 +00:00
QijunPan
4f1586ec07 fix CloudEngine host failed #27903 (#33732)
* Update ce.py

* Update ce.py

fix CloudEngine host failed #27903
2017-12-13 13:44:45 +00:00
Will Thames
06ddcf6fa7 Remove deprecated restart: parameter from win_feature examples (#33848)
`restart` is a deprecated parameter. Show how to use `reboot_required`
in examples instead

(cherry picked from commit 1f8f394de3)
2017-12-13 16:50:01 +10:00
Jordan Borean
a635a7861b updated changelog for win_iis_webapppool fix 2017-12-13 16:36:09 +10:00
Gianluca
07a1217aa7 Fixes #33771 - win_iis_webapppool bugfix (#33777)
* Fixes #33771

* Fixes #33771 - mod 1

* removed some unneeded whitespace

(cherry picked from commit 1d10a2867c)
2017-12-13 16:35:23 +10:00
Matt Martz
926dfb7c04 Add test for clean_copy preservation of keys
(cherry picked from commit 5c63bb0090)
2017-12-12 14:27:41 -06:00
Adam Miller
74de512bfc remove unnecessary extra conditional (thanks bcoca)
Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>
(cherry picked from commit 7bc7c347dd)
2017-12-12 13:09:25 -05:00
Brian Coca
5067a1340a always preserve certain keys (#33637)
* always preserve certain keys

fixes #33433

* results

(cherry picked from commit 8d78a829c6)
2017-12-12 13:05:38 -05:00
Jordan Borean
5fb97aa6c9 Updated changelog for windows fetch fix 2017-12-12 15:01:30 +10:00
Jordan Borean
39f590523f Fix fetch when retrieving a file with a multiple of the buffer size (#33697)
* Fix fetch when retrieving a file with a multiple of the buffer size

* fixed sanity issue

(cherry picked from commit 6e4c690a37)
2017-12-12 15:00:43 +10:00
Toshio Kuratomi
109471cb7f Remove files from legacy that pass now that W503 is ignored 2017-12-08 11:28:39 -08:00
John R Barker
c7a903c34b Ignore W503 in stable-2.4 (#33716)
* Ignore W503

To avoid backporting from devel (2.5) to 2.4 any code that may fail pep8
backport the current-ignore change.
2017-12-08 10:45:10 -08:00
Toshio Kuratomi
298255095d Fix Command module documentation
The command module docs were unclear.  They talked about ignoring the user's environment which lead people to believe the user's environment variables were not used.  In actual fact, the user's environment variables are used.  They just are not expanded in the command.

(cherry picked from commit 824ec37a4f)
2017-12-08 10:07:21 -08:00
s-hertel
6a6ae0cede loop doesn't exist in 2.4 2017-12-08 09:53:51 -08:00
Toshio Kuratomi
132d6fe78c Add environment on loop fix 2017-12-08 07:22:54 -08:00
Sloane Hertel
f2bf74991e Fix using loops with environment and add tests (#32796)
(cherry picked from commit 7bb35e8781)
2017-12-08 07:22:11 -08:00
Toshio Kuratomi
dc788f1377 Add ansible_python_interpreter fix to changelog 2017-12-08 07:01:46 -08:00
Toshio Kuratomi
5435c7a9cb Add letsencrypt python3 fix to changelog 2017-12-07 17:22:38 -08:00
bverschueren
c1567c0222 python3 support for letsencrypt module (fixes #30690) (#32734)
*   python3 support for letsencrypt module (fixes #30690)
  * initialize result to a dict in some methods to prevent 'NoneType is not iterable' TypeError
  * use dict.get() to retrieve values from info dict to prevent KeyError
  * convert to/from text/bytes using _text methods for PY3 support

(cherry picked from commit 3a634058f3)
2017-12-07 17:21:59 -08:00
Andreas Olsson
aaf7bf8fc9 Only expose rekey options to ansible-vault command
`ansible-vault` is the only cli command which knows how to handle the
rekey options `--new-vault-id` and `--new-vault-password-file`. No
point in exposing those rekey options to any of the other ansible
commands.

On a practical level I think this matters most in ensuring that
`--help` doesn't produce any false/unhelpful output.

(cherry picked from commit b78ab37a94)
2017-12-07 11:49:44 -05:00
Brian Coca
fcd6731113 report correct file for callback
(cherry picked from commit d850992526)
2017-12-07 11:30:02 -05:00
Toshio Kuratomi
07021a36fe New release v2.4.3.0-0.1.beta1 2017-12-06 13:06:08 -08:00
Jordan Borean
e4c2872b7f updated changelog with win_copy fix 2017-12-07 06:57:18 +10:00
Alexey Shumkin
b9fc9adc44 fixed: win_copy failure from a VirtualBox share to a local path (#33576)
(cherry picked from commit f13656782a)
2017-12-07 06:56:44 +10:00
Toshio Kuratomi
2627b3153e Add nxos fix to changelog 2017-12-06 12:28:11 -08:00
Trishna Guha
4550dbc9dc nxos_vrf_interface fix (#33249)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 7b19c28438)
2017-12-06 12:26:34 -08:00
Brian Coca
f78a60aaa6 ensure quote runs on text
fixes #33260

(cherry picked from commit 65ffb92bff)
2017-12-06 12:17:43 -08:00
Toshio Kuratomi
ef7cea1f89 Update changelog for more bugfixes 2017-12-06 12:17:18 -08:00
Trishna Guha
790e290b6b loopback doesn't support passive_interface (#33252)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 25a465ffcb)
2017-12-06 12:08:10 -08:00
Brian Coca
8b05ac687c correctly document random doc range (#33308)
* correctly document random doc range

fixes #33226

* Edited for clarity.

(cherry picked from commit 08f1d1972e)
2017-12-06 12:04:59 -08:00
Jiri Tyr
de6b3eff4e Unifying wording and formatting of all include and import modules (#31938)
* Unifying wording and formatting of all include and import modules

* Changes based on comments from dharmabumstead

* Removed instances of the term ‘Ansible Engine’

* Removed instances of term ‘Ansible Engine’

* Updated term

* Updated wording

* Updated wording

* Removed the term ‘Ansible Engine’

(cherry picked from commit 283fee90a7)
2017-12-06 12:03:26 -08:00
Toshio Kuratomi
5c8423658a Add changes to changelog 2017-12-06 11:55:05 -08:00
Andreas Olsson
e295a93f07 Add --vault-id support to ansible-pull
Without this additional code snippet `ansible-pull` will still accept
the `--vault-id` option. It just won't pass the option along when
invoking `ansible-pull`.

(cherry picked from commit 7bd54a51e2)
2017-12-06 11:53:19 -08:00
Zbigniew Jędrzejewski-Szmek
d4be600328 Add dnf and yum commands in "Installation" section (#33369)
* Add dnf and yum commands in "Installation" section

Even though the command is very simple, it's good to be able to c&p it.
There were already commands for apt, emerge, pip, even direct installation
from git, so adding Fedora/RHEL/CentOS examples is reasonable.

Since yum is not installed by default on any supported Fedora releases
(F26 and F28 currently), recommend dnf.

* Tiny edit

(cherry picked from commit 4c29396217)
2017-12-06 11:52:40 -08:00
Robert de Bock
cd246d0f45 Update github_release.py (#33390)
Documentation fix. The module "github" does not exist.

(cherry picked from commit 81ea114bff)
2017-12-06 11:50:51 -08:00
Patrick Ogenstad
3608c708ea Fix 'save' parameter in asa_config (#32761)
(cherry picked from commit 53c5e5bf5a)
2017-12-06 11:49:14 -08:00
Martin Krizek
c40dff2108 Add free strategy fix to the changelog 2017-12-06 11:40:10 -08:00
Martin Krizek
ada8453271 Fix include in loop when stategy=free (#33094)
(cherry picked from commit 3a2a1e054f)
2017-12-06 11:40:09 -08:00
Matt Clay
60bf72d69e Limit pytest < 3.3.0 for python 2.6.
(cherry picked from commit 58286ef93b)
2017-12-05 22:27:16 -08:00
Matt Clay
2b9dd23377 Limit paramiko to < 2.4.0 for python 2.6.
(cherry picked from commit 5f5e150771)
2017-12-05 22:27:11 -08:00
Matt Clay
c422d7a8c6 Update FreeBSD completion for ansible-test.
(cherry picked from commit 73132d3906)
2017-12-05 21:32:43 -08:00
Matt Clay
b336c06a42 Update FreeBSD versions used in CI.
(cherry picked from commit 6988d32da2)
2017-12-05 20:41:26 -08:00
Sam Doran
bcbc9fcf31 Update CHANGELOG 2017-11-30 16:19:28 -05:00
Jacek Tomasiak
6a67aee3da Add python level locale handling back (#31339)
locale.setlocale() call removed in 6b5291d68f150c629e9958bb6e910b529b0d8cef
is actually needed by time.strptime(). AnsibleModule() changes both: environment
variables and python level locale settings so both need to be reset.

(cherry picked from commit fd4a6cf7ad)
2017-11-30 16:15:39 -05:00
Martin Krizek
5340da2a7d selinux: check if policy exists before switching (#31834)
* selinux: check if policy exists before switching

* Check the policy dir

(cherry picked from commit 0592fd47bc)
2017-11-30 16:10:36 -05:00
R. Francis Smith
f0741ecaa0 updated pamd rule args regexp to match file paths also (#33432)
* Added . and / to rule args regexp

Things like pam_echo.so file=/etc/foo.txt weren't being matched and
causing incorrect change counts.  Adding / and . fixed that.

Fixes #33351

(cherry picked from commit e957760d52)
2017-11-30 16:02:39 -05:00
Toshio Kuratomi
e3a8bf02ac New release v2.4.2.0-1 2017-11-29 12:18:56 -08:00
Toshio Kuratomi
5d5b5d5a80 Update version info for the 2.4.2 release 2017-11-29 12:08:24 -08:00
Toshio Kuratomi
880cb223b7 New release v2.4.2.0-0.5.rc1 2017-11-22 18:52:54 -08:00
Toshio Kuratomi
f10404335d Add last minute bugfixes and doc updates for rc1 2017-11-22 18:36:01 -08:00
Mike Wiebe
9845e5a018 Use show command to support wider platform set for nxos_interface module (#33037)
* Use show command to support wider platform set

* Fix unit tests

(cherry picked from commit 95a2140f4b)
2017-11-22 18:28:17 -08:00
Strahinja Kustudic
b0e5e108dd Add changes to succeeded/failed tests to the 2.4 porting guide (#33201)
* Add changes to succeeded/failed tests to the 2.4 porting guide

* Edit for grammar and clarity

(cherry picked from commit 673ec2cb78)
2017-11-22 18:27:07 -08:00
Josh Soref
85fa06713d Docs (#32718)
* Windows

* Oxford comma

* defaults to

* periods

* none in see also
* after etc.
* at end of definition
* not doubled

* Ansible

* authenticate

* verifies your

* to configure

* past tense agreement

* Spelling: CoreOS

* only use instead once

* backticks for file path

* not to be

* onward
2017-11-22 14:50:45 -08:00
Matt Clay
5fa8480a61 Use an abspath for network inventory ssh key path.
(cherry picked from commit 1ee511f82c)
2017-11-22 11:11:58 -08:00
Matt Clay
51d21b0f41 Update vyos completion in network.txt.
(cherry picked from commit 3a6fad38fa)
2017-11-22 10:12:04 -08:00
Matt Clay
5866aac64b Use vyos/1.1.8 in CI.
(cherry picked from commit 887f227994)
2017-11-22 10:05:16 -08:00
Brian Coca
689065924a restore hostpattern regex/glob behaviour
they are back to matching both groups and hosts when they are a glob/regex

fixes #32906

(cherry picked from commit e50f931cf3)
2017-11-22 09:34:08 -05:00
Matt Davis
b911186024
Ensure that readonly result members are serialized (#33170)
* fix for breaking metadata change in various Azure Python SDK bits; some members were marked `readonly` for validation, which the default msrest serializer ignores. Added `keep_readonly` flag to serializer call to ensure they're preserved.
(cherry picked from commit 70e351036dfdeb0c862db2e642085a648e23a47f)
2017-11-21 17:21:24 -08:00
Matt Davis
832c8e5f09
removed superfluous type field from RecordSet constructor (#33167)
* fixes breaking change in Azure DNS Python SDK 1.2.0
* no apparent functional change (the arg appears to have been superfluous all along)
(cherry picked from commit 64f4132571164d8a1d4db95b4bed1f5127367c9e)
2017-11-21 14:41:25 -08:00
Toshio Kuratomi
0541c00ef7 Add inventory jsonification to the changelog 2017-11-21 13:56:47 -08:00
Brian Coca
db83d420af jsonify inventory (#32990)
* jsonify inventory
* smarter import, dont pass kwargs where not needed
* added datetime
* Eventual plan for json utilities to migrate to common/json_utils when we split
  basic.py no need to move jsonify to another file now as we'll do that later.
* json_dict_bytes_to_unicode and json_dict_unicode_to_bytes will also
  change names and move to common/text.py at that time (not to json).
  Their purpose is to recursively change the elements of a container
  (dict, list, set, tuple) into text or bytes, not to json encode or
  decode (they could be a generic precursor to that but are not limited
  to that.)
* Reimplement the private _SetEncoder which changes sets and datetimes
  into objects that are json serializable into a private function
  instead.  Functions are more flexible, less overhead, and simpler than
  an object.
* Remove code that handled simplejson-1.5.x and earlier.  Raise an error
  if that's the case instead.
  * We require python-2.6 or better which has the json module builtin to
    the stdlib.  So this is only an issue if the stdlib json has been
    overridden by a third party module and the simplejson on the system
    is 1.5.x or less.  (1.5 was released on 2007-01-18)
(cherry picked from commit ebd08d2a01)
2017-11-21 13:44:51 -08:00
Brian Coca
bc0a0fb99c fix item var in delegation (#32986)
* fix item var in delegation

* fixed task ref

* in case no loop

(cherry picked from commit e19c994f57)
2017-11-21 14:52:18 -05:00
André Althaus
e208a522fe Scan group_vars/host_vars in sorted order
(cherry picked from commit a9b15ce881)
2017-11-21 14:47:39 -05:00
Brian Coca
aa98ffb7a8 make vars only group declarations an error
fixes #32860

(cherry picked from commit 3456bba631)
2017-11-21 14:40:59 -05:00
Brian Coca
36a3388a3a fix typo 2017-11-21 10:59:45 -05:00
Trishna Guha
b0404dbe39
ios_logging: change IOS command pipe to section to include (#33100) (#33116)
This improves compatibility with older IOS devices which do not
support "section" but "include" has been supported for a lot longer.
(cherry picked from commit a6e425e5a3)
2017-11-21 03:35:53 +00:00
Ganesh Nalawade
ecf2dfd6d5
Fix junos integration test fixes as per connection refactor (#33050) (#33055)
(cherry picked from commit ce04f6e961)
2017-11-19 12:24:44 +05:30
Sam Doran
c1d2b4a03f Pass proper error value to to_text (#33030)
(cherry picked from commit 1980c9e773)
2017-11-17 21:32:20 -05:00
Matt Clay
2f1a60ddac Fix and re-enable zypper* integration tests in CI.
(cherry picked from commit 781219bcfd)
2017-11-17 15:14:59 -08:00
andy-pi
9645c43c5e fixed .loads error for non decoded json in Python 3 (#32065)
* fixed .loads error for non decoded json in Python 3

* fixed .loads error Python 3.5 - refactor code to one line

* fixed .loads error python 3.5 - mod to use to_text instead of .decode as per reviewer comment

(cherry picked from commit 67d5e1d3e7)
2017-11-17 14:58:39 -05:00
Ganesh Nalawade
2f6e03956f
Fix ios_config integration test failures (#32959) (#32970)
(cherry picked from commit ba0aade8f4)
2017-11-16 18:38:52 +05:30
Trishna Guha
a890108dac
Integration Tests only: nxos_udld, nxos_udld_interface, nxos_vxlan_vtep_vni (#29143) (#32962)
* it cases for vxlan_vtep_vni, udld

* platform specific testing

* fix vxlan_vtep for n7k

* fix udld_intf setup

* skip udld tests on titanium n7k

* remove hardcoding

* fix udld tests for titanium

(cherry picked from commit aef50eaa40)
2017-11-16 07:47:28 +00:00
Trishna Guha
8398de77b2
Fix nxos_snmp_host bug (#32916) (#32958)
* Fix nxos_snmp_host bug (#32916)

* Fix nxos_snmp_host bug

* Enable nxos_snmp_host tests

(cherry picked from commit 208208ab8f)

* update changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-16 06:22:02 +00:00
Trishna Guha
65192991e5
revert module_utils/nxos change from #32846 (#32956)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-16 04:40:58 +00:00
Jordan Borean
eac4dc46f5 Updated changelog for win_iis_* modules things 2017-11-16 08:59:49 +10:00
Jordan Borean
b059dfe69f removed psobject to hashtables that were missed (#32710)
* removed psobject to hashtables that were missed

* fix up win_region change

(cherry picked from commit 5e20fd0943)
2017-11-16 08:57:27 +10:00
Toshio Kuratomi
6d24fe3d72 New release v2.4.2.0-0.4.beta4 2017-11-15 14:18:40 -08:00
Toshio Kuratomi
42b20ee8eb Fix typo 2017-11-15 13:51:22 -08:00
Matt Clay
2bef683fde Fix ansible-test race calling get_coverage_path.
(cherry picked from commit ef21038dd5)
2017-11-15 12:59:51 -08:00
Matt Clay
c4f61a9db4 Add missing ansible-test --remote-terminate support. (#32918)
* Expand ansible-test --remote-terminate support:

- windows-integration
- network-integration

These commands previously accepted the option, but did not support it.

* Terminate windows and network instances when done.

(cherry picked from commit 6472723ba8)
2017-11-15 12:59:47 -08:00
Adrian Likins
f68330acb2 Fix vault --ask-vault-pass with no tty (#31493)
* Fix vault --ask-vault-pass with no tty

2.4.0 added a check for isatty() that would skip setting up interactive
vault password prompts if not running on a tty.

But... getpass.getpass() will fallback to reading from stdin if
it gets that far without a tty. Since 2.4.0 skipped the interactive
prompts / getpass.getpass() in that case, it would never get a chance
to fall back to stdin.

So if 'echo $VAULT_PASSWORD| ansible-playbook --ask-vault-pass site.yml'
was ran without a tty (ie, from a jenkins job or via the vagrant
ansible provisioner) the 2.4 behavior was different than 2.3. 2.4
would never read the password from stdin, resulting in a vault password
error like:

        ERROR! Attempting to decrypt but no vault secrets found

Fix is just to always call the interactive password prompts based
on getpass.getpass() on --ask-vault-pass or --vault-id @prompt and
let getpass sort it out.

* up test_prompt_no_tty to expect prompt with no tty

We do call the PromptSecret class if there is no tty, but
we are back to expecting it to read from stdin in that case.

* Fix logic for when to auto-prompt vault pass

If --ask-vault-pass is used, then pretty much always
prompt.

If it is not used, then prompt if there are no other
vault ids provided and 'auto_prompt==True'.

Fixes vagrant bug https://github.com/hashicorp/vagrant/issues/9033

Fixes #30993

(cherry picked from commit 86dc3c09ac)
2017-11-15 14:07:39 -05:00
s-hertel
3b9b3b281e Add changelog entry for elb_application_lb fix 2017-11-15 13:59:34 -05:00
Tomaž Šifrer
6f7259df3a Fix: modifying existing application lb using certificates now properly sets certificates (#28217)
(cherry picked from commit 3bd89f8298)
2017-11-15 13:57:36 -05:00
Toshio Kuratomi
466e4eb892 Add changelog for os_floating_ip fix 2017-11-14 11:11:12 -08:00
Sorin Sbarnea
a821a96e53 Avoid AttributeError: internal_network on os_floating_ip (#32887)
Fixes #32884

Change-Id: I3be1dc81266b32dd8f545b743365c2bbc02dfdeb
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
(cherry picked from commit 3fedd88a9f)
2017-11-14 10:45:08 -08:00
Matt Martz
df47cf43a0 Add changelog entry for #32219 2017-11-14 10:55:21 -06:00
Musee Ullah
e2e3ab4d45 Keep newlines when reading LXC container config file (#32219) 2017-11-14 10:47:29 -06:00
Sam Doran
1379e77bf1 Add proper check mode support to the script module (#31852)
* Do not run script in check mode

Fixes #30676

* Reformat script integration test

* Add integration tests for check mode of script module

* Fix name on test

* Cleanup temp file

* win_script integration test syntaxt changes

* Add check mode tests for win_script

* Use proper variable in test

* Fail if source file does not exist

* Verify script is accessible and don't copy in check mode

Use shlex to properly split shell arguments, though a path with spaces in it still needs to be quoted in the playbook.
Add note to docs describing such.
Improve error message if file is not found indicating there may be a space in the path.

* Properly encode path now that path is split using shlex

* Allow for spaces in both path and script name

* Add unicode character test to Linux script tests

* Add Linux test for space in path to script

(cherry picked from commit ea3638b580)
2017-11-14 11:10:25 -05:00
Trishna Guha
545bd41927
multiple nxos fixes (#32905)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 15:23:49 +00:00
Trishna Guha
8b19c1c02d
change inventory_hostname to ansible_host to fix test (#32890) (#32891)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 11de330372)
2017-11-14 10:48:35 +00:00
Ganesh Nalawade
363e605ac4
Change netconf port in testcase as per test enviornment (#32883) (#32889)
(cherry picked from commit c3636108bc)
2017-11-14 15:39:39 +05:30
Trishna Guha
f179adcf2c
fix dci failure nxos (#32877) (#32878)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit ceefeeb279)
2017-11-14 07:21:47 +00:00
Trishna Guha
0a43449391
nxos_config and nxos_facts - fixes for N35 platform. (#32762) (#32875)
* nxos_config and nxos_facts - fixes for N35 platform.  (#32762)

* update nxos_facts to handle errors in n35 platform

* switch show commands to output text

* replace basestring which is not supported in python3

* do it like the other modules: use string_types

* incorporate PR review

(cherry picked from commit 1360ae6518)

* update changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 05:18:53 +00:00
Trishna Guha
4433544eb0
Fix snmp bugs on Nexus 3500 platform (#32773) (#32847)
* Add n35 platform support

* Fix regex bug and add snmp_location it tests

* Enable nxos_snmp_location tests

(cherry picked from commit de8d00b401)
2017-11-13 11:54:12 +00:00
Trishna Guha
4f333eff78
nxos_interface error handling (#32846)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-13 11:42:14 +00:00
Brian Coca
f8415adb17 added note about serial behaviour (#32461)
* added note about serial behaviour
(cherry picked from commit a0c0076cfb)
2017-11-12 14:06:08 -08:00
Toshio Kuratomi
b702687f39 Add the template lookup escaping to the 2.4 porting guide (#32760)
* Add the template lookup escaping to the 2.4 porting guide
(cherry picked from commit faa74a8ccd)
2017-11-12 14:02:03 -08:00
Toshio Kuratomi
52d2245b26 Keywords docs (#32807)
* Fixup keyword dumping

* Clarify introductory text
* Turn links in the keyword description into seealso entries in the rst.

* Have plugin_formatter cleanup trailing whitespace

The indent filter in jinja2 < 2.10 indents blank lines by default which
leads to trailing whitespace.  Cleanup after that filter.

* Edits

* Copy edit

(cherry picked from commit e07cbb033f)
2017-11-10 17:11:28 -08:00
Adrian Likins
29bdd0b326 Better handling of malformed vault data envelope (#32515)
If an embedded vaulted variable ('!vault' in yaml)
had an invalid format, it would eventually cause
an error for seemingly unrelated reasons.
"Invalid" meaning not valid hexlify (extra chars,
non-hex chars, etc).

For ex, if a host_vars file had invalid vault format
variables, on py2, it would cause an error like:

  'ansible.vars.hostvars.HostVars object' has no
  attribute u'broken.example.com'

Depending on where the invalid vault is, it could
also cause "VARIABLE IS NOT DEFINED!". The behavior
can also change if ansible-playbook is py2 or py3.

Root cause is errors from binascii.unhexlify() not
being handled consistently.

Fix is to add a AnsibleVaultFormatError exception and
raise it on any unhexlify() errors and to handle it
properly elsewhere.

Add a _unhexlify() that try/excepts around a binascii.unhexlify()
and raises an AnsibleVaultFormatError on invalid vault data.
This is so the same exception type is always raised for this
case. Previous it was different between py2 and py3.

binascii.unhexlify() raises a binascii.Error if the hexlified
blobs in a vault data blob are invalid.

On py2, binascii.Error is a subclass of Exception.
On py3, binascii.Error is a subclass of TypeError

When decrypting content of vault encrypted variables,
if a binascii.Error is raised it propagates up to
playbook.base.Base.post_validate(). post_validate()
handles exceptions for TypeErrors but not for
base Exception subclasses (like py2 binascii.Error).

* Add a display.warning on vault format errors
* Unit tests for _unhexlify, parse_vaulttext*
* Add intg test cases for invalid vault formats

Fixes #28038

(cherry picked from commit 9c58827410)
2017-11-10 14:31:32 -05:00
Brian Coca
58d37124d9 avoid chroot paths (#32778)
* avoid chroot paths in entity names when loading host_group_vars

fixes #32764

(cherry picked from commit e7941b0d4e)
2017-11-10 13:27:57 -05:00
Ganesh Nalawade
5944a447f7
Fix ios_config file prompt issue (#32744) (#32780)
Fixes #23263

Add a carriage return (\r) at end on copy config
command which results in prompt on cli terminal
(cherry picked from commit 37b0537279)

Update CHANGELOG.md
2017-11-10 20:32:35 +05:30
Ganesh Nalawade
eb4c5936f3
Fix junos netconf port issue in integration test (#32610) (#32668)
(cherry picked from commit 6d1d06e0f7)
2017-11-10 20:32:06 +05:30
Jordan Borean
ac1538ac74 Updated changelog for vmware logon error handling 2017-11-10 16:25:30 +10:00
Abhijeet Kasurde
64f75fc2d3 Add error handling for user login (#32613)
This fix adds additional error handling for vmware connect
method, where username provided user does not have required
permissions to use/login ESXi.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 80967380d3)
2017-11-10 16:23:59 +10:00
Abhijeet Kasurde
80c275a371
Move resource pool login to a separate function and fix undefined var reference (#32674)
(cherry picked from commit 932f62ab57)
2017-11-10 06:20:31 +00:00
Abhijeet Kasurde
65ed70955d
Get the moid in a more failsafe manner (#32671)
(cherry picked from commit eca4897a08)
2017-11-10 06:18:47 +00:00
Abhijeet Kasurde
fa23f30762
vmware_guest: refactor spec serialization (#32681)
* Refactor spec serialization so that native types are evaluated last.
* Remove redundant type checks

Fixes #30818

(cherry picked from commit ada404d0ac)
2017-11-10 01:27:00 +00:00
Jordan Borean
32c1953df0 Updated changelog for win_copy fix 2017-11-10 06:38:57 +10:00
u625030
612d9e04d7 Update win_copy for #32677 (#32682)
* Update win_copy for #32677

enable large zip file support in win_copy

* Update win_copy.py

(cherry picked from commit 6d597ac05a)
2017-11-10 06:36:55 +10:00
Toshio Kuratomi
df04fde6c3 Add the change to when we escape backslashes (for the template lookup plugin) to changelog
This was slated for 2.3.3 but after talking with kustodian we decided it
wasn't appropriate for a minor release.  So 2.4.0 is where it appeared
2017-11-09 10:22:29 -08:00
Toshio Kuratomi
db54b0fb25 New release v2.4.2.0-0.3.beta3 2017-11-08 16:41:38 -08:00
Matt Clay
c994819fcf Changelog entry for script inventory plugin fix. 2017-11-08 10:59:38 -08:00
Chris Meyers
f00f2466d4 tests for InventoryModule error conditions (#31381)
* tests for InventoryModule error conditions

* modified unicode in tests to ahear to Ansible best practices

* flake8 fixes

(cherry picked from commit cf938e9992)
2017-11-08 10:56:19 -08:00
Martin Krizek
95bd052c4e Add changelog entry for the stdin py3 fix 2017-11-08 12:04:24 +01:00
Jan Pazdziora
000df969dc Fix #31694: running with closed stdin on python 3 (#31695)
(cherry picked from commit e5dbf63b65)
2017-11-08 12:02:33 +01:00
Brian Coca
aa54a3510f handle ignore_errors in loop
ensures we get both a templated ignore_errors and a
correct 'summary' result for ignore_errors when used in loops

fixes #32384

(cherry picked from commit d22627d944)
2017-11-07 19:53:18 -05:00
Kevin Zhao
24743e5cdc cherry-pick changes of azure_rm_common from devel to 2.4 (#32607)
* remove explicit provider reg from azure_rm (#31369)

* now that it's handled automatically as of msrest > 0.4.9

* add user-agent to Azure API calls (#31872)

* addi Ansible user-agent in Azure API calls

* fix import error

* add user agent for cloud shell (#32332)
2017-11-07 14:56:09 -08:00
Ryan S. Brown
e9b5e14764 [cloud] sns_topic: Fix unreferenced variable
Cherry-pick of 4e759a9cce
2017-11-07 09:55:26 -05:00
Toshio Kuratomi
f9e16d7072 Added urls python3 fix to changelog 2017-11-06 09:23:17 -08:00
David Hain
97c3037206 Use to_native when validating proxy result (#32596)
* Use bytes directly instead of converting to text
(cherry picked from commit 708829fab9)
2017-11-06 09:22:17 -08:00
Sloane Hertel
793c473fe2 Use region derived from get_aws_connection_info() in dynamodb_table to fix tagging bug (#32557) 2017-11-06 08:49:09 -05:00
Martin Krizek
29cf375157 Add changelog entry for the yum locale fix 2017-11-06 11:32:42 +01:00
Martin Krizek
36bcab8a68 yum: use the C locale when screen scraping (#32203)
(cherry picked from commit a8ab1a0b20)
2017-11-06 11:31:32 +01:00
Martin Krizek
274503991e Add changelog entry for git archive fix 2017-11-06 11:30:52 +01:00
Martin Krizek
d8bfed678c git: fix archive when update is set to no (#31829)
(cherry picked from commit e3a847a142)
2017-11-06 11:28:46 +01:00
Toshio Kuratomi
0796190053 Prefer the stdlib SSLContext over urllib3 context
We do not go through the effort of finding the right PROTOCOL setting if
we have SSLContext in the stdlib.  So we do not want to hit the code
that uses PROTOCOL to set the urllib3-provided ssl context when
SSLContext is available.  Also, the urllib3 implementation appears to
have a bug in some recent versions.  Preferring the stdlib version will
work around that for those with Python-2.7.9+ as well.

Fixes #26235
Fixes #25402
Fixes #31998

(cherry picked from commit 725ae96e1b)
2017-11-04 13:11:45 -07:00
patlachance
309dbecbc7 iam.py: return iam.role dict when creating roles (#28964)
(cherry picked from commit 45e35be4c1)
2017-11-03 10:07:21 -04:00
Dmitry Marakasov
20764e248e Documentation typo fixes (#32473)
(cherry picked from commit 843fba509f)
2017-11-02 19:40:09 -07:00
Toshio Kuratomi
0617ac1f24 Add changelog entry for inventory nonascii paths fix 2017-11-02 19:32:12 -07:00
Toshio Kuratomi
07fa571502 Fix non-ascii errors in config manager
(cherry picked from commit d166bba126)
2017-11-02 19:32:12 -07:00
Jordan Borean
f76e8a8e39 Updated changelog regarding win_service quoted path fix 2017-11-03 09:57:04 +10:00
Jordan Borean
e771b64f1b win_service: quoted path fix (#32469)
* win_service: fix for path in quotes

* Added tests to verify behaviour doesn't regress

(cherry picked from commit 5b1db00b65)
2017-11-03 09:56:08 +10:00
Matt Davis
82c2da31be lock azure containerservice to below 2.0.0
* supersedes/fixes #32518
* only for 2.4.x - we'll make the necessary code changes for 2.5 to work with the updated version
2017-11-02 16:34:29 -07:00
Brian Coca
07674f5062 ini plugin should recursively instantiate pending
solves inconsistent behaviour on ini host format depending on definition order
fixes #32196

(cherry picked from commit 9d28973b5e)
2017-11-02 17:58:19 -04:00
Ondra Machacek
dd930344b6 ovirt_hosts: Don't fail upgrade when NON_RESPONSIVE state 2017-11-02 14:40:31 -04:00
Ondra Machacek
3df921a14a ovirt_clusters: Fix fencing and kuma comparision 2017-11-02 14:37:19 -04:00
Ondra Machacek
dd19f96561 ovirt_host_networks: Fix label assignment 2017-11-02 14:34:39 -04:00
Brian Coca
fa289a022c correctly deal with changed (#31812)
(cherry picked from commit 21cdddce74)
2017-11-02 12:31:52 -04:00
Pilou
35d942d6a0 Fix include_role unit tests (#31920)
* Ensure include_role unit tests check something

This is not the case: get_tasks_vars doesn't yield

* Fix include_role unit tests

Since e609618274, include_role are not
static anymore.

(cherry picked from commit 43914b3837)
2017-11-02 08:39:32 -07:00
u571kills
0140372d0f Fix example on comparing master config (#32406)
Current example produces error message:

"msg": "Unsupported parameters for (ios_config) module: diff_config Supported parameters include: after,auth_pass,authorize,backup,before,defaults,diff_against,diff_ignore_lines,force,host,intended_config,lines,match,multiline_delimiter,parents,password,port,provider,replace,running_config,save,save_when,src,ssh_keyfile,timeout,username"
(cherry picked from commit 869cf3fbdb)
2017-11-01 17:44:01 -07:00
Jordan Borean
b2f3dc9052 updated changelog with win_find fix 2017-11-02 09:38:27 +10:00
Jordan Borean
6a7333950a win_find: allow module to skip on files it fails to check (#32105)
* win_find: allow module to skip on files it fails to check

* fixed up test creation to work pre psv5

(cherry picked from commit 56a7278256)
2017-11-02 09:36:53 +10:00
Toshio Kuratomi
6f2876f49c New release v2.4.2.0-0.2.beta2 2017-11-01 13:51:37 -07:00
Brian Coca
b2cef41bcd added doc notes about vars plugins in precedence
(cherry picked from commit 52c97a1cf4)
2017-11-01 11:42:48 -07:00
Ganesh Nalawade
5bbf70afe1
Fixes #31090. In network parse_cli filter plugin, this change moves the creation of a (#31092) (#32458)
new match(block). It previously only occurred if a new match occurred,
but suggest it should occur when an end of a block match is found.
(cherry picked from commit 7553c42e09)

Update CHANGELOG
2017-11-01 23:46:14 +05:30
Ganesh Nalawade
bc01b5d981
eos_eapi: adding the desired state config to the new vrf fixes #32111 (#32112) (#32452)
* adding the desired state config to the new vrf fixes #32111

* fix default vrf initial configured

* add unit test

* Update CHANGELOG

(cherry picked from commit 2c99cbc874)
2017-11-01 23:02:51 +05:30
Ganesh Nalawade
b8ee3bb24f
Fix wrong prompt issue for network modules (#32426) (#32442)
* Fix wrong prompt issue for network moodules

Fixes #31161
Fixes #32416

*  Store the device prompt in case of error
   from remote device
*  Check for prompt value in ios action plugin

*  Add integration test
*  Update Changelog

(cherry picked from commit 26583adb58)
2017-11-01 22:35:47 +05:30
Trishna Guha
ee210e4d5b
Add ios_logging fixes to changelog 2.4.2beta2 (#32447)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-01 21:32:28 +05:30
Toshio Kuratomi
fd477a9c25 Add azure_rm_acs check mode fix 2017-11-01 08:59:43 -07:00
Yawei Wang
0faa72e8c4 add check mode for acs delete (#32063)
(cherry picked from commit d7c8fdbd79)
2017-11-01 08:58:28 -07:00
Kedar K
cc0a18e5bd Fixes ios_logging unit test (#32240)
(cherry picked from commit 2aae66fa07)
2017-11-01 08:55:01 -07:00
Kedar K
ac1c7b03ff - Fix logging module issue where facility is being deleted along with host (#32234)
- Remove default facility, as facility is not standard on remote syslog server
(cherry picked from commit 7d5dccefe5)
2017-11-01 08:54:33 -07:00
Paul Neumann
ebd559c43a ios_system: Fix typo in unit test (#32284)
(cherry picked from commit 87f663b950)
2017-11-01 08:54:07 -07:00
Paul Neumann
de60b9e1a8 ios_logging: Fix some smaller issues, add unit test (#32321)
* ios_logging: Fix typo in documentation

* ios_logging: Fix traceback when setting buffered destination without size

When the size parameter is not configured while configuring the buffered
destination, a traceback occurs due to the fact that validate_size expects the
parameter to be an int. Explicitely converting value to int makes the
check work for every case.

* ios_logging: Update size parameter documentation

Update the documentation of the size paramter to reflect the current behaviour
of setting a default of 4096 for the buffered dest.

* ios_logging: Add unit test

Add unit test for ios_logging testing the behaviour clarified in the previous
commits.

* ios_logging: Fix python 2.6 compliance

(cherry picked from commit 53fead7c96)
2017-11-01 08:53:39 -07:00
saichint
7967b75980 Integration Tests only: add static route, snmp_user, snapshot and hsrp it cases (#28933)
* add static route and hsrp it cases

* add snmp_user and snapshot it

* password strength correction

* fix typo

* add compare snapshot as it is fixed in the code now

* skip snapshot tests for titanium

* titanium and nxapi conditions added

(cherry picked from commit c822292347)
2017-11-01 08:53:11 -07:00
Toshio Kuratomi
6721c53925 Add max_fail_percentage fix to changelog 2017-11-01 08:47:17 -07:00
Brian Coca
9233ece224 calculate max fail against all hosts in batch
currently it is doing only from the 'active' hosts in the batch which means
the percentage goes up as hosts fail instead of staying the same.
added debug info for max fail

fixes #32255

(cherry picked from commit 4fb9e54c50)
2017-11-01 08:46:15 -07:00
Toshio Kuratomi
e40149bb1a Clarify the release and maintenance cycle (#32402)
* Clarify the release and maintenance cycle
* Namespace refs a little
(cherry picked from commit 42655f737a)
2017-10-31 22:13:36 -07:00
Ganesh Nalawade
8c1dfdbc31
Move asa provider to suboptions (#32356)
Fixes #32343

* Move provider arg spec as part of suboptions
  to validate input args against provider spec.
* This handles `no_log` for password arg correctly.

Merged to devel PR #28984

( cherry picked from commit 599fe23ed6 )
2017-11-01 09:16:53 +05:30
Matt Davis
8ae0079ef7 luseradd defaults to creating w/o need for -m (#32411)
and -M is incorrect in this case

(cherry picked from commit 3e80f9caf4)
2017-10-31 14:37:22 -07:00
Brian Coca
5398d653ca corrected package docs
(cherry picked from commit 43714a0091)
2017-10-31 16:39:05 -04:00
Brian Coca
f79cd6c846 adjust nohome param when using luser
fixes #32199

(cherry picked from commit bd321a0af6)
2017-10-31 16:37:10 -04:00
Trishna Guha
0711f41e3d
ios_interface testfix (#32381)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-10-31 16:39:04 +05:30
Trishna Guha
618b4999fb
fix CI failure yaml syntax (#32374)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-10-31 12:45:14 +05:30
Trishna Guha
cb696ba112
Handle ip name-server lines containing multiple nameservers (#32235) (#32373)
In CSR, multiple nameservers are defined in one line, whereas on IOS
it's on multiple ones.
This change handles both.
(cherry picked from commit 80c8b99a62)
2017-10-31 12:06:49 +05:30
Trishna Guha
8453398dd4
fix ios_interface test (#32372)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-10-31 11:58:22 +05:30
Matt Martz
071f86afc6 Fix patching to epel package
(cherry picked from commit be9cc70b74)
2017-10-30 14:40:23 -07:00
Brian Coca
34d7f9e3db remove misleading group vars as they are flat (#32276)
* remove misleading group vars as they are flat

* fixed vars display

(cherry picked from commit 75a6f9dbc2)
2017-10-30 13:00:03 -04:00
Brian Coca
3cf7e31c4e ensure we always have a basedir
(cherry picked from commit 64220fcbcc)
2017-10-30 12:29:15 -04:00
Trishna Guha
497c73d06e
iosxr integration testfix (#32344)
* Replace GigabitEthernet0/0/0/5 for GigabitEthernet0/0/0/2 in iosxr_interface intent tests (#32116)

There's no 5 interface present in CI nodes.
(cherry picked from commit f079a33563)

* Replace Gigabit0/0/0/2 for Gigabit0/0/0/1 on iosxr_interface.intent (#32120)

(cherry picked from commit a9d8157e81)

* Add ansible_ssh_port to iosxr_user auth tests (#32117)

The CI nodes listen on port 8022, we need to plumb that to avoid
test failures.
(cherry picked from commit 676d446cfc)
2017-10-30 19:24:48 +05:30
Trishna Guha
262d6b6dcc
ios_ping test fix (#32342)
* Introspect the management IP on ios_ping (#31571)

On our CI we don't have external connectivity, so let's ping to
the management interface IP.
Also, ignore errors on the expected failures tests.
(cherry picked from commit c75c4cbfc8)

* Remove duped authorize on ios_ping anchored tasks (#31572)

Otherwise, we get warnings.
(cherry picked from commit ac95ecaf13)

* Introspect platform before running ios tests

* Add authorize

* Fix quotes on ios_ping test (#32131)

(cherry picked from commit ca115b0a8e)

* Fix lookup source tests on ios_system (#32254)

In IOS-XE, you need to pass an interface to lookup-source, otherwise
it fails with bad syntax.
(cherry picked from commit 4b35793f62)

* Remove ip nameservers on ios_system/set_name_servers teardown (#32239)

Not sure why lookup source-interface, the only thing tested on that
file is adding/removing name servers, no lookup is set.
(cherry picked from commit 9752ce368d)

* fix conflict

* Update CHANGELOG

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-10-30 19:17:16 +05:30
Trishna Guha
2c4cb42337
ios_interface provider issue testfix (#32335)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-10-30 11:55:55 +05:30
Toshio Kuratomi
4b94ea8075 Add galaxy --force fix to changelog 2017-10-28 07:31:18 -07:00
Toshio Kuratomi
fdcb419c8d Revert "Removed a force conditional (#28851)" (#32282)
This reverts commit 07acc579db.

On closer examination of this code, the conditional that had force in it
was not a parent of this one.  So handling of force is needed i both
branches.

See the recent comments on #23391
(cherry picked from commit 2e12a5f8c2)
2017-10-28 07:29:54 -07:00
Trishna Guha
b6c117ebdd
eos_user testfix (#32264)
* Fix eos_user tests (#32261)

(cherry picked from commit be821845e2)

* Add eos_user testfix to CHANGELOG

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-10-27 22:04:25 +05:30
Trishna Guha
e2065dc68c Remove provider from ios integration test (#31037) (#32230)
* Remove provider from  ios integration test (#31037)

*  Remove provider from each task as it is not required.
*  Add `authorize: yes` whereever required
(cherry picked from commit 65ab37cbd3)

* CHANGELOG entry for ios tests fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-10-27 11:49:40 +05:30
Jordan Borean
b65496eece Changelog win_package TLS fix 2017-10-27 12:11:26 +10:00
Benjamin Schweizer
1e318f6224 Enable TLS1.1 and TLS1.2 for win_package (#32184)
(cherry picked from commit f2023a84a6)
2017-10-27 12:04:31 +10:00
Toshio Kuratomi
c495103996 New release v2.4.2.0-0.1.beta1 2017-10-26 17:00:44 -07:00
awkspace
124b3dce50 Fix ec2_lc failing to create multi-volume configurations (#32191) 2017-10-27 09:08:57 +10:00
Sloane Hertel
2a42800c44 An availability zone will be selected if none is provided. Set az to an empty string if it's None to avoid traceback. (#32216) 2017-10-27 09:07:19 +10:00
Ryan S. Brown
56efcb1b72 Changelog entry for aws_s3 issue #32144 2017-10-26 18:33:14 -04:00
Ryan Brown
a0c123a86e [cloud] Bugfix for aws_s3 empty directory creation (#32198)
* [cloud] Bugfix for aws_s3 empty directory creation

Backport of #32169

* Only make DeleteObject call if there are objects to delete

* Remove pauses from integration tests
2017-10-26 15:04:00 -04:00
Matt Clay
dc90280b8f Disable pylint rules for stable-2.4.
ci_complete
2017-10-26 12:00:57 -07:00
Matt Clay
8d91a6d72e Update ansible-test sanity command. (#31958)
* Use correct pip version in ansible-test.
* Add git fallback for validate-modules.
* Run sanity tests in a docker container.
* Use correct python version for sanity tests.
* Pin docker completion images and add default.
* Split pylint execution into multiple contexts.
* Only test .py files in use-argspec-type-path test.
* Accept identical python interpeter name or binary.
* Switch cloud tests to default container.
* Remove unused extras from pip install.
* Filter out empty pip commands.
* Don't force running of pip list.
* Support delegation for windows and network tests.
* Fix ansible-test python version usage.
* Fix ansible-test python version skipping.
* Use absolute path for log in ansible-test.
* Run vyos_command test on python 3.
* Fix windows/network instance persistence.
* Add `test/cache` dir to classification.
* Enable more python versions for network tests.
* Fix cs_router test.

(cherry picked from commit cf1337ca9a)
2017-10-26 12:00:57 -07:00
Matt Clay
29b50d99c7 Add missing packages to default docker image.
(cherry picked from commit 5663d11b94)
2017-10-26 12:00:57 -07:00
Matt Clay
4978fc633c Fix ansible-test default image. (#31966)
* Add openssh-client to default docker container.
* Include Azure requirements in default container.

To do so, handling of pip requirements was updated to install each
set of requirements separately and then run a verification pass to
make sure there are no conflicts between requirements.

* Add missing --docker-no-pull option.
* Add documentation for the azure-requirements test.

(cherry picked from commit 36b13e3e3d)
2017-10-26 12:00:57 -07:00
Matt Clay
0483401339 Add new default Docker container for ansible-test. (#31944)
* Add new default Docker container for ansible-test.
* Update ansible-test change classification.
* Update list of disabled pylint rules.
* Fix pylint issues with ansible-test.

(cherry picked from commit f76afab6e5)
2017-10-26 12:00:57 -07:00
Matt Clay
dbe3a44a46 Improve python 2/3 ABC fallback for pylint. (#31848)
* Improve python 2/3 ABC fallback for pylint.
* Allow longer method names in ansible-test.

(cherry picked from commit 6c3339402a)
2017-10-26 12:00:57 -07:00
Sam Doran
bb7977c5b4 Return all elements in a more robust way
If a trailing ':' is set or not, always return all secrets from a path.

Update examples.

(cherry picked from commit 6a6ea663ea)
2017-10-26 14:50:26 -04:00
Sam Doran
4a8ffe56a9 Enable ECHO in prompt module (#32083)
* Enable ECHO in prompt module

Fixes #14160

* Set flags to make it possible to edit echoed input as well as hide control charcters

Only do this if a time limit is not set.

* Consolidate settings

(cherry picked from commit 104934c095)
2017-10-26 12:39:53 -04:00
Toshio Kuratomi
88e7bb3e28 Add elb_target_group port fix to the changelog 2017-10-26 09:37:10 -07:00
Marc Mercer
10d6e1be90 Cast target port to an int in elb_target_group. Fixes #32098 (#32202)
(cherry picked from commit 17a008654a)
2017-10-26 09:35:43 -07:00
Trishna Guha
caa3a3618b Add networking bug fixes to changelog (#32201)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-10-26 20:30:45 +05:30
Toshio Kuratomi
49a7c3f2f1 Add eos_user fix to changelog 2017-10-26 07:43:19 -07:00
Dave Thelen
2340c7ac6e eos_user: sends user secret first on user creation fixes #31680 (#32162)
* fix command order

* add integration test

* test cleanup

* remove redudant commands

(cherry picked from commit 602a618e60)
2017-10-26 07:43:19 -07:00
rahushen
541d5db97a NXOS: Integration tests to Ansible (part 3) (#29030)
* Add nxos_file_copy IT

* Restructure nxos_igmp tests

* add nxos_igmp_interface IT

* add nxos_igmp_snooping IT

* add nxos_ntp_auth IT

* Add nxos_ntp_options IT

* update nxos.yaml with new tests

* update nxos_ntp_options test

* update nxos_ntp_auth IT

(cherry picked from commit ab84718a01)
2017-10-26 07:38:23 -07:00
Trishna Guha
6d4d2d88b4 fix nxos_igmp_snooping (#31688)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 529b7a7b78)
2017-10-26 07:38:23 -07:00
Kedar K
70c3aefdaf - Fix to return error message back to the module. (#31035)
(cherry picked from commit 916e6be888)
2017-10-26 07:38:23 -07:00
rahushen
a69f93f4f5 Fixes #31056 (#31057)
(cherry picked from commit 046d430a26)
2017-10-26 07:38:23 -07:00
Ganesh Nalawade
bc12de27dd Remove provider from prepare_ios_tests integration test (#31038)
(cherry picked from commit b86eea9a52)
2017-10-26 07:38:23 -07:00
rahushen
0aa015de5e change ports to non well known ports and drop time_range for N1 (#31261)
(cherry picked from commit c976ac7ed6)
2017-10-26 07:38:23 -07:00
rahushen
f2e8339467 Fix nxos_banner removal idempotence issue in N1 images (#31259)
* Fix nxos_banner removal idempotence issue in N1 images

* handle pep8 error

(cherry picked from commit 025386c56b)
2017-10-26 07:38:23 -07:00
Prasad Katti
a59eede7a2 [cloud] add boto3 requirement to cloudformation module docs (#31135) 2017-10-26 07:37:47 -07:00
tedder
f29285b4b5 Exclude stack policy when running in check mode.
Fixes #31931
2017-10-26 07:37:47 -07:00
Samprita Hegde
cd854c1d2b [cloud] Support changeset_name parameter on CloudFormation stack create (#31436) 2017-10-26 07:37:47 -07:00
Toshio Kuratomi
2c4104be9e Add more bugfixes to changelog 2017-10-26 07:32:34 -07:00
otteydw
52f58e4bbd Add a validate example to blockinfile. (#32088)
(cherry picked from commit d2cb676c4c)
2017-10-26 07:32:34 -07:00
Sebastien Boyron
d5df56d4fc [fix] issue #30516 : take care about autoremove in upgrade function
(cherry picked from commit af3e8950d6)
2017-10-26 07:32:33 -07:00
John R Barker
5288ccd1f6 Correct formatting --arguments (#31808)
* Correct formatting

* Use RST :option:

* ansible-pull --vault-password-file

* Streamlined the language a bit in the intro.

* Exclamation point removal!

(cherry picked from commit 1d86205933)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
49d9960974 Add changelog entries for a myriad of 2.4.2 bugfixes 2017-10-26 07:32:33 -07:00
Morgan Kesler
8e97f33b88 Remove toLower on source (#31983)
Having this here breaks any source URLs that require case sensitivity.
(cherry picked from commit ed342e8ce3)
2017-10-26 07:32:33 -07:00
Brian Coca
2f71772a28 fix inventory loading for ansible-doc
fixes #31995

(cherry picked from commit 90e8071d48)
2017-10-26 07:32:33 -07:00
Sam Doran
2f30de35ba Add ansible_distribution_major_version to macOS (#31708)
(cherry picked from commit 4dce9dc796)
2017-10-26 07:32:33 -07:00
Martin Krizek
66b5e6bf7d ini inventory: document value parsing workaround
Fixes #31656

(cherry picked from commit 4bd16216fe)
2017-10-26 07:32:33 -07:00
Brian Coca
d651bcbc06 validate that existing dest is valid directory
(cherry picked from commit 83dec70ad8)
2017-10-26 07:32:33 -07:00
Brian Coca
c73543ef8d dont add all group vars to implicit on create
they already get added in vars manager on use.
fixes #31420

(cherry picked from commit 383170e9e1)
2017-10-26 07:32:33 -07:00
Peter Sprygada
bd624837fa inserts enable cmd hash with auth_pass used (#32107)
eapi transport was not passing the auth_pass to the remote device with
it was provided.  this fix will now insert the correct command hash into
the jsonrpc request.

fixes #30802
(cherry picked from commit 1af72afdef)
2017-10-26 07:32:33 -07:00
Adam Miller
e7d8685643 firewalld: don't reference undefined variable in error case (#31949)
* firewalld: don't reference undefined variable in error case

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>

* firewalld: don't set exception as var and not use it

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>
(cherry picked from commit 5b7d161b10)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
28a3679040 More fixes added to changelog 2017-10-26 07:32:33 -07:00
Adrian Likins
e50a51751b Fix service_mgr fact collection (#32086)
The platform/distro/etc facts were being passed in
correctly, but service_mgr.py was looking up the
wrong names ('system' vs 'ansible_system') resulting
in service_mgr falling back to default 'service' result.

Fixes #30753, #31095
(cherry picked from commit 6203e899f0)
2017-10-26 07:32:33 -07:00
Brian Coca
fa2a18a740 make sure patterns are strings
fixes #31978

(cherry picked from commit ab8bacdf5e)
2017-10-26 07:32:33 -07:00
Brian Coca
265652212d Avoid default inventory proccessing for pull (#32135)
* Avoid default inventory proccessing for pull

- now pull's own special inventory processing should work correctly
- also removed ineffective set_defaults

fixes #31449

* use class property instead

* only do localhost for adhoc

(cherry picked from commit aad5d1432583c4aa4105b774f38c80498e85de59)

(cherry picked from commit ca71a50459)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
98c942f0d9 Add changelog for URI/get_url fix 2017-10-26 07:32:33 -07:00
Toshio Kuratomi
eddb4fc25d Add new documentation on writing unittests to the changelog 2017-10-26 07:32:33 -07:00
mikedlr
b22a580e66 Mdd module unit test docs (#31373)
* new documentation for unit testing - especially module unit testing

* unit test documentation reformatting and further fixes

* unit test documentation - point to online coverage reports & fix bad spaces

* Small copy edits.

* First pass copy edit / rewrite. More info needed.

* testing documentation - clean up structure, especially code coverage - reduce repetition

* module unit test documentation - improved introduction

* testing documentation - more fixes from and inspired by review from dharmabumstead

* testing documentation - fixes from mattclay + some other minor tweaks

* More copy edits.

* testing documentation - further fixes from review

* Copy edits

* Copy edits

* More copy edits.

(cherry picked from commit fbbffbabde)
2017-10-26 07:32:33 -07:00
Matt Clay
8d997e9836 Run OS X tests in 3 groups in CI.
(cherry picked from commit b44c38930b)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
f1384b5598 Add ansible_shell_executable fix to changelog 2017-10-26 07:32:33 -07:00
Brian Coca
0e13202f3e use configured ansible_shell_executable
refine args/shell/executable hanlding

(cherry picked from commit f2ade09dce)
2017-10-26 07:32:33 -07:00
Jerry Chong
47aa292c3b Fix exception upon display.warn() (#31876)
Fixes #31875
(cherry picked from commit 567e989581)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
38c3da5ffd Bunch of changelog updates for cherry-picks 2017-10-26 07:32:33 -07:00
Brian Coca
2b862381db warn on bad keys in group
(cherry picked from commit 1bf09a7d84)
2017-10-26 07:32:33 -07:00
Brian Coca
b61bfc87b8 better cleanup on task results display (#27175)
* better cleanup on task results display

callbacks get 'clean' copy of result objects
moved cleanup into result object itself
removed now redundant callback cleanup
moved no_log tests

* moved import as per feedback

(cherry picked from commit 01b6c7c9c6)
2017-10-26 07:32:33 -07:00
Brian Coca
11313699ab py2/py3 safer shas on hostvars (#31788)
* py2/py3 safer shas on hostvars

* plain bytes

(cherry picked from commit 68f177d381)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
bbb2563e0d Add k8s_common.py logging fixes to the changelog 2017-10-26 07:32:33 -07:00
Brian Coca
8c7ab621c9 move to use ansible logging
(cherry picked from commit 07f1e7540b)
2017-10-26 07:32:33 -07:00
Fabian von Feilitzsch
dafc90c146 Update k8s_common.py
(cherry picked from commit b058b8e653)
2017-10-26 07:32:33 -07:00
Fabian von Feilitzsch
20173ab441 use to_str instead of json.dumps when serializing k8s object for logging
(cherry picked from commit 20d2a83e13)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
4528313a48 Add python3 urllib fixes to changelog 2017-10-26 07:32:33 -07:00
François Scala
5b1d502c58 Fix urlparse import for Python3 (#31240)
* Fix urlparse import for Python3 in

* contrib/inventory/consul_io.py
* contrib/inventory/rudder.py
* contrib/inventory/windows_azure.py
* lib/ansible/module_utils/known_hosts.py
* lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py
* lib/ansible/modules/cloud/docker/_docker.py
* lib/ansible/modules/cloud/ovirt/ovirt_disk.py
* lib/ansible/plugins/action/ce_template.py

(cherry picked from commit aade5234a9)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
374b2d1374 Add wait_for fix to the changelog 2017-10-26 07:32:33 -07:00
sethp-nr
a78c39df87 wait_for: treat broken connections as "unready" (#28839)
* wait_for: treat broken connections as "unready"

We have observed the following condition while waiting for hosts:

```
Traceback (most recent call last):
  File "/var/folders/f8/23xp00654plcv2b2tcc028680000gn/T/ansible_8hxm4_/ansible_module_wait_for.py", line 585, in <module>
    main()
  File "/var/folders/f8/23xp00654plcv2b2tcc028680000gn/T/ansible_8hxm4_/ansible_module_wait_for.py", line 535, in main
    s.shutdown(socket.SHUT_RDWR)
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 57] Socket is not connected
```

This appears to happen while the host is still starting; we believe something is
accepting our connection but immediately resetting it. In these cases, we'd
prefer to continue waiting instead of immediately failing the play.

This patch has been applied locally for some time, and we have seen no adverse
effects.

* wait_for: fixup change

We were missing an import and a space after the `#`

(cherry picked from commit 402b095841)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
fde6ff7547 Add remove host fix to changelog 2017-10-26 07:32:33 -07:00
Brian Coca
09437909e6 remove hosts from removed when rescuing
fixes #31707

(cherry picked from commit 618627febd)
2017-10-26 07:32:33 -07:00
Toshio Kuratomi
2402f1f5b7 Add spec file fix to changelog 2017-10-26 07:32:32 -07:00
fantashley
06e0c3c8ee Make RPM spec compatible with RHEL 6 (#31653)
* Make RPM spec compatible with RHEL 6

* Define __python2 macro only when undefined

(cherry picked from commit 2087dc7384)
2017-10-26 07:32:32 -07:00
Toshio Kuratomi
8800111f5e Add panos_security_rule docs typo fix to changelog 2017-10-26 07:32:32 -07:00
Brian Coca
01110d75ea fix html formatting
(cherry picked from commit c0fc797a06)
2017-10-26 07:32:32 -07:00
Toshio Kuratomi
67d431a541 Update the release data for 2.4.1 in the changelog 2017-10-25 17:48:14 -07:00
Toshio Kuratomi
e946c4b3b7 New release v2.4.1.0-1 2017-10-25 13:33:18 -07:00
Toshio Kuratomi
5a678367d8 reverse order of release numbers
(cherry picked from commit d7d1402bb7)
2017-10-25 13:24:24 -07:00
Toshio Kuratomi
a5057519dd Update release and maint for new release
(cherry picked from commit cf2c22770a)
2017-10-25 12:53:06 -07:00
Toshio Kuratomi
dba43ff3d5 Update packaging versions.yml with the info from the devel branch 2017-10-25 12:42:52 -07:00
Toshio Kuratomi
5e9054655e Add date for the 2.4.1 release 2017-10-25 12:39:47 -07:00
Toshio Kuratomi
f8fa79818c Revert "Prefer the stdlib SSLContext over urllib3 context"
This reverts commit f48af16ddc.

Meant to push to 2.4.2
2017-10-24 07:32:33 -07:00
Toshio Kuratomi
f48af16ddc Prefer the stdlib SSLContext over urllib3 context
We do not go through the effort of finding the right PROTOCOL setting if
we have SSLContext in the stdlib.  So we do not want to hit the code
that uses PROTOCOL to set the urllib3-provided ssl context when
SSLContext is available.  Also, the urllib3 implementation appears to
have a bug in some recent versions.  Preferring the stdlib version will
work around that for those with Python-2.7.9+ as well.

Fixes #26235
Fixes #25402
Fixes #31998

(cherry picked from commit 725ae96e1b)
2017-10-24 07:31:12 -07:00
Toshio Kuratomi
4a4590a2c6 New release v2.4.1.0-0.4.rc2 2017-10-18 14:47:16 -07:00
Matt Clay
3f4005038d Fix docker_secret integration test dependencies.
(cherry picked from commit eb899c9bcd)
2017-10-18 14:37:33 -07:00
Toshio Kuratomi
d32f138f40 Fix for hostname module on RHEL7.5 added to changelog 2017-10-18 14:27:01 -07:00
Martin Krizek
7a23162ae4 hostname: fix for a new version of rhel (#31839)
Fixes #31811
(cherry picked from commit efec43dd1e)
2017-10-18 14:24:17 -07:00
Toshio Kuratomi
05535b363f Add changelog for cherry-picks 2017-10-18 14:20:32 -07:00
Ilya Margolin
13adf5dc16 Fix -M/--module-path option for ansible-doc and ansible-console (#31744)
Fixes #31743
(cherry picked from commit 9bc60cd05e)
2017-10-18 14:20:05 -07:00
Brian Coca
d7e3665f3f fix closure issues
fixes #31786

(cherry picked from commit a26a2841ff)
2017-10-18 14:16:42 -07:00
Abhijeet Kasurde
7e6554b9ff Correct usage for shutil.rmtree (#31541)
* Correct usage for shutil.rmtree

Fix adds correct usage of shutil.rmtree in git module

Fixes: #31225

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Include archive tests so they get run

* Use new include syntax

* Cleanup syntax on git tests

- use multi-line YAML
- remove unneeded {{ }} around vars in conditionals
- remove unneeded quotes
- add task file name to task names for easier troubleshooting when things fail

* Make archive tests work for RHEL/CentOS 6

The older versions of Jinja2 in RHEL/CentOS 6 required assertion tasks using the map filter to be skipped.

The older version of git required gzip compression to be skipped on RHEL/CentOS 6.

* Account for ansible_distribution_major_version missing

(cherry picked from commit a047fe0e4c)
2017-10-18 14:14:24 -07:00
Toshio Kuratomi
c7504d9d2f Add win_regedit fixes 2017-10-18 14:10:13 -07:00
Jordan Borean
466baba040 win_regedit: fix extra info coming into stdout (#31813)
(cherry picked from commit 888de842b3)
2017-10-18 14:09:18 -07:00
Zubair Lutfullah Kakakhel
5f8a126d35 vmware_vm_facts: Add error check for config.vm (#31629)
Add a simple check to see if vm.config exists before looking for
vm.config.hardware
(cherry picked from commit 4034630625)
2017-10-18 14:07:14 -07:00
Sam Doran
0afc3ae3ed Ensure valid_plugin_bin is defined
Fixes #31824

(cherry picked from commit 2c8382eb87)
2017-10-18 14:05:23 -07:00
Toshio Kuratomi
a40a8c4a6e Add the documentation of backup_path to changelog 2017-10-18 14:04:27 -07:00
John R Barker
df85dc55fb Document backup_path (#31844)
Fix a few consistency issues at the same time
(cherry picked from commit 598084fbc8)
2017-10-18 14:03:27 -07:00
Toshio Kuratomi
e665b2ed5e Remove the change for implicit inventory and all vars 2017-10-18 13:59:35 -07:00
Brian Coca
d36c582787 add all group vars back to implicit localhost
fixes #31857
reverts #31425

(cherry picked from commit 7fe6a8dab7)
2017-10-18 13:58:29 -07:00
Matt Clay
5d2f07aebb Multiple Parallels host support for ansible-test. (#31552)
(cherry picked from commit 05ec376197)
2017-10-12 11:56:48 -07:00
Toshio Kuratomi
48fe112455 Since these changes went in after rc1, be sure to document them in the changelog
Normally I wouldn't mention test infrastructure fixes i nthe changelog
but since they're going in after rc1, I'm going to mention them just to
be safe.
2017-10-12 07:37:39 -07:00
Matt Clay
e8d4667b87 Remove cryptography install from CI other test.
(cherry picked from commit 03e18aa52e)
2017-10-12 07:36:07 -07:00
Toshio Kuratomi
de458be1eb New release v2.4.1.0-0.3.rc1 2017-10-11 20:19:43 -07:00
Matt Clay
78cb32ccb7 Update Azure tests to limit cryptography version. (#31616)
(cherry picked from commit 8acb901bf2)
2017-10-11 19:19:21 -07:00
Toshio Kuratomi
0743b577b7 Add dynamic includes fix to changelog 2017-10-11 17:32:53 -07:00
James Cammarata
0aa1442c91 Fix static determination for include_tasks
An incorrect removal of a conditional resulted in include_tasks falling
through to the old static detection mechanism incorrectly. This restores
the previous conditional check.

Fixes #31593

(cherry picked from commit 3ef4f7e847)
2017-10-11 17:31:13 -07:00
Toshio Kuratomi
723beb58d1 Add inventory plugin path fix to changelog 2017-10-11 17:29:34 -07:00
Jacob Floyd
b1038b7903 Fix Inventory Plugin Loading (#31605)
This change makes the PluginLoader use DEFAULT_INVENTORY_PLUGIN_PATH setting.
Inventory Plugins were only being loaded the 'inventory_plugins' folder of the current directory,
as well as the ansible-provided inventory plugins (e.g. `/path/to/site-packages/ansible/plugins/inventory`).
(cherry picked from commit 0371d0deda)
2017-10-11 17:28:46 -07:00
Toshio Kuratomi
878ed2c079 Add relative paths fix to changelog 2017-10-11 13:05:00 -07:00
Ganesh Nalawade
6cbdc17aa1 Remove log of command executed in persistent connection (#31583)
* Remove log of command executed in persistent connection (#31581)

(cherry picked from commit 97d5e0d027)

* Update changelog
2017-10-11 19:23:47 +05:30
Ganesh Nalawade
e001fb7c14 Fix rollback in junos_config (#31424) (#31563)
* Fix rollback in junos_config (#31424)

* Fix rollback in junos_config

Fixes #30778

*  Call `load_configuration` with rollback id in case
   the id is given as input
*  Pass rollback id to `get_diff()` to fetch diff from device

* Fix unit test

(cherry picked from commit 88da95bb77)

* Update changelog
2017-10-11 15:28:42 +05:30
Brian Coca
daa2810410 fix paths to actually be config file relative (#31533)
* fix paths to actually be config file relative

also allow to unfrack paths for 'not cwd'
only use -i 'localhost,' for adhoc in pull
(cherry picked from commit 3886f80e44)
2017-10-10 19:17:39 -07:00
Toshio Kuratomi
e60e70ccd6 Try to cleanup after the rpm_key test
(cherry picked from commit dde2c96d67)
2017-10-10 17:41:06 -07:00
Matt Davis
76d84fd4d6 CHANGELOG update for become/runas error messaging 2017-10-10 16:58:14 -07:00
Matt Davis
c1254a8108 improve become/runas error messaging on bogus/missing username (#31551)
(cherry picked from commit a4ceb4c35f)
2017-10-10 16:54:35 -07:00
Martin Krizek
50af2dc462 Add yum fix to changelog 2017-10-10 21:23:45 +02:00
Martin Krizek
b4184f9825 yum: fix crashes installing from file/url
(cherry picked from commit 24c360287e)
2017-10-10 21:20:42 +02:00
Sloane Hertel
3505e5eba0 aws_s3: fix upload_file's ExtraArgs - fixes #31232 (#31487) (#31538)
* Module option metadata are extra arguments rather than S3 object metadata: update ExtraArgs variable.

* Maintain backwards compatibility by guessing at content type rather than always defaulting to binary/octet-stream.
2017-10-10 14:15:44 -04:00
Toshio Kuratomi
d3ccca2b8d Add rpm_key fix to changelog 2017-10-10 10:59:03 -07:00
Lukas Bednar
ead2fc5a64 [rpm_key] Fix to import first key on the system (#31514)
* [rpm_key] Fix to import first key on the system

Fixes: #31483

* [rpm_key] removed unsafe_shell and "throwaway" underscore

* [rpm_key] adding test to add the first key on system

(cherry picked from commit 5ccc1072ea)
2017-10-10 10:59:03 -07:00
Sloane Hertel
3a0aa4ddff [cloud] Fix ec2_group when security group lacks a VPC (#31526) (#31540) 2017-10-10 13:57:16 -04:00
arnonki
0e01684873 Use default values for object returned from aws to prevent TypeError (#31455)
* Use default values for object returned from aws to prevent TypeError
NoneType exception fixes #31454
(cherry picked from commit 6df6f79bbd38407c3c81b1d194d87c9fca00f5f0)
2017-10-10 13:32:05 -04:00
Sam Doran
8afa7c73df Add sysctl fix to CHANGELOG 2017-10-10 12:50:11 -04:00
Sam Doran
60874bad3e Remove sysctl entries when state=absent (#31486)
* Remove sysctl entry when state=absent
* Cleanup sysctl integration test syntax
* Correct grammar on error message
* Add sysctl integration test for state=absent
(cherry picked from commit 2610b521bc)
2017-10-10 09:01:53 -07:00
Brian Coca
ccd86d5a00 clarified inventory_dir changes for 2.4 (#31484)
* clarified inventory_dir changes for 2.4

added example on how to restore (mostly) old behaviour for add_hosts

fixes #30901
(cherry picked from commit dc69af50dc)
2017-10-09 20:57:14 -07:00
Toshio Kuratomi
e5b8809ea2 Add changelog for using include/import with adhoc 2017-10-09 20:51:08 -07:00
Brian Coca
ed1f6df9d3 better message for unsupported include/imports
adhoc cannot currently execute these actions

(cherry picked from commit 74107ff7cc)
2017-10-09 20:50:08 -07:00
Rob
9bde0acc0a [cloud] Fix #31271 - cast all tag values as strings (#31272)
* Fix #31271 - cast all tag values as strings

* Replace `str` with `to_native`

(cherry picked from commit 154191f56d31e223b178d2333122894d5847db70)
2017-10-09 21:06:07 -04:00
Toshio Kuratomi
d45f662a52 Add the revert of namespaced facts to the changelog 2017-10-09 16:34:24 -07:00
Brian Coca
a59cbe5e11 revert namespaced facts changes to package/service
fixes #31485

(cherry picked from commit 4e22677e7d)
2017-10-09 16:32:27 -07:00
Toshio Kuratomi
982e15d79e Add jimi's include_role fix to changelog 2017-10-09 13:49:41 -07:00
James Cammarata
ef96329ae2 Template role_name when statically including via include_role (#31463)
Also trims out code which was incorrectly setting is_static=True for
include_role.

Fixes #30700
(cherry picked from commit e609618274)
2017-10-09 13:47:23 -07:00
Jordan Borean
9522309b99 updated changelog for win_copy fix 2017-10-10 06:35:00 +10:00
Vyronas Tsingaras
fe4eedf5b6 win_copy: Add missing check_mode fix (#31469)
* Add missing check_mode fix

* Refactor conditional to use the one embedded in Remove-Item

(cherry picked from commit 5bf9f271b3)
2017-10-10 06:34:10 +10:00
Brian Coca
7f2c611dfc added toggle to control vars plugin behviour
this should allow user to control how they want the playbook dirs inspected
for additional vars, default now reverts to 2.3 behaviour (top).
corrected paths order
minor doc reword

(cherry picked from commit 7d49b27218)
2017-10-09 12:32:03 -04:00
Jordan Borean
44cd3147a0 updated changelog for ec2_win_password fix 2017-10-09 16:43:25 +10:00
jonjozwiak
60e98a3635 Fix ec2_win_password to allow blank key_passphrase (#28791)
(cherry picked from commit 74f950936a)
2017-10-09 16:42:34 +10:00
Toshio Kuratomi
3ebde33a44 Add ping docs fix to changelog 2017-10-08 08:20:38 -07:00
Toshio Kuratomi
991d9961ed Change ping docs to refer to win_ping (#31444)
(cherry picked from commit 4804e99b44)
2017-10-08 08:19:00 -07:00
Brian Coca
058ed81aa0 revert ocalhost getting 'all' vars (#31425)
back to previous implicit localhost behaviour

fixes #31420

(cherry picked from commit a9942353fe)
2017-10-06 19:11:17 -04:00
Brian Coca
4f4905c88a fix 'return false' from parse
this was abandoned early on the manger side  but seems like we left behind on plugin side.
more flexible extensions with yaml plugin
validate data correctly for yaml/constructed
fixed issue with only adding one child to keyed, the group only got the host that forced it's creation

fixes #31382
fixes #31365

(cherry picked from commit e4c61ea9a1)
2017-10-06 13:26:03 -04:00
Toshio Kuratomi
84525576f1 Add systemd check-mode fix to changelog 2017-10-06 08:59:36 -07:00
Strahinja Kustudic
3af3bb42e0 Do not run systemctl daemon-reload in check mode
(cherry picked from commit 7417282d37)
2017-10-06 08:58:50 -07:00
Trishna Guha
e886da782b nxos_snmp_* fixes : Fixes #30997, #30999 (#31000) (#31414)
* add codeblock to handle 5K platform for nxos_snmp_host

* fix get_snmp_traps for 5K platform

* Make shippable happy

(cherry picked from commit 48f4643a66)
2017-10-06 18:34:01 +05:30
Trishna Guha
6e03cfac6f Fixes #30846 (#30862) (#31408)
(cherry picked from commit 0218fdcd80)
2017-10-06 17:26:11 +05:30
Jordan Borean
21c9a716b6 updated changelog with win_copy fix 2017-10-06 15:25:15 +10:00
Jordan Borean
cb39aed465 win_copy: allow src to have invalid windows chars (#31392)
* win_copy: allow src to have invalid windows chars

* create file with colon instead of avoid checkout errors

(cherry picked from commit c4b51009f0)
2017-10-06 15:24:20 +10:00
Brian Coca
d2c19eb2f1 better chown errors
(cherry picked from commit a6e27a903a)
2017-10-05 18:41:28 -04:00
Toshio Kuratomi
e80c7d55d8 Add rpm_key and azure_rm dyn inv script fixes to changelog 2017-10-05 11:50:47 -07:00
Thomas Stringer
827d7e7cc6 refactor azure dynamic inventory script configparser import to support python3 (#31370)
* refactor configparser import to support python3

* change ModuleNotFoundError to ImportError

(cherry picked from commit cb01f33d1e)
2017-10-05 11:50:10 -07:00
Eduardo Suarez-Santana
9bcb6f4372 Fix rpm_key absent. (#31045)
When keyid is 8 charactes long, drop_key function cuts everything
issuing an error: "package gpg-pubkey- is not installed"
(cherry picked from commit 4337b7a777)
2017-10-05 11:50:09 -07:00
Sam Doran
b11d2289dd Add docker_secrets fix to CHANGELOG 2017-10-05 14:12:18 -04:00
John R Barker
bd460eee9a data should be redacted in docker_secret (#31366)
(cherry picked from commit e859d0da9c)
2017-10-05 14:09:05 -04:00
John R Barker
761b00c5b8 Improve and link Network Proxy docs (#31316) (#31368)
* Improve and link Network Proxy docs

It is possible for proxy issues to cause "unable to open shell", so
detail there.

Having the "how-to" in the debug page makes more sense than on the
porting page, so move it.

Fixed a few formatting issues at the same time.

* Edits

* typo

(cherry picked from commit b79d15e67f)
2017-10-05 18:51:28 +01:00
Toshio Kuratomi
023ac17acf Add revert of alternate shells to be used by run_command into changelog 2017-10-05 10:23:28 -07:00
Toshio Kuratomi
bc6483c96a Revert "enable run_command to use non /bin/sh shells"
This breaks output from commands in current playbooks.  Since this
change fixed a smaller use case we're going to revert this for 2.4.1 and
revisit a different fix for non /bin/sh shells for 2.5.x

This reverts commit 55135c0825.
2017-10-05 10:23:28 -07:00
Toshio Kuratomi
b15ff222b1 Revert "only set executable from shell if not set already"
Reverted as this is a fix for 55135c0825
which is being reverted for breakage

This reverts commit e506b5da14.
2017-10-05 10:23:28 -07:00
Rob
19c6fe9a78 [cloud] Only get rules if listener in elb_application_lb been identified in compare_rules (#30604)
* Only get rules if listener has been identified in compare_rules

* Always cast the listener port to an integer.

(cherry picked from commit 7cdaa3089ed2053f6fcfcea524a0322f40a2a822)
2017-10-05 11:57:25 -04:00
Rene van Aerle
25eb9154e9 Mention Ansible in package descriptions
These values are used by software updaters to show which applications
are being updates to the user. In the case of Ubuntu, it will now show
clearly that it is updating Ansible instead of a radically simple IT
automation platform.

(cherry picked from commit 95e1d91d5d)
2017-10-05 08:41:42 -07:00
Sam Doran
2f85e78813 Add SELinux fact change to CHANGELOG 2017-10-05 09:22:10 -04:00
Sam Doran
71e0540016 Make ansible_selinux facts a consistent type (#31065)
* Make ansible_selinux facts a consistent type

Rather than returning a bool if the Python library is missing, return a dict with one key containing a message explaining there is no way to tell the status of SELinux on the system becasue the Python library is not present.

* Fix unit test

(cherry picked from commit e7902d888c)
2017-10-05 09:19:56 -04:00
Trishna Guha
ecce2f826f nxos_config and nxos_pim_interface fix (#31343)
* fixes #31080 (#31081)

(cherry picked from commit 266c2f5831)

* nxos_config intended_config docfix (#31337)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 9f72b32c5d)
2017-10-05 17:06:16 +05:30
Toshio Kuratomi
13a86b649d Add ssh-extra-args fix to changelog 2017-10-04 23:16:03 -07:00
Brian Coca
8ccb719dfc restore connection options from cli
fixes #30720

(cherry picked from commit bed7cd8b11)
2017-10-04 23:14:56 -07:00
Toshio Kuratomi
6dab8b7bfa New release v2.4.1.0-0.2.beta2 2017-10-04 20:12:09 -07:00
Brian Coca
e1fab37316 removed example for restricted facts namespace 2017-10-04 20:38:21 -04:00
Matt Clay
eaabb33286 Avoid msrest version 0.4.15 for Azure modules.
This version has known regressions preventing modules such as
azure_rm_dnsrecordset from working.

(cherry picked from commit e167c9338c)
2017-10-04 16:00:31 -07:00
Matt Clay
72154072bb Switch CI for OS X back to a single job. (#31265)
* Update Shippable scripts for group/non-group use.
* Switch CI for OS X back to a single job.

(cherry picked from commit 5a91ed0a3b)
2017-10-04 13:26:13 -07:00
Matt Clay
389356d612 Run OS X and FreeBSD CI tests using groups. (#31254)
* Run OS X and FreeBSD CI tests using groups.
* Improve readability of Shippable jobs.

(cherry picked from commit 72237b63e7)
2017-10-04 13:26:13 -07:00
Matt Clay
e25d44f97c Run all Windows tests if change detection disabled (#30320)
* Run all Windows tests if change detection disabled
* Run all Windows versions if change detection disabled

(cherry picked from commit 765718bed2)
2017-10-04 13:26:13 -07:00
Matt Clay
75bfd4cf2f Update Windows CI groups from 2 to 3.
(cherry picked from commit c00ad0868e)
2017-10-04 13:26:13 -07:00
Toshio Kuratomi
8281627d43 We want the ini and env vars to both override in the same order
There's an ssh version and a generic version.  We want the ssh version
to override the generic version in both cases.

(cherry picked from commit 52497920fa)
2017-10-04 13:07:20 -07:00
Toshio Kuratomi
327f76f8fd Add any_errors_fatal fix to changelog 2017-10-04 12:56:18 -07:00
Sloane Hertel
72148b358d Allow any_errors_fatal to be set in playbook - fixes #30691 (#30839)
* Allow any_errors_fatal to be set in playbook.
* Default to the config file value for any_errors_fatal only if it isn't already provided.
* add _get_attr method

(cherry picked from commit aa658c64ec)
2017-10-04 12:56:18 -07:00
Matt Clay
2572b2147e Fix ansible-test config management.
(cherry picked from commit a333f2e5b0)
2017-10-04 12:53:29 -07:00
Brian Coca
dff33071d0 check type to avoid typeerror tb
fixes #31290 by giving more meaningful message

(cherry picked from commit 8aa33419c9)
2017-10-04 15:14:48 -04:00
Martin Krizek
64b569635d Add yum fix to changelog 2017-10-04 21:09:11 +02:00
Martin Krizek
c9af0bfea8 yum: fix name parsing out of envra (#31247)
(cherry picked from commit 115b4fdc9b)
2017-10-04 21:08:34 +02:00
Brian Coca
4fed711c42 made note about cwd not working for hostlist anymore (#31258)
* made note about cwd not working for hostlist anymore

fixes #31041

* Edits

(cherry picked from commit 5085c3b859)
2017-10-04 14:19:26 -04:00
Brian Coca
7d69946d42 correctd inventory_file to return full path
fixes #31294

(cherry picked from commit dbae704d3c)
2017-10-04 11:54:25 -04:00
Toshio Kuratomi
e9183f1966 Update changelog for example script fix 2017-10-04 08:51:13 -07:00
Matt Martz
3d4e77f44b Update uptime.py example script with changes to the API. Fixes #31229
(cherry picked from commit 2b08e00a54)
2017-10-04 08:50:37 -07:00
Brian Coca
280e9d7bb7 dont follow symlinks for inventories
now symlink dir is checked for locality of group/host_vars

fixes #31195

(cherry picked from commit f00d47fac0)
2017-10-04 11:05:09 -04:00
Brian Coca
8b39280d8d turn all inventory cache 'off by default'
(cherry picked from commit 852d457549)
2017-10-04 10:52:01 -04:00
Brian Coca
833858dc31 updated constructed docs to clarify use of ext
(cherry picked from commit 46621a3ddd)
2017-10-04 08:47:47 -04:00
Trishna Guha
43d24e284c Fixes nxos_igmp_interface idempotence issue for N1 images (#31220) (#31288)
(cherry picked from commit 1378861fe7)
2017-10-04 13:02:25 +05:30
Trishna Guha
6999b1168f Fixes #30769 - nxos_vtp_version errors out on N1 images. (#30770) (#31285)
* Fixes #30769

* add the same fix for 2 more vtp modules

(cherry picked from commit a12a05c219)
2017-10-04 12:09:25 +05:30
Sam Doran
04ced64e35 Add SELinux fix to CHANGELOG 2017-10-03 23:44:32 -04:00
Sam Doran
e157082f5e Correctly write SELinux config file (#31251)
* Add new lines to end of config file lines

* Properly write out selinux config file

Change module behavior to not always report a change but warn if a reboot is needed and return reboot_required.

Improve the output messages.

Add strip parameter to get_file_lines utility to help with parsing the selinux config file.

* Add return documentation

* Add integration tests for selinux module

* Use consistent capitalization for SELinux

* Use atomic_move in selinux module

* Don't copy the config file initially

There's no need to make a copy just for reading.

* Put message after set_config_policy in case the change fails

* Add aliases to selinux tests

(cherry picked from commit 00df1fda10)
2017-10-03 23:42:33 -04:00
jborean93
8f9b4f9711 updated changelog for windows become fix 2017-10-04 13:09:29 +10:00
Jordan Borean
39196a7f2f win_become: move error handling to Ansible outside of shell (#31227)
* win_become: move error handling to Ansible outside of shell

* trimmed the output so double newlines don't get set

* added test for non-zero exit code

* missed issue URL on test

* changed exit to SetShouldExit

(cherry picked from commit e61c2799ff)
2017-10-04 13:07:36 +10:00
Sam Doran
69e945129a Add elasticsearch_plugin fix to CHANGELOG 2017-10-03 22:33:53 -04:00
Sam Doran
88a2c3c047 Update elasticsearch_plugin.py (#28936)
* Update elasticsearch_plugin.py

Change module to work with Elasticsearch 2.x and 5.x automatically.
Update examples and docs.
Supersedes #21989

* Check system paths for elasticsearch-plugin binary

Use get_bin_path from basic.py for searching paths.

* Create a copy of PLUGIN_BIN_PATHS rather than modifying the global

* Use provided plugin_bin path first before trying other places

Change global PLUGIN_BIN_PATHS to a tuple

(cherry picked from commit a5ee865634)
2017-10-03 22:30:30 -04:00
Toshio Kuratomi
34bb2810a5 Add monit module fix to changelog 2017-10-03 15:20:21 -07:00
Daniel Roberts
6a1dffc507 fix monit version check
it was erroneously checking > 3.18 instead of > 5.18

Fixes #30614

(cherry picked from commit 34878926ca)
2017-10-03 15:18:53 -07:00
Toshio Kuratomi
7bfc23ad9e Add include_vars file instead of directory error message to changelog 2017-10-03 15:13:37 -07:00
Abhishek Shukla
4283a689d9 BugFix code breaks, if include_vars dir is file instead of directory (#31157)
(cherry picked from commit d0c003ab0f)
2017-10-03 15:12:59 -07:00
Brian Coca
04a059e406 make pipelining actually backwards compatible
restore ssh specific setting the global, in the future these will be separate.

(cherry picked from commit 2d70dc7f21)
2017-10-03 16:49:37 -04:00
jborean93
0e7fe0fe2e updated changelog for win_reg_stat return value fix 2017-10-04 06:21:47 +10:00
Dustin Spicuzza
59beba32be win_reg_stat actually sets properties to be a dictionary, not a list (#31252)
(cherry picked from commit 8f62be7b7c)
2017-10-04 06:20:49 +10:00
Matt Davis
22d9135b87 Add desc for 31084 2017-10-03 12:55:10 -07:00
Jordan Borean
df4daeb9a9 win_copy: fix for copying encrypted file without pass (#31084)
* win_copy: fix for copying encrypted file without pass

* fix pep8 issue

* reduced the diff and fixed some minor issues

(cherry picked from commit bba941cd5b)
2017-10-03 12:52:43 -07:00
Andreas Olsson
52998cbb15 Remove git:// urls from docsite and from packaging (#30459)
It's almost always preferable to clone by way of https:// rather than
using the bare git:// protocol. Not only does https:// provide
stronger guarantees it also plays nicer with corporate proxies, etc.
(cherry picked from commit ba0b91b51b)
2017-10-03 12:19:07 -07:00
Scott Butler
bbe73e2261 Fixed bad URL formatting. 2017-10-03 12:16:09 -07:00
Scott Butler
6ca6167cc8 Fixed typo in Yum repo path. 2017-10-03 11:42:39 -07:00
Brian Coca
fa131f9a07 make pipelining actually backwards compatible
restore ssh specific setting the global, in the future these will be separate.

(cherry picked from commit 2d70dc7f21)
2017-10-03 14:35:28 -04:00
Adrian Likins
74e0643dbb Handle vault decrypt --output=- (#31066)
In cli.CLI.unfrack_path callback, special case if the
value of '--output' is '-', and avoid expanding
it to a full path.

vault cli already has special cases for '-', so it
just needs to get the original value to work.

Fixes #30550
(cherry picked from commit 278ff19bea)
2017-10-03 14:20:31 -04:00
Matt Clay
1bc2f4e38e Update changelog for deserialization fix. 2017-10-03 10:08:23 -07:00
Brian Coca
f09c1211a7 set _hosts on access if None (#31111)
set _hosts on access if None to bpyass srlz10n issues to fix #30903

(cherry picked from commit cf3414d7d7)
2017-10-03 10:03:51 -07:00
Adrian Likins
b81270f7d5 Fix flush_cache on redis cache
Fix a del on non existent self.cache.

Fixes #31148

(cherry picked from commit dae0ad1ce6)
2017-10-03 12:54:58 -04:00
Brian Coca
c6691eef52 remove unused ssh pipelining setters
fixes #31125

(cherry picked from commit 101377768b)
2017-10-03 09:22:49 -04:00
David Moreau-Simard
447d1cffb0 Fix backwards compatibility of constants.get_config
get_config would use ConfigManager.get_ini_value which does not
exist. What we are meant to use is
ansible.config.manager.get_ini_config_value and this method does not
expect a list, only a dictionary with a section and a key.

(cherry picked from commit 9b693235f0)
2017-10-03 09:19:28 -04:00
Jordan Borean
737a0d6015 win_dotnet_ngen: fix after broken in 2.4 (#31076)
* win_dotnet_ngen: fix after broken in 2.4

* added description to return values

(cherry picked from commit 12a4dca447)
2017-10-03 06:39:51 +10:00
jborean93
2513078f39 updated changelog after win_dotnet_ngen fix 2017-10-03 06:36:28 +10:00
jborean93
6035b00a84 updated changelog for win_msg fix 2017-10-03 06:35:24 +10:00
Jordan Borean
310610de47 win_msg: added doc about msg limit and included an explicit check for better error handling (#31078)
(cherry picked from commit 67fd98da09)
2017-10-03 06:34:28 +10:00
Matt Clay
5db1d1a881 Pin docker simulator versions.
(cherry picked from commit c055795e02)
2017-10-02 13:20:10 -07:00
Ryan S. Brown
d2c11a1b00 Update CHANGELOG with aws_s3 fix 2017-10-02 14:38:45 -04:00
Dave Grochowski
fd31896906 [cloud] Fix handling of encrypt option in aws_s3 module (#30822)
(cherry picked from commit e67e7785d3ae785e4aa532a17261b9ae113c8960)
2017-10-02 14:36:41 -04:00
Toshio Kuratomi
fbccd38e37 Add last few cherrypicks to changelog 2017-10-02 09:13:10 -07:00
Julien Palard
6a1a6ee690 yaml inventory: Better error reporting on typo. fixes (#31118)
(cherry picked from commit 5802ec04bf)
2017-10-02 09:10:45 -07:00
Brian Coca
ad0761b0a8 avoid include_Xs conflating vars with options (#30954)
* avoid include_Xs conflating vars with options

* avoid frozenset so serialization wont complain

* dded missing set

* updated as per feedback

(cherry picked from commit dea872e4a6)
2017-10-02 09:09:21 -07:00
Brian Coca
5de7121941 corrected yaml extensions ini setting
(cherry picked from commit 44d2f21e02)
2017-10-02 10:03:19 -04:00
Toshio Kuratomi
6945f6d3b2 Add copy module fix to changelog 2017-09-29 17:16:10 -07:00
Brian Coca
a81dc232e3 remove action plugin only fields from 'file' calls (#31047)
* remove action plugin only fields from 'file' calls

fixes #30556

* Add a test for #30556
(cherry picked from commit ac9278ff0f)
2017-09-29 17:13:58 -07:00
jborean93
981073b397 Updated changelog for win_chocolatey docs change 2017-09-30 08:24:21 +10:00
jhawkesworth
6d82ef8378 win_chocolately document improvedments, mention win_hotfix and use of become (#31085)
(cherry picked from commit 04afacc2ee)
2017-09-30 08:23:30 +10:00
Toshio Kuratomi
73355d541a Add urls.py w/ proxy fix to changelog 2017-09-29 14:36:23 -07:00
Damian Zaremba
1407410362 module_utils.urls - Encode the proxy connect as binary (#30811)
* module_utils.urls - Encode the proxy connect as binary

Under Python3 the sendall method expects binary not a string.

Prior to this change the below exception was being thrown;
Traceback (most recent call last):
  File "/tmp/ansible_umxox7_x/ansible_modlib.zip/ansible/module_utils/urls.py", line 1044, in fetch_url
    client_key=client_key, cookies=cookies)
  File "/tmp/ansible_umxox7_x/ansible_modlib.zip/ansible/module_utils/urls.py", line 951, in open_url
    r = urllib_request.urlopen(*urlopen_args)
  File "/opt/blue-python/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/blue-python/3.6/lib/python3.6/urllib/request.py", line 524, in open
    req = meth(req)
  File "/tmp/ansible_umxox7_x/ansible_modlib.zip/ansible/module_utils/urls.py", line 729, in http_request
    s.sendall((self.CONNECT_COMMAND % (self.hostname, self.port)).decode())
AttributeError: 'str' object has no attribute 'decode'

Encoding the value is inline with the lines below (Proxy-Authorization etc) which are being sent as binary.
(cherry picked from commit 92f777e815)
2017-09-29 14:33:06 -07:00
Brian Coca
8cee2a8d93 removed typo from dig docs
(cherry picked from commit 43cbcbcc75)
2017-09-29 11:25:03 -04:00
Will Thames
750874ea5d [cloud] Improve boto3_tag_list_to_ansible_dict backward compatibility (#30622)
Default to trying both `key` and `Key`, and corresponding
`value`/`Value`.

Alternative to #30542

(cherry picked from commit 5d97fe4b6daa4ddc4475dbc12327aea4bcdce8bd)
2017-09-29 09:58:30 -04:00
jborean93
adc3bedaa2 Updated changelog for winrm task vars fix 2017-09-29 11:14:50 +10:00
Brian Coca
1665178626 fixed winrm to use proper task vars (#31072)
it avoids hitting hostvars templating issue and ignoring exception
fixes #30911

also normal var precedence should work for ansible_winrm vars

(cherry picked from commit 057eec94ee)
2017-09-29 11:14:04 +10:00
Brian Coca
fcba6c0a57 fix anchor 2017-09-28 20:38:41 -04:00
Toshio Kuratomi
15f8075bab Add the PR to the changelog 2017-09-28 16:10:24 -07:00
Toshio Kuratomi
4ea1cc24ac Add os_image fix to changelog 2017-09-28 16:09:39 -07:00
Joshua C. Randall
e935907b4b fix os_image so it works when id is None (#29147)
Fixes #29145
(cherry picked from commit 6e84baddb6)
2017-09-28 15:56:02 -07:00
Adrian Likins
4025b47629 Fix fact failures cause by ordering of collectors (#30777)
* Fix fact failures cause by ordering of collectors

Some fact collectors need info collected by other facts.
(for ex, service_mgr needs to know 'ansible_system').
This info is passed to the Collector.collect method via
the 'collected_facts' info.

But, the order the fact collectors were running in is
not a set order, so collectors like service_mgr could
run before the PlatformFactCollect ('ansible_system', etc),
so the 'ansible_system' fact would not exist yet.

Depending on the collector and the deps, this can result
in incorrect behavior and wrong or missing facts.

To make the ordering of the collectors more consistent
and predictable, the code that builds that list is now
driven by the order of collectors in default_collectors.py,
and the rest of the code tries to preserve it.

* Flip the loops when building collector names

iterate over the ordered default_collectors list
selecting them for the final list in order instead
of driving it from the unordered collector_names set.

This lets the list returned by select_collector_classes
to stay in the same order as default_collectors.collectors

For collectors that have implicit deps on other fact collectors,
the default collectors can be ordered to include those early.

* default_collectors.py now uses a handful of sub lists of
collectors that can be ordered in default_collectors.collectors.

fixes #30753
fixes #30623

(cherry picked from commit 95abc1d82e)
2017-09-28 10:56:18 -04:00
jborean93
f7b0908315 updated changelog for win_iis_webapppool fix 2017-09-28 16:17:35 +10:00
Jordan Borean
9a22c93606 fix for webapppool when specifying an attribute that holds a collection (#30729)
* fix for webapppool when specifying an attribute that holds a collection

* re-add always block on test

(cherry picked from commit a41077df20)
2017-09-28 16:16:52 +10:00
Toshio Kuratomi
085297259f New release v2.4.1.0-0.1.beta1 2017-09-27 21:29:22 -07:00
Toshio Kuratomi
1528a7ca60 Add ec2_snapshot_facts fix for python3 to changelog 2017-09-27 20:44:36 -07:00
Will Thames
1a3285b8a1 Fix ec2_snapshot_facts for python3
Avoid the following seen when running ec2_ami tests on python3,
presumably because the return type of `map` is different between
python2 and python3.

```
Traceback (most recent call last):
  File "/tmp/ansible_e44v27uj/ansible_module_ec2_snapshot_facts.py", line 242, in <module>
    main()
  File "/tmp/ansible_e44v27uj/ansible_module_ec2_snapshot_facts.py", line 238, in main
    list_ec2_snapshots(connection, module)
  File "/tmp/ansible_e44v27uj/ansible_module_ec2_snapshot_facts.py", line 193, in list_ec2_snapshots
    snapshots = connection.describe_snapshots(SnapshotIds=snapshot_ids, OwnerIds=owner_ids, RestorableByUserIds=restorable_by_user_ids, Filters=filters)
  File "/usr/local/lib/python3.5/dist-packages/botocore/client.py", line 312, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/botocore/client.py", line 575, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/usr/local/lib/python3.5/dist-packages/botocore/client.py", line 630, in _convert_to_request_dict
    api_params, operation_model)
  File "/usr/local/lib/python3.5/dist-packages/botocore/validate.py", line 291, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter OwnerIds, value: <map object at 0x7ff577511048>, type: <class 'map'>, valid types: <class 'list'>, <class 'tuple'>
```

https://github.com/ansible/ansible/pull/30435#issuecomment-330750498
(cherry picked from commit 5900fee67a)
2017-09-27 20:43:20 -07:00
Toshio Kuratomi
165432c9c1 lxc_container py3 fix in changelog 2017-09-27 20:34:37 -07:00
bit
d9a87fff5f lxc_container: open files as text, fixes #30571 (#30572)
call to_text on full config file

fixes issue #30571
(cherry picked from commit 0a114436fc)
2017-09-27 20:33:14 -07:00
jborean93
f88c8e1df9 Updated changelog for sensu_silence fix 2017-09-28 13:13:58 +10:00
Christian Albrecht
18490161b5 Fix sensu_silence module boolean parameter declaration (#30971)
(cherry picked from commit 0b0348d81c)
2017-09-28 13:13:14 +10:00
Brian Coca
ec380da0f2 fixed lookup dig docs
also clarified dig module uses dnspython

(cherry picked from commit bb874e5029)
(cherry picked from commit 54d7c384b6)
2017-09-27 21:00:45 -04:00
Brian Coca
fb2a533b81 fixed pull's ansible/git invocation options (#30938)
* fixed ansible/git invocation options

now falls back to using localhost as 'all' does not include implicit accidentally anymore

fixes #30636

(cherry picked from commit fc745920c7)
2017-09-27 19:51:06 -04:00
Toshio Kuratomi
5b08188318 Add crypttab pyhton3 fix to changelog 2017-09-27 11:59:28 -07:00
Jonathan Piron
441d238d5d Fix crypttab python3 compatibility issue (#30457)
In python2 str gives byte string. In Python3 it gives unicode string so it
can't be written in a binary mode opened file.
Use to_bytes helper function to ensure content being written will be
properly encoded in both python2 and python3.
(cherry picked from commit 54859a2132)
2017-09-27 11:58:41 -07:00
Brian Coca
ece8d2c577 since we never added toggle, disable cache
this restores previous behaviour, cache and a toggle will be added in 2.5
fixes #30717
2017-09-27 14:36:32 -04:00
Brian Coca
53f865d094 rmeove ext requirement for yaml inventory plugin
returns to the state before 2.4 made it a requirement
fixes #30855

(cherry picked from commit 82de2e1865)
2017-09-27 14:28:30 -04:00
Brian Coca
f993e213da added note about inventory_dir new behaviour (#30865)
* added note about inventory_dir new behaviour

(cherry picked from commit cd5cadfe69)
2017-09-27 12:30:59 -04:00
Brian Coca
e9649a0598 fixed wrong changelog entry 2017-09-27 11:48:58 -04:00
Thomas Steen Rasmussen
25fafc1280 Remove stray " and replace include: with import_tasks:
(cherry picked from commit 22fda12ac1)
2017-09-27 10:03:00 -04:00
Brian Coca
64737e1446 corrected import_play into to import_playbook (#30853)
* corrected import_play into to import_playbook

fixes #30744

(cherry picked from commit 17f094bb6a)
2017-09-26 17:28:07 -04:00
Brian Coca
457b70ee90 fix for slack callback breaks in 2.4 (#30932)
* fix for slack callback breaks in 2.4

fixes #30838

(cherry picked from commit 8378ac30b3)
2017-09-26 17:19:21 -04:00
Sloane Hertel
0195d3640b [cloud] Don't remove profile, security_token by default in aws_s3 (#30902) (#30930)
Comment above suggests only removing it for non-S3 services,
so let's actually enforce that.
2017-09-26 16:10:37 -04:00
Sloane Hertel
ed2a152b5e [cloud] Ensure target group ARNs are passed as a list in ec2_asg (#30905) (#30934)
While sets are useful for comparing whether target groups
need modifying, the AWS API expects a list or tuple, not a set
2017-09-26 16:09:53 -04:00
Sloane Hertel
91341de220 [cloudwatch_event] Due to an ImportError botocore is never successfully imported. (#30942) 2017-09-26 16:09:25 -04:00
Peter Sprygada
d532ab05ab fixes issue where filter wouldn't error on undefined var (#30921)
The filter will now correctly error on an undefined variable when trying
to template the key `value`

(cherry picked from commit 909100bd2c)
2017-09-26 14:52:05 -04:00
Matt Martz
f628881750 Update API example for 2.4
(cherry picked from commit d40eff720c)
2017-09-26 14:40:41 -04:00
Toshio Kuratomi
999404121f Add jenkins_plugin CVE fix to the changelog 2017-09-26 11:24:58 -07:00
Ivan Pepelnjak
0d61acc730 Add one-versus-many-matches logic to network filter plugin (#30511)
* Add one-versus-many-matches logic

* Fixed indentation (tabs ==> spaces)

(cherry picked from commit 9aa1da23f0)
2017-09-26 12:41:12 -04:00
Adrian Likins
042079aa87 Use vault_id when encrypted via vault-edit (#30772)
* Use vault_id when encrypted via vault-edit

On the encryption stage of
'ansible-vault edit --vault-id=someid@passfile somefile',
the vault id was not being passed to encrypt() so the files were
always saved with the default vault id in the 1.1 version format.

When trying to edit that file a second time, also with a --vault-id,
the file would be decrypted with the secret associated with the
provided vault-id, but since the encrypted file had no vault id
in the envelope there would be no match for 'default' secrets.
(Only the --vault-id was included in the potential matches, so
the vault id actually used to decrypt was not).

If that list was empty, there would be an IndexError when trying
to encrypted the changed file. This would result in the displayed
error:

ERROR! Unexpected Exception, this is probably a bug: list index out of range

Fix is two parts:

1) use the vault id when encrypting from edit

2) when matching the secret to use for encrypting after edit,
include the vault id that was used for decryption and not just
the vault id (or lack of vault id) from the envelope.

add unit tests for #30575 and intg tests for 'ansible-vault edit'

Fixes #30575

(cherry picked from commit a14d0f3586)
2017-09-26 12:31:58 -04:00
Brian Coca
fd361a2568 added cli rst docs to gitignore 2017-09-26 10:55:41 -04:00
Will Thames
a2525658f9 Remove print statements from play_context
Caused spurious output, particularly obvious when in `become` mode

(cherry picked from commit ef56f9a44c)
2017-09-26 10:16:11 -04:00
Toshio Kuratomi
a508bb205a Remove example of using params for the url_password
params could be logged so never use it for passwords.

Also add code to raise an error if passwords are used in that field.

References #30874

(cherry picked from commit 863fcb5ace)
2017-09-25 17:10:09 -07:00
Adrian Likins
2149d1092b Fix 'distribution' fact for ArchLinux (#30723)
Allow empty wasn't breaking out of the process_dist_files
loop, so a empty /etc/arch-release would continue searching
and eventually try /etc/os-release. The os-release parsing
works, but the distro name there is 'Arch Linux' which does
not match the 2.3 behavior of 'Archlinux'

Add a OS_RELEASE_ALIAS map for the cases where we need to get
the distro name from os-release but use an alias.

We can't include 'Archlinux' in SEARCH_STRING because a name match on its keys
but without a match on the content causes a fallback to using the first
whitespace seperated item from the file content as the name.
For os-release, that is in form 'NAME=Arch Linux'

With os-release returning the right name, this also supports the
case where there is no /etc/arch-release, but there is a /etc/os-release

Fixes #30600

* pep8 and comment cleanup

(cherry picked from commit 3eab636b3f)
2017-09-25 15:06:05 -04:00
Adrian Likins
3aa7941b72 facts: fix SPARC cpu count on linux (#30261)
On sparc64, /proc/cpuinfo has no usual 'model name', 'Processor', 'vendor_id', 'Vendor',
as a result "ansible_processor_vcpus" is always 1.
Add check element "ncpus active" to fix the issue.

(cherry picked from commit e93ecac0da)
2017-09-25 12:31:34 -04:00
Ganesh Nalawade
3680d28e58 Increase pause time in junos integration test (#30740) (#30799)
*  Increase pause time to a value greater
   than persistent connection timeout to clean
   out socket path.
(cherry picked from commit c3d226a739)
2017-09-23 18:42:00 +05:30
Brian Coca
2eac554eb4 use set to quicken group host membership
(cherry picked from commit 3f9a885b83)
2017-09-22 19:09:40 -04:00
Brian Coca
956b6ece86 dont validate group names in yaml plugin
(cherry picked from commit a819cfcad7)
2017-09-22 19:06:09 -04:00
Toshio Kuratomi
93559a7faf Add ssh path fix to changelog 2017-09-22 15:33:13 -07:00
Toshio Kuratomi
4afe8ed2ef Fix encoding error with path to ssh
As reported on the mailing list, if ssh_executable (from a config
setting) contains nonascii characters then we could get a UnicodeError
here.  Transform into bytes before passing to subprocess so that
subprocess doesn't transform to bytes for us.

(cherry picked from commit 86d8a4ff50)
2017-09-22 15:31:50 -07:00
Adrian Likins
bca1818b1e Fix pkg_mgr fact on OpenBSD (#30725)
* Fix pkg_mgr fact on OpenBSD

Add a OpenBSDPkgMgrFactCollector that hardcodes pkg_mgr
to 'openbsd_pkg'. The ansible collector will choose the
OpenBSD collector if the system is OpenBSD and the 'Generic'
one otherwise.

This removes PkgMgrFactCollectors depenency on the
'system' fact being in collected_facts, which also
avoids ordering issues (if the pkg mgr fact is collected
before the system fact...)

Fixes #30623

(cherry picked from commit 12404f470a)
2017-09-22 14:24:57 -04:00
Ganesh Nalawade
ce963984d1 Fix command argument typo in telnet module docs (#30731) (#30734)
* Fix command argument typo in telnet module docs (#30731)

(cherry picked from commit 6d3307e472)

* Update Change log
2017-09-22 15:20:09 +05:30
Brian Coca
304377aa82 added missing 2.4 clog entry 2017-09-21 23:56:46 -04:00
Toshio Kuratomi
5048f46340 Fix docker_service python3 incompatibility
Looks like this is supposed to operate on native strings so there's no
need to encode or decode at all here

Fixes #30354

(cherry picked from commit f66c74915c)
2017-09-21 19:51:31 -07:00
jborean93
c5f5277183 Updated changelog to include win_power_plan fix 2017-09-22 06:24:26 +10:00
Serge Nikalaichyk
22f352490d Fix OS version check in win_power_plan (#30538)
* Fixed win_power_plan OS version check

* Original error message case

(cherry picked from commit dc8aedb274)
2017-09-22 06:23:41 +10:00
jborean93
70c1320c08 Updated changelog with win_domain_membership fix 2017-09-22 06:11:58 +10:00
Jordan Borean
34ceed635d win_domain_membership: added better error handling and basic tests (#30674)
(cherry picked from commit fb628acb6e)
2017-09-22 06:10:14 +10:00
Hervé Beraud
9bc6cca9f8 [fix] no-unicode-literals sanity error on ansible.egg-info (#30446)
* [fix] no-unicode-literals sanity error on ansible.egg-info

(cherry picked from commit 0e9ae5b8cc)
2017-09-21 12:48:03 -07:00
Ryan Brown
fd42243936 Split ec2_elb_* modules in service of rename/interface changes (#30716)
* Split ec2_elb_* modules in service of rename/interface changes (#30532)

* Undeprecate ec2_elb_*
* Make ec2_elb* full fledged modules rather than aliases
* Split tests for ec2_elb_lb and elb_classicb_lb
* Change names in documentation of old and new elb modules

Add tests for ec2_elb_lb

* Update CHANGELOG with new status of ec2_elb_* vs. elb_classic_*
2017-09-21 14:43:45 -04:00
Sloane Hertel
bc0b069cb7 Remove invalid e.response from BotoCoreErrors in ec2_asg.py (#30121) (#30495) (#30715) 2017-09-21 13:53:04 -04:00
Brian Coca
71c646fe59 become flags are primary
with new configuration the sudo flags are always set and become cannot override,
switching to simle 'or' will result in become_flags working.

also sudo_flags are deprecated.
also changed from YAML null causing a 'None' str

fixes #30629

(cherry picked from commit 236d13ac3a)
2017-09-21 10:02:23 -04:00
Sloane Hertel
2fca9d5530 [cloud] Fix broken LimitExceeded check in iam_managed_policy (#30537) (#30626)
When policy versions exceed 5, we hit LimitExceeded. However,
the exception checking should use `e.response['Error']['Code']`
2017-09-21 08:29:39 -04:00
Sloane Hertel
64f54fa6e2 [cloud] Fix aws_s3 backwards compatibility of put/get options (#30580)
Previously to use the modes put or get the object had to be specified with a leading /. Since the boto call doesn't take an object like that this was overlooked and removed. Added a check to remove that leading character.
2017-09-21 08:29:15 -04:00
Ganesh Nalawade
6f461fbfd0 Increase socket connect retry timeout for integration test (#30681) (#30683)
*  Increase persistent connection local socket
   retry timeout to fix intermittent failure in
   network integration test
(cherry picked from commit 869cd6f729)
2017-09-21 11:02:22 +01:00
Toshio Kuratomi
aa808e1eb6 Add changelog entries for cherrypicks over the previous day. 2017-09-20 19:54:58 -07:00
Willem van Ketwich
1880aa86b5 fix for unrequired parameter
(cherry picked from commit 92426840d6)
2017-09-20 19:48:28 -07:00
jborean93
b92452f775 fix for make webdocs
(cherry picked from commit 0e22afef52)
2017-09-20 22:46:50 -04:00
Toshio Kuratomi
11cc64db21 Fix python3 and nonascii handling in inventory plugins
Fixes #30663

(cherry picked from commit 72bdf7aa7e)
2017-09-20 19:39:38 -07:00
Brian Coca
46fd30d420 moved from eval to templating + literal_eval
(cherry picked from commit f12c6e0946)
2017-09-20 19:38:45 -07:00
Vladimir Utenkov
804a308ab3 [cloud][py3] Fix AttributeError in iam_policy on python3 (#30551) 2017-09-20 17:15:03 -07:00
Dylan Silva
da56535ffc Updated release table for docs (#30649) (#30659)
- Updated table to reflect release of 2.4
- Added in 2.5 as current devel
2017-09-20 16:19:48 -07:00
Brian Coca
c4ce24966b dont override previous ini entries with defaults
corrected setting example, quotes mess up the regex
fixes #30633

updated chlog

(cherry picked from commit d3e85bd045)
2017-09-20 16:39:47 -04:00
Brian Coca
0c179133bf made callbacks backwards compatible (#30625)
* made callbacks backwards compatible
* note about porting guide
* deprecation notice so those callbacks get updated.

This fixes #30597 for those that were not inheriting from base.

Callback must either inherit from base (directly or indirectly),
which already implements this or implement set_options themselves.

(cherry picked from commit 131d417c7a)
2017-09-20 15:21:20 -04:00
Brian Coca
5fdcbdaaee More porting updates (#30635)
* Update porting_guide_2.4.rst with more docs and some rst fixes

(cherry picked from commit a030472092)
2017-09-20 15:13:01 -04:00
Adrian Likins
a3d5b2f1ce Check number of vault secrets after setup. (#30520)
This is to catch vault secrets from config and
cli. Previously vault_password_file in config was
missed since it was added by setup_vault_secrets,
so check after setup_vault_secrets.

Related to #30514

(cherry picked from commit 174cb1f33c)
2017-09-20 11:15:42 -04:00
Adrian Likins
f8ad9ca75d Don't ask for password confirm on 'ansible-vault edit' (#30514)
This is to match the 2.3 behavior on:

        ansible-vault edit encrypted_file.yml

Previously, the above command would consider that a 'new password'
scenario and prompt accordingly, ie:

        $ ansible-vault edit encrypted_file.yml
        New Password:
        Confirm New Password:

The bug was cause by 'create_new_password' being used for
'edit' action. This also causes the previous implicit 'auto prompt'
to get triggered and prompt the user.

Fix is to make auto prompt explicit in the calling code to handle
the 'edit' case where we want to auto prompt but we do not want
to request a password confirm.

Fixes #30491

(cherry picked from commit 307be59092)
2017-09-20 11:00:42 -04:00
Patrick Ogenstad
fc97af8ab1 Restore correct coloring to selective callback (#30528)
* Restore correct coloring to selective callback

This fixes the bug raised in #30506

* Fix format issues for Python 2.6 & indent

Removed the zero length fields to support format under Python 2.6

Fixed E128 continuation line under-indented for visual indent issue

(cherry picked from commit d74c871559)

updated clog
2017-09-20 09:22:48 -04:00
Ganesh Nalawade
1cf00a5151 Add underscore and period to regex for hostname prompt (#30612)
* Add _ and . to regex (#30396)

Adding underscore and period to the nxos regex for determining the prompt for hostnames with underscores and periods in the hostname.
(cherry picked from commit 33b8d7069f)

* Add change log
2017-09-20 14:35:15 +05:30
jborean93
fef04420c9 Updated changelog with camel conversion fixes 2017-09-20 15:25:35 +10:00
Jordan Borean
35c867d890 CamelConverter - more fixes picked up in testing (#30601)
(cherry picked from commit a940eb1e80)
2017-09-20 15:24:49 +10:00
Jordan Borean
98425291d1 CamelConversion: fix to not convert string values (#30595)
(cherry picked from commit 1ea0293878)
2017-09-20 15:24:32 +10:00
Adrian Likins
6d5f2dccb2 Misc docsite fixes (#30290)
* Fix refs for local_facts and various cli :option:
* Fix dev_guide/testing_pep8 refs
* remove ref to non-existing 'developing_test_pr'
* Fix ref to ansible-vault encrypt_string
* Removed hard-to-localize colloquialism.
* Rename '_ansible-pull' in playbooks_intro.

It was conflicting with rst/ansible-pull.rst. Nothing
seems to reference it.

* Add explicit targets for and update refs

Replace some ':doc:' use with ':ref:'.

Replace some :ref: to section names with explicit targets
(:doc:`Dynamic vs. Static` -> :ref:`dynamic_vs_static` etc)

* The 'YAML+Jinja' syntax lex fails here, so just use yaml

Since the yaml+jinja highlight fails, code wasnt highlighted
at all, but 'yaml' works more or less.

* just use no lexer for the < python2.6 examples

py3 will fail highlighting them, and 'python2' throws
a lexer warning, and nothing actually highlights it, so
just disable.

(cherry picked from commit 9cc63326b1)
2017-09-19 16:18:11 -07:00
Brian Coca
9ae683e9f4 added missing feature info (#30560)
* added missing feature info

(cherry picked from commit 22c8522cbf)
2017-09-19 17:44:08 -04:00
Brian Coca
aea9bab2ab fixed password lookup docs
(cherry picked from commit 71cc906ec8)
and chlog update
2017-09-19 16:34:14 -04:00
Toshio Kuratomi
0c843b70cc Fix jenkins_plugin test for no net situations (#30568)
Unittests are sometimes run without network connectivity in build
systems.  Make that work correctly by mocking out _get_url_data with the
expected return value.
(cherry picked from commit 0a69e27e62)
2017-09-19 13:13:10 -07:00
Chrrrles Paul
22acb4b733 oc module- Fixing description & removing example command (#30257)
* Fixing description & removing oc/adm example

Noticed formatting errors on http://docs.ansible.com/ansible/latest/oc_module.html -- also removing oc/oadm command examples

* Trailing whitespace..

(cherry picked from commit e3ef80f5d6)
2017-09-19 16:11:23 -04:00
Brian Coca
8ccbff08f5 fixed decreption
(cherry picked from commit 1cee81375386a7f3ac3d1893342b9323983f00c9)
(cherry picked from commit b9120dfd97)
2017-09-19 13:00:56 -07:00
Toshio Kuratomi
3b86554081 Add a code-smell test for smart quotes and remove smart quotes from all files
(cherry picked from commit c82cf791dd)
2017-09-19 13:00:56 -07:00
Rene Moser
c3c5869ada update changelog 2017-09-19 13:00:56 -07:00
Ondra Machacek
ba9a84f02a ovirt_vms: Fix the logout condition (#30410)
(cherry picked from commit 0aebdb4aca)
2017-09-19 13:00:56 -07:00
jborean93
6296b906fb Updated changelog for windows module util list fix 2017-09-19 13:00:56 -07:00
Jordan Borean
8a247989c5 windows: fix list type in legacy module utils (#30483)
* windows: fix list type in legacy module utils

* only change the return for the list type instead of affecting it all

* additional null check when using an array

(cherry picked from commit 01563ccd5d)
2017-09-19 13:00:56 -07:00
jctanner
1af9ab1b14 Remove redundant check for group membership in add_host (#30530)
(cherry picked from commit 5aebcd4f7f)
2017-09-19 13:00:56 -07:00
jborean93
d724bb584a Updated changelog to for win_file check mode fix 2017-09-19 13:00:56 -07:00
Dag Wieers
372397deb4 win_file: Fix check-mode issue removing dirs (#30475)
This fixed #30442

(cherry picked from commit 229a86c952)
2017-09-19 13:00:56 -07:00
Toshio Kuratomi
c235e8a863 Changelog entries for openssl_certificate fixes 2017-09-19 13:00:56 -07:00
Christian Pointner
6a7206fc99 openssl_certificate: make subject-alt-name identifier conistent with openssl_csr (#30151)
(cherry picked from commit 1fe5171f1a)
2017-09-19 13:00:56 -07:00
MarkusTeufelberger
69282e76fb Add extended key usages to module_utils/crypto.py (#30128)
* Add extended key usages
(cherry picked from commit 2f06d572ba)
2017-09-19 13:00:56 -07:00
MarkusTeufelberger
c4ae7e8854 Add simple integration test for openssl_certificate (#29038)
* openssl_certificate: Fix parameter assertion in Python3

Parameter assertion in Python3 is broken. pyOpenSSL get_X() functions
returns b'' type string and tries to compare it with '' string, leading
to failure.

The error mentionned above has been fixed by sanitizing the inputs from
a user to the assert only backend.

Also, this error was hidden by the fact that the improper check method
was called in the generate() functions.

* Add simple integration test for openssl_certificate

* remove subject == issuer assertion

* run integration tests only on supported hosts

* change min supported version to 0.15.x

* Add test for more CSR fields

* also convert dict members to bytes

* fix version_compare

* openssl_{csr, certificate}: Fail if pyOpenSSL <= 0.15

Previous 0.13 pyOpenSSL was a C-binding, and required the parameter
passed to add_extention to be in ASN.1. This has changed with the move
to 0.14 and it is now all pythong and string based.

Previous the 0.15 release, the `get_extensions()` method didn't exist,
since the modules rely heavily on it we ensure pyOpenSSL version is at
last 0.15.0.

* check pyopenssl version in openssl_csr integration test

(cherry picked from commit 2186b04934)
2017-09-19 13:00:56 -07:00
Brian Coca
3e0a17a21a Lookup docs (#30280)
* finalize lookup documentation
* minor fixes to ansible-doc
 - actually show which file caused error on when listing plugins
 - removed redundant display of type and name
* smart quote fixes from toshio
(cherry picked from commit 24d4787b2d)
2017-09-19 07:58:23 -07:00
Toshio Kuratomi
d14467b029 Fix release date of 2.4.0.0 2017-09-18 19:23:06 -07:00
Toshio Kuratomi
12332e7a2c New release v2.4.0.0-1 2017-09-18 18:22:16 -07:00
Toshio Kuratomi
8c20a2e600 Set the release date. 2017-09-18 17:42:08 -07:00
Toshio Kuratomi
c3821abc95 note in changelog that ec2_elb_lb, ec2_lb, and ec2_elb_facts are not deprecated yet.
We pushed renames of those modules to new names but have since decided
that we should rewrite the modules with better parameters and better
return values instead.  It's too late to fix the deprecations in 2.4.0
so make clear what we're going to do in the changelog for 2.4.0 and
promise to fix it in 2.4.1
2017-09-18 13:31:06 -07:00
Toshio Kuratomi
3c805f85bc New release v2.4.0.0-0.5.rc5 2017-09-17 19:30:07 -07:00
Toshio Kuratomi
4ea99a4cbe Update aci tests for new messages from lxml-4.0+
(cherry picked from commit 1fa3fb45bc)
2017-09-17 19:06:30 -07:00
Scott Butler
bdce5d2fe0 Updated version in index.
(cherry picked from commit 2213f55c4aa5ec874ba92a0fb3f2966b882aac9a)
2017-09-17 17:18:50 -07:00
John R Barker
bbd90e3b29 porting_guide_2.4 stub entries (#30456)
Addtions to porting_guide_2.4

* deprecated notice for win_package return values
* Added vars plugins, config api, inventory plugins.  These were mostly backwards compatible.
  Added notes for users and devs to check out new features once i write the 'feature docs' I'll
  come back and link to them from here
(cherry picked from commit 5a256dd1c0)
2017-09-17 16:57:54 -07:00
Toshio Kuratomi
28da5199c4 List all of the new plugins 2017-09-17 12:12:50 -07:00
James Cammarata
946515af66 Cleaning up use of include: in docs (#30466)
* Cleaning up use of include: in docs

Switching to import_*/include_* instead.

* Update playbooks_best_practices.rst

* Fix rst syntax

(cherry picked from commit 366a9d861f)
2017-09-17 11:27:53 -07:00
Toshio Kuratomi
3af68ec8a8 List the new lookup plugins for 2.4 in changelog 2017-09-17 09:38:30 -07:00
Toshio Kuratomi
d25106e387 New release v2.4.0.0-0.4.rc4 2017-09-16 11:28:34 -07:00
Anil Kumar Muraleedharan
b285dc1f4f Resolving bug on CNOS Image download on multiple devices.
(cherry picked from commit 1921eaf096)
2017-09-16 10:54:19 -07:00
John R Barker
6e77a3ac3a Porting Guides 2.4 (#24539)
* Porting Guides for Ansible Versions

Improve the user facing documentation.
Tell people what changes they need to make

* More porting guides

* Link porting guides from TOC

* Link porting guides from CHANGELOG.md

* typo in link

* Review feedback

* Better CHANGELOG links

* Better links

* code blocks

* Minor changes

* Correct links, comment out network section in 2.4

* Typos

* Revert non 2.4 changes

* Add placeholders for other items

* multiple inventory

* Update porting_guide_2.4.rst

* Update porting_guide_2.4.rst

* Update porting_guide_2.4.rst

* Update porting_guide_2.4.rst

* add win_command/win_shell escaping notes

* Added some windows porting info

* Edit for grammar

* Correct links, delete Net Platform Agnostic

* 2.5 link

* Network changes in 2.4

* facts_namespacing was pushed back to 2.5

Due to lack of time we pushed this back to 2.5 so that the facts in the namespace could be shortened.

* Python version

* Remove FIXMEs - move to seperate PR

(cherry picked from commit 785e604c57)
2017-09-16 10:42:45 -07:00
Matt Davis
f5e237d038 CommandUtil C# API tweaks (#30453)
* changed RunCommand result from Tuple to CommandResult for easier future extensibility
* moved Win32 Dictionary->multi-null-string environment munging into C#
(cherry picked from commit 0e70057f56)
2017-09-16 00:13:51 -07:00
Matt Davis
c8dcf5117a Various fixes to azure_rm_virtualmachine for managed disks and allocated. (#30450)
* fixes #30194
* fixes #30193
* fixes #29662
* fixes #28859
(cherry picked from commit c12c7a72ed)
2017-09-16 00:13:51 -07:00
Matt Davis
5dec3d7386 2.4 azure_rm_virtualmachine test move 2017-09-15 23:47:52 -07:00
Matt Davis
df361dc83f azure_rm_dnsrecordset rewrite (#30449)
As-merged, had several issues that prevented idempotent usage. Some args were defined at the wrong UI level. Dual-state args didn't match up with typical Ansible UI.
(cherry picked from commit 6b5b465125)
2017-09-15 18:16:31 -07:00
Matt Clay
e9668289e8 Fix PEP 8 issue.
(cherry picked from commit 61dd5517c3)
2017-09-15 15:12:18 -07:00
Brian Coca
2b8508f471 deprecated include
added docs for new actions that take over include duties

(cherry picked from commit 8799038a89)
2017-09-15 13:21:00 -07:00
Brian Coca
a725b62f51 clear correct cache when reconcile is invoked
moved it to ensure all callers get the correct hosts after

(cherry picked from commit fc9b44e021)
2017-09-15 12:59:03 -07:00
Nathaniel Case
eeba998592 nxos_install_os install_state fix
(cherry picked from commit 7dc60c3f24)
2017-09-15 12:37:12 -07:00
Kedar K
06a066fe1b Test Role: Adds nxos_pim_rp_address integration test role (#29958)
*   Adds nxos_pim_rp_address integration test role for group_list,
  prefix_list and route_map (cli and nxapi)

*  * Adds explicit removal of static RP configs to match cli behaviour

*  * Removes config deletion using nxos_config module (for 2.4 only)

*  * Attempt short and long delete config command
 * Add a platform check for N3K for bidir

(cherry picked from commit 7e58661335)
2017-09-15 12:06:03 -07:00
Kedar K
e22a96c00a Fixes nxos_pim_rp_address module idempotence (#29620)
* Fixes nxos_pim_rp_address module idempotence

*  * Adds a note in header comment to indicate no support for absent state

(cherry picked from commit ff84fc969c)
2017-09-15 12:06:03 -07:00
Brian Coca
5d8bc210bf fixed issue with default callback inheritance (#30427)
* fixed issue with default callback inheritance

 - callbacks need to document same options as callbacks they inherit from to get them configured
 - since default is also used by many 3rd party callbacks for inheritance, making the code 'tolerate' the missing docs
   and fallback to using the direct constant to configure it's options.
(cherry picked from commit 81fd67c10f)
2017-09-15 11:15:06 -07:00
Nathaniel Case
94d172fef4 Raise an error if ansible_network_os is not specified (#30429)
(cherry picked from commit 5d404af76e)
2017-09-15 11:13:04 -07:00
Brian Coca
3660afe677 typo fix
(cherry picked from commit f87d0b3502)
2017-09-15 10:33:39 -07:00
Mike Wiebe
c73e1b5e68 Fix nxos_snmp_community idempotence issue (#30388)
* Fix nxos_snmp_community idempotence issue

* Use passed in name to filter

* Test updates and remove unused method

(cherry picked from commit 9af6dc4751)
2017-09-15 07:52:44 -07:00
Abhijit Menon-Sen
91e1a5fe16 Don't expect (postgres) SERVER_VERSION to be M.N (#30417)
It could be something like '10beta4', which StrictVersion() would
reject. When Postgres 10 is released, it will be '10', which
StrictVersion() would STILL reject.

Fortunately, psycopg2 has a 'server_version' connection attribute that
is guaranteed to be an integer like 90605 for version 9.6.5, or 100000
for version 10. We can safely use this for version-specific code.
(cherry picked from commit 0addd53926)
2017-09-15 07:29:23 -07:00
Ricardo Carrillo Cruz
b14e0cbfe4 Set hostname to 'switch' on nxos_system teardown (#29126)
On setup we set it to 'switch', so teardown should be 'switch'.
Also, using inventory_hostname breaks the test, since in our CI
it's a long UUID string, which exceeds the 32 chars maximum for setting
a hostname on NXOS.
(cherry picked from commit 2304706bd3)
2017-09-14 22:21:06 -07:00
Ricardo Carrillo Cruz
3f6ba180fc Set hostname to 'switch' on nxos_config toplevel setup/teardown tasks (#29127)
Using inventory_hostname breaks in our CI, as the inventory_hostname
translates to a long UUID, exceeding the maximum length for a NXOS
hostname.
(cherry picked from commit 8b6e3272f2)
2017-09-14 22:21:06 -07:00
Trishna Guha
cde49268e2 run banner exec test only for NXOS7K (#29041)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 064bb66e6d)
2017-09-14 22:21:06 -07:00
James Cammarata
8d5afd1891 Fixing two bugs with import_role (#30398)
1) import_role was never resulting in a static inclusion of the role
   tasks due to a logic error.
2) no error was raised when import_role tried to use a with loop, resulting
   in a strange error down the execution path.
(cherry picked from commit cd2774af78)
2017-09-14 20:19:42 -07:00
Brian Coca
47faa46eaf remove dupe deprecation on config (#30364)
* remove dupe deprecation on config

also move failed typing to same place to use 'standard' display vs hack.

(cherry picked from commit c027ad943e)
2017-09-14 14:34:12 -07:00
James Cammarata
5dc7dae565 Correctly create include_role blocks when using loops (#30372)
Also fixes instances where conditionals or other variables may result in
hosts executing lists of tasks of differing sizes.

Fixes #18748
(cherry picked from commit 6730f81024)
2017-09-14 14:31:35 -07:00
Mike Wiebe
cc81d1e1c3 Rel240/fix nxos pim interface (#29885)
* fix nxos_pim_interface

* Add integration test coverage and fix unit test

* Add clarifying comments

* Make ansibot happy

(cherry picked from commit 173c41aefe)
2017-09-14 14:30:43 -07:00
Mike Wiebe
72d2c8ecab Fix nxos_interface error for nxapi and idempotence problem (#29136)
* Fix nxos_interface nxapi error and idempotence

* Make shippable happy

(cherry picked from commit 3faba93a2b)
2017-09-14 14:30:43 -07:00
rahushen
0163f173a7 fixes #27177 - nxos_aaa_server_host multiple issues (#29103)
(cherry picked from commit 37f68bffc0)
2017-09-14 14:30:43 -07:00
Toshio Kuratomi
ee1134be95 Document boolean default value treatment (#30062)
* Consistency and document treatment of default bool values

* Document that default bool values can be any Ansible recognized bool.
  choose the one that reads better in context
* For fragments used by the copy module, make bool types use type=bool and not choices

* Edit for clarity

(cherry picked from commit 8a2f069468)
2017-09-14 13:27:48 -07:00
Brian Coca
2123ed44e4 fixed 'typing' for deprecated get_config
(cherry picked from commit 7a12314d54)
2017-09-14 13:21:15 -07:00
Ganesh B. Nalawade
afbcbf81b7 Use safe_load to load yaml
Replad `yaml.load` with `yaml.safe_load`

(cherry picked from commit 8c3bf20a13)
2017-09-14 11:20:08 -07:00
Martin Krizek
6294f3ebfe Add sudo/su become_methods for become tests (#30266)
* Add sudo/su become_methods for become tests

* Fix test on osx

(cherry picked from commit dc5f83c09b)
2017-09-14 09:18:42 -07:00
Mark Goddard
7794b1e465 Fix Dell OS network module timeout (#30355)
The dellos action plugins should add the remote address of the switch
provider to the play context. This was fixed in issue #23589 in an
almost identical manner for the eos, ios, iosxr, and vyos action
plugins.

Fixes: #30350
(cherry picked from commit ac69fcccdc)
2017-09-14 09:11:20 -07:00
Nathaniel Case
f25f03b539 Generalize nxos_bgp event-history detection (#28890)
* More general handling of event-history

* Update unit tests

(cherry picked from commit f84ff216b6)
2017-09-14 09:05:21 -07:00
Brian Coca
ae59390321 better error on bad playbook encoding
(cherry picked from commit 1950bcc14e)
2017-09-14 08:55:40 -07:00
John R Barker
2439dc24e9 Specify default delay (DOCUMENTATION only change) (#30344)
* Specify default delay

Also clarify that tx_rate is in bps

* aggregates -> aggregate

(cherry picked from commit 4c9ad00c50)
2017-09-14 07:43:27 -07:00
Ganesh B. Nalawade
a886b2b11e Set default value for provider transport
Fixes #30331
Set defualt value of provider to avoid
behaviour change before and after sub spec
validation was added as part of PR #28894
2017-09-14 07:38:32 -07:00
Patrick Ogenstad
8a10472a3d Fix to not warn for context and passwords
The parameters 'context' and 'passwords' were wrongly marked as being
deprecated.
2017-09-14 00:02:19 -07:00
Toshio Kuratomi
02094eed71 Fix regression in format of lvm facts (#30326)
lvm information should not have leading whitespace in the key names

Fixes #30006
(cherry picked from commit 62f49120cd)
2017-09-14 00:01:01 -07:00
Jordan Borean
83a74213b1 updated test not that module util checks the path is valid (#30321) 2017-09-13 19:11:55 -07:00
Abhijeet Kasurde
a0e8634fea Correct sl_vm documentation (#29433)
Fix corrects sl_vm documentation from wait_timeout to wait_time

Fixes: #29395

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit b3cba957e0)
2017-09-13 16:24:19 -07:00
Ricardo Carrillo Cruz
34e624ad9e Add CLI provider with authorize yes to ios tests (#30312)
We are getting failures to do lack of elevated privileges.
(cherry picked from commit dbe9df1289)
2017-09-13 15:32:41 -07:00
Toshio Kuratomi
6771ade86a New release v2.4.0.0-0.3.rc3 2017-09-13 14:16:03 -07:00
saichint
74d2e003ac nxos_udld_interface: improve interface detection (#28682)
* fix for nxos_udld_interface

* Tested Note added back

(cherry picked from commit 4e32c92166)
2017-09-13 14:06:36 -07:00
Nathaniel Case
c07d435781 nxos_snmp cleanup (#28922)
* Clean up nxos_snmp_contact & nxos_snmp_location

* Bring nxos_snmp_community in line

* Bring nxos_snmp_host in line

* And I would have gotten away with it too,

if it weren't for those meddling sanity tests

* Bring nxos_snmp_traps & nxos_snmp_user in line

* Appease Shippable

(cherry picked from commit 8c03609e54)
2017-09-13 14:06:36 -07:00
rahushen
f815b29a00 Fixes #28793, #27484 (#29745)
(cherry picked from commit 1a266e29a7)
2017-09-13 14:06:36 -07:00
rahushen
f054d08422 Fixes #28493 (#29061)
(cherry picked from commit 169fbc4c94)
2017-09-13 14:06:36 -07:00
Marek Hulan
8d305461fb Fix sending facts to Foreman
(cherry picked from commit 9ad90de4bc)
2017-09-13 13:59:06 -07:00
Mike Wiebe
0130da1773 Fix nxos_overlay_global networking modules (#28943)
(cherry picked from commit 7292dd20ed)
2017-09-13 13:45:00 -07:00
rahushen
ef9c3eb628 fixes #27066 - nxos_acl errors when there are 0 or 1 access lists configured (#29076)
* fixes #27066

* replace type() with isinstance()

(cherry picked from commit 5537218c94)
2017-09-13 13:43:16 -07:00
Toshio Kuratomi
56852b0a35 Add ec2_remote_facts replacement to changelog
(cherry picked from commit c77e3a74dd)
2017-09-13 13:09:48 -07:00
Matt Clay
57683caa44 Improve ansible-test HttpClient error handling. (#30301)
- Automatic retries on DNS lookup failures.
- Handle API errors in shippable.py.
(cherry picked from commit 1a602096f5)
2017-09-13 13:09:42 -07:00
Will Thames
04cc8a9468 [cloud] Don't alter dictionary during iteration in elb_target_group_facts, avoiding RuntimeError (#30247)
Don't update the target_group_attributes dict
while iterating over it.

Fixes #30190
(cherry picked from commit fd18d7ebb5)
2017-09-13 11:37:30 -07:00
Toshio Kuratomi
692942b37a Update changelog with 2.3.x changes 2017-09-13 11:35:08 -07:00
Sloane Hertel
fa1166dc37 [cloud] ec2_group: Handle duplicate names between EC2 classic and VPC groups (#28931)
* ec2_group: Handle name conflict with empty vpc_id.

If several groups exist with the same name (and vpc_id is None) then
treat the group outside the vpc as preferred (same as it would for a vpc
group with vpc_id specified). Also don't run the egress rules code in
that case.

* Handle lack of `IpPermissionsEgress` attribute on EC2 classic groups

In EC2 classic groups, the `while True` loop checking for egress
permissions will continue infinitely.

* Handle incompatible combinations of EC2 Classic + VPC groups

* Fix integration tests in accounts lacking EC2 classic

This change checks against the security group created, instead of the
module parameters, for VPC ID. This means that new accounts with a
default VPC will still wait properly for the first egress rule to
populate.

* Fix conditional for storing described groups with preference for matching VPC IDs

* Revert `vpc_id is None` on conditional to allow for default VPCs

(cherry picked from commit 4bc4abfe1b)
2017-09-13 11:21:18 -07:00
Jordan Borean
328689a15b windows command changed to use CreateProcess (#30253)
* windows command changed to use CreateProcess

* change to get become to work

(cherry picked from commit 6d196eaa98)
2017-09-13 10:52:31 -07:00
Matt Davis
5fdffe26ee CHANGELOG update for win_shell/command parsing fixes 2017-09-13 10:44:06 -07:00
Andrea Tartaglia
91f4925de2 Updated Display.do_var_prompt to use to_native on prompt ( Fixes #30265 ) (#30285)
* Updated Display.prompt to use the normalized prompt message.

(cherry picked from commit ea8af15dfe)
2017-09-13 09:58:46 -07:00
James Cammarata
6e766c032a Fix conditional inheritance on dynamic includes (tasks and roles) (#30178)
Per the new style of execution, for dynamic tasks conditionals are expected
to only affect the include task itself and should not be inherited by child
tasks. This patch brings the behavior inline with this expectation.

Fixes #27845
(cherry picked from commit b38f746604)
2017-09-13 09:55:08 -07:00
Adrian Likins
869abfa541 Remove some non-ascii chars from strings
quote some unwieldy strings, etc.

(cherry picked from commit b2ac60cfd7)
2017-09-13 09:24:12 -07:00
rahushen
d9acf07150 Fixes #27336 - nxos_gir_profile_management issue while creating profile (#29151)
* Fixes #27336

* Correct documentation errors

(cherry picked from commit f1cc5a928c)
2017-09-13 09:15:06 -07:00
rahushen
4bf6b9aa27 Fixes #27138 (#29064)
(cherry picked from commit bc6e015a86)
2017-09-13 09:15:06 -07:00
Trishna Guha
1f9495cfaa fix nxos_file_copy and provider getting set to None when transport is cli (#30262)
* nxos_file_copy bug fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* provider gets set to None in module level when transport is cli

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

(cherry picked from commit 578ae3b238)
2017-09-13 09:15:06 -07:00
rahushen
bcfc78b2e4 NXOS Commit Integration tests to Ansible (part 1) (#28935)
* cleanup nxos_bgp_neighbor_af tests

* add timeout and to_json to nxapi testing for nxos_command

* maintain folder naming consistency with other tests

(cherry picked from commit caafc8e591)
2017-09-13 09:01:01 -07:00
Ganesh Nalawade
aca0d1a2f8 Fix ios_system lookup enable issue (#30263)
Fixes #29974

Add `None` check while comparing module parameter values (want) with the actual
configuration present on device (have).
(cherry picked from commit d8371cec91)
2017-09-13 08:55:54 -07:00
Jordan Borean
ba30a8e4c7 fixed become to show the stdout and stderr streams instead of the StreamReader (#30254)
(cherry picked from commit 77b2aca5a2)
2017-09-13 08:54:16 -07:00
Martin Krizek
50d8b390d1 yum: revert incorrect change from 0bbd5c7458 2017-09-13 08:51:55 -07:00
Mike Wiebe
9fc409e126 Fix nxos_mtu nxapi failure (#30153)
(cherry picked from commit cef7ed0310)
2017-09-12 22:43:41 -07:00
Toshio Kuratomi
f1aa2a4803 Add azure module deprecation to changelog 2017-09-12 15:12:37 -07:00
Matt Davis
9dbad4109f deprecated azure classic module (#30241)
(cherry picked from commit 212bb76326)
2017-09-12 15:12:33 -07:00
Jacob McGill
f13bf9893a ACI EPG TO DOMAIN: Add vm_provider docstring and add support for micr… (#29114)
* ACI EPG TO DOMAIN: Add vm_provider docstring and add support for microsoft and openstack

* Fix typo

* Fix whitespace

(cherry picked from commit 2489eeece0)
2017-09-12 14:54:09 -07:00
Mike Wiebe
ebdbc926ce Fix nxos_smu error (#30157)
(cherry picked from commit f973f93963)
2017-09-12 14:19:30 -07:00
Jordan Borean
13321de19d windows facts: better way to get machine SID (#29821)
* windows facts: better way to get machine SID

* remove the substring and just get the property that contains the value we need

(cherry picked from commit f6858cdd4d)
2017-09-12 13:41:20 -07:00
Martin Krizek
0bbd5c7458 yum: fallback to epoch=0 if not available
(cherry picked from commit 59702318e1)
2017-09-12 13:31:07 -07:00
Ricardo Carrillo Cruz
2f3c1867f7 Use 'hostname switch' on setup/teardown tasks for nxos_config non_idempotent (#29132)
inventory_hostname breaks CI due to too long string.
(cherry picked from commit 497e6cf405)
2017-09-12 11:52:33 -07:00
abirami-n
3483040a17 module_utils_fix_dellos6 (#28060)
(cherry picked from commit adc533804a)
2017-09-12 10:29:12 -07:00
Raja Venkataraman
c92f44a806 Handle wait_for_deployment_completion during Azure deployment. (#26079)
Pull the get_poller_result inside the if block so that if the caller has
wait_for_deployment_completion=False, it doesnt block and wait for it to
finish.

Also, since the result contains information about the deployment, provide
None values for it in the output.(Not sure if this needs to be documented)

Fixes #26014
(cherry picked from commit c0000bc722)
2017-09-12 10:15:52 -07:00
Brian Coca
77d1935f61 only eval values if set from defaults
(cherry picked from commit a2b3bb1e49)
2017-09-12 10:05:38 -07:00
Nicklaus McClendon
016b323735 Updated pip module to always return changed if venv is created (#24233)
* Updated pip module to always return changed if venv is created

Fixes #23204

* Add integration test to pip (see #23204)

(cherry picked from commit 6dbc3c63f8)
2017-09-12 10:01:57 -07:00
Matt Davis
d2f879a266 support missing drive letters in PS path type (#29884)
* fixes #26623
* Test-Path (and thus `-type path` in Get-AnsibleParam) fail on a nonexistent drive letter, since it can't be mapped to a PSProvider.
* added support and basic smoke tests for
(cherry picked from commit 1e2ce4c8ab)
2017-09-12 09:56:16 -07:00
Anil Kumar Muraleedharan
2790df7d1c Bug Fixes for Vlan Name not assigned and Switch Error (#29953)
(cherry picked from commit 32f0c9f809)
2017-09-12 08:27:34 -07:00
Ricardo Carrillo Cruz
2f0144b26a Ignore routes that are not static manually added (#29094)
Fixes #28841
(cherry picked from commit f9f0472ba5)
2017-09-12 08:26:26 -07:00
Ricardo Carrillo Cruz
4067c3616c Fix nxos_user tests (#30048)
On our CI we use SSH port 8022, so parameterized the test passing
-p {{ ansible_ssh_port }}.
Also, force user/pass auth.
(cherry picked from commit b30cd60829)
2017-09-12 08:26:18 -07:00
Lorin Hochstein
36f5471f8c Document return values for ec2_vpc_net.py (#21294)
* Document return values for ec2_vpc_net.py

* Prepend "vpc" to return values
2017-09-12 07:42:16 -07:00
Andrea Tosatto
61acd35da4 make os_security_group_rule idempotent (#23707)
* Fix issue #19610
(cherry picked from commit 6b6e5665aa)
2017-09-12 07:24:29 -07:00
Ricardo Carrillo Cruz
7b3999560b Remove provider lines from iosxr tests (#29956)
We don't use authorize on iosxr nor we use a special transport,
so no need to use iosxr for CLI at all.
(cherry picked from commit 1da7194534)
2017-09-12 07:24:28 -07:00
Trishna Guha
9107a9904b nxos_system parse name_servers fix (#29944)
* nxos_system parse name_servers fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix nxos_system tests

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

(cherry picked from commit 5b1c91bf19)
2017-09-12 07:23:26 -07:00
Trishna Guha
7d982f9225 nxos_command and nxos_config fix (#29940)
* fix nxos_command nxapi test output

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 9dee5c65ce88912b1bd28e75d85dd7331420f823)

* nxos_config CI fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 8810a7e58457b35fe269101075986d57030342f4)
2017-09-11 22:24:15 -07:00
Toshio Kuratomi
8fd3ce0fec New release v2.4.0.0-0.2.rc2 2017-09-11 20:01:16 -07:00
Sloane Hertel
73304f50a3 ec2: fixes #19521, fixes #29456 - create instance-store AMI instances with correct shutdown behavior (#28885)
* Create instance-store AMI instances with 'terminate' as the shutdown behavior since it is required.

* Match on the error code instead of searching for a string in the message.

* Narrow conditional to only fix shutdown behavior if fixing it would help

* Fix pep8.
2017-09-11 19:54:35 -07:00
Toshio Kuratomi
0d2154646f Port ansible doc for plugins to use DOCUMENTATION variables
* Using docstrings conflicts with the standard use of docstrings
* PYTHON_OPTIMIZE=2 will omit docstrings.  Using docstrings makes future
  changes to the plugin and module code subject to the requirement that we
  ensure it won't be run with optimization.

(cherry picked from commit cc343a4376)
2017-09-11 18:35:29 -07:00
Matt Clay
b4e4a44314 Fix pylint issue.
(cherry picked from commit 4de6076d78)
2017-09-11 18:11:36 -07:00
Brian Coca
525c318678 module and vault fixes (#29663)
* module and vault fixes

- fix module_path cli option and usage, which fixes #29653
- move --output to be in subset of vault cli, no need for all vault enabled cli to use it
- added debug to loader to see directories added

(cherry picked from commit 2165bac212)
2017-09-11 18:07:23 -07:00
Dylan Silva
527380ac91 Fix bugs with modules_support.rst
(cherry picked from commit 88aa0b7645)
2017-09-11 17:33:36 -07:00
Matt Clay
0742e58e78 Fix ansible-test unicode and sanity tests. (#29743)
* Show warning when using pylint on Python 2.6.
* Add pylint disable entries for Python 2.
* Fix unicode handling in ansible-test.
* Add missing documentation.

(cherry picked from commit 79bc49e150)
2017-09-11 17:31:29 -07:00
Matt Clay
525c2a3e85 Expand disabled pylint rules. (#29162)
* Expand disabled pylint rules.
* Fix pylint and unicode issues in ansible-test.
(cherry picked from commit f88750d665)
2017-09-11 17:31:26 -07:00
Toshio Kuratomi
404b02a1cb Add python3 fixes to changelog 2017-09-11 15:48:37 -07:00
Abhijeet Kasurde
46f75e0f3d Refactor easy_install module
* PEP8 fix
* Rectified string check in package install command stdout
* Add abadger's code review changes

Fixes #22245

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit b5eca624d0)
2017-09-11 15:46:12 -07:00
Tim Rupp
670b09224f Adds missing docs and downstream fixes (#29664)
Partition docs are not a documentation fragment, so they need to
be added
(cherry picked from commit a36ebd979d)
2017-09-11 15:36:51 -07:00
Jordan Borean
e842ac4e3f win_unzip: added support for Server core by using .net zip functions (#29272)
* win_unzip: added support for Server core by using .net zip functions

* fixed unzip behaviour with folders

(cherry picked from commit 5623e679b8)
2017-09-11 15:35:11 -07:00
Sloane Hertel
c3bf59eb79 ec2_vol: wait for delete_on_termination to be set to the correct value. Fixes #22534. (#28848)
wait for delete_on_termination to be set to the correct value, it can take some time to correctly reflect the setting sent in the API call.
2017-09-11 14:37:30 -07:00
Will Thames
1586274fe5 Use JSON returns values to create RETURN docs
After running hacking/test-module to generate some output,
the JSON output can be fed into the return skeletion generator
to create an excellent starting point for RETURN docs

(cherry picked from commit 5e978b0f2b)
2017-09-11 14:33:29 -07:00
Christian Pointner
cc995a2477 openssl_csr: consistent param namings (#29604)
* harmonize openssl-csr argument names

* the module has been introduced by 2.4 not only the privatekey_passphrase

(cherry picked from commit 177ce3014c)
2017-09-11 14:11:59 -07:00
Adam Miller
1c7a91a725 refactor firewalld module with object abstraction (#26487)
* refactor firewalld module with object abstraction

This change creates a FirewallTransaction object that each
individual transaction type is a sub-class of as they all follow the
same pattern to enable or disable something in the firewall.

Also, there's a few bugfixes here:
    - Fix the "source" type to handle permanent operations
    - Remove ambiguity of required parameters for only specific use
      cases that can lead to transactions effectively being a no-op.
      Instead, pick sane defaults and document them.
    - Change how imports are done so globals are no longer needed

This is based on the original feedback by Toshio from the last
refactor attempt:

    https://github.com/ansible/ansible-modules-extras/pull/3383

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>

* fix line too long for pep8 for shippable tests

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>

* remove firewalld from pep8/legacy-files

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>

(cherry picked from commit 75127092f2)
2017-09-11 14:10:37 -07:00
Brian Coca
34db3cd9be allow config for callbaks and some fixes
* only complain about ini deprecation if value is set
 * set plugin config for stdout and other types
 * updated plugin docs, moved several plugins to new config
 * finished ssh docs
 * fixed some issues seen in plugins while modifying docs
 * placeholder for 'required'
 * callbacks must use _plugin_options as _options already in use

(cherry picked from commit 869a318492)
2017-09-11 14:00:32 -07:00
Toshio Kuratomi
61315cd3c5 Remove use of unicode_literals as it is an anti-pattern
from __future__ unicode_literals leads to developer confusion as
developers no longer can tell whether a bare literal string is a byte
string or a unicode string.  Explicit marking as u"" or b"" is the way
to solve the same problem in the Ansbile codebase.

(cherry picked from commit ff13d58c14)
2017-09-11 13:34:21 -07:00
Martin Krizek
baec8cf95a dnf: add environment upgrade test
(cherry picked from commit 0daacdccf8)
2017-09-11 11:45:44 -07:00
Toshio Kuratomi
d396351817 Change ansible-doc usage to show -a is for internal use (#29603)
* Change ansible-doc usage to show -a is for internal use

ansible-doc -a is for testing that documentation is sane.  It should not
be used by normal users in production.  The main reason for this is that
it is designed to fail if there are any undocumented modules or plugins.
This is good for testing that all plugins we ship are documented.  It is
not good for end users who may have undocumented third-party plugins.
(cherry picked from commit cfaea8a053)
2017-09-11 11:27:05 -07:00
Toshio Kuratomi
305d5b4d5f Define byte strings versus text strings in docker connection
Fixes python3 string handling in the docker connection plugin

Fixes #24776

(cherry picked from commit 3277e6328b)
2017-09-11 09:55:31 -07:00
Martin Krizek
5db6b61cf0 dnf: fix TypeError when env/group failed
(cherry picked from commit de299ef77c)
2017-09-11 09:39:23 -07:00
Brian Coca
f64c55e58f fix cs_zone_facts tests, namespace feature removed (#29184)
* fix cszonefacts .. namespace feature removed

* also removed the 2nd instance of ansible_facts

(cherry picked from commit 444a5b5389)
2017-09-11 09:38:44 -07:00
Trishna Guha
557cf0d17a rename nxos test basic-no-exec to basic-no-motd (#29144)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 2ff9888923)
2017-09-11 09:13:27 -07:00
Trishna Guha
91ca89063c nxos_banner CI fix (#29134)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 588bddbc35)
2017-09-11 09:13:27 -07:00
Trishna Guha
9f4b8d115a Disable nxapi test for nxos_banner (#29088)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 757983d808)
2017-09-11 09:13:27 -07:00
Matt Martz
c439b9e009 Create a new pipe for sshpass on retries. Fixes #29095
(cherry picked from commit d043ba2673)
2017-09-11 08:49:34 -07:00
John R Barker
c47da38d43 Update docs version string
Hack until https://github.com/ansible/ansible/issues/28553 is fixes
2017-09-11 07:52:35 -07:00
Ricardo Carrillo Cruz
b9a4fdd616 Fix handling of config vars with eval expression (#29536)
The config variables defined with eval, like INVENTORY_IGNORE_EXTS,
are not stored properly once the eval is processed.
This causes references to the constant to still have the eval in the
value.
(cherry picked from commit f0aa31b49e)
2017-09-11 07:22:48 -07:00
Jonathan Karras
54cfca0ea3 Fixes #20443 - Adjust version checking regex to account fo no comma in IOS-XE (#29157)
* Adjust version checking regex to account fo no comma in IOS-XE
* Adjusted regex to include last character of version number

(cherry picked from commit e5d247fdc0)
2017-09-11 07:08:55 -07:00
Matt Clay
18db4089a7 Fix wheel dependency on python 2.6. (#29388)
* Fix wheel dependency on python 2.6.
* Limit wheel version for tox on python 2.6.

(cherry picked from commit 50ae33d3c1)
2017-09-11 07:01:04 -07:00
Ganesh Nalawade
3aa1cedc4a Add check for port and host in ios_interface (#29119)
Fixes #29118
(cherry picked from commit 772dab55c6)
2017-09-11 07:00:29 -07:00
Erwin Oegema
993eedaa94 Fix section in known_hosts documentation
SSHD is part of section 8, SSH is part of section 1.
(cherry picked from commit 61d2620098)
2017-09-10 20:25:37 -07:00
Will Thames
51a9875cfd Handle missing docker-py better (#27540)
* Update docker inventory to use APIClient

docker-py has been updated, and the `Client` class no longer
exists. We use the new `APIClient` class.

To provide graceful failure when docker-py is not installed,
we need to create a dummy `Client` class so that the inventory
script will get as far as displaying a useful error message

Before

```
$ contrib/inventory/docker.py --pretty
Traceback (most recent call last):
  File "contrib/inventory/docker.py", line 418, in <module>
    class AnsibleDockerClient(Client):
NameError: name 'Client' is not defined
```

After

```
$ contrib/inventory/docker.py --pretty
Failed to import docker-py. Try `pip install docker-py` - cannot import name Client
```

* docker inventory configuration file location

Allow docker.yml to live next to docker.py, as well as in the
current directory

(cherry picked from commit f9a179f770)
2017-09-10 19:07:16 -07:00
Brian Coca
b62c60ef86 remove fact namespacing
since we want to make namespaced facts drop ansible_ prefix but don't have the
time before release to perfect this feature, we are going to postpone it for now
until we have the resources to fix this issue. That way we won't have people relying
on the 'incorrect' names for a release.

(cherry picked from commit 0c291ece1a)
2017-09-10 14:47:44 -07:00
Andrew Saraceni
db363160a6 Fix SID Lookup Issues on Assorted Windows Modules (#28979)
* fix sid lookup issues and update copyright/license to latest format

* simplify win_owner and win_share by removing unnecessary function

(cherry picked from commit 8f050d3719)
2017-09-10 14:45:23 -07:00
William Griffiths
b4c7812747 consul + Python 3.5 (#23935)
* Fix #23934 - consul + Python 3.5
* List comprehension instead of filter with lambda

(cherry picked from commit ab7c850360)
2017-09-09 18:41:25 -07:00
Miguel Ángel Ajo
738f08d627 Fixes #23680 bug with py3.x due to binary string handling (#23688)
* This commit includes a unit test to exercise the _is_role
function and make sure it doesn't break in any Python version.
* Import os.path and other minor fixups

(cherry picked from commit 8e4f112b39)
2017-09-09 18:40:30 -07:00
Tomas Tomecek
a0989d125d conn,buildah: don't pass bytes to shlex.split (#27896)
* conn,buildah: don't pass bytes to shlex.split on python3
(cherry picked from commit 0274835add)
2017-09-09 17:41:05 -07:00
Toshio Kuratomi
8eab6a43f7 Fix set theory filters for python3
The set theory filters need to use lists rather than generators on python3.

Also add unit tests for most of the mathstuff filters

Fixes #26494

(cherry picked from commit 75249e311e)
2017-09-09 17:40:55 -07:00
Toshio Kuratomi
4e5051fe00 Romain dartigues fixes (#29169)
* cloud: azure: fix typo introduced in commit 16d23e9

The commit "Add reference to VNET resource group (#26052)"
removed an used variable.

* network: aos: error hint never shown

(cherry picked from commit 6797221107)
2017-09-09 16:21:20 -07:00
Anton Baklanov
1478d0fcf3 Fixes #26793: convert insert regex to_bytes before searching
(cherry picked from commit fcad4f38b4)
2017-09-09 12:49:24 -07:00
Kevin Hulquest
75309386d7 Update qos parameter for volume manager and update example. (#27594)
(cherry picked from commit 2bab91551d)
2017-09-09 12:29:32 -07:00
Pierre Guinoiseau
0521f9d26f Fix py3 string issue in jail connection plugin (take 2) (#28374)
* Fix py3 string issue in jail connection plugin

(cherry picked from commit 436b173b24)
2017-09-09 11:53:07 -07:00
Abhijeet Kasurde
80b41165cb Misc typo corrections
Fix adds correction for typos

* Anisble to Ansible
* Fasle to False

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 8f6626bd8f)
2017-09-09 10:26:30 -07:00
s-hertel
dbcdf97252 ec2_group: unnest variable assignment. Fixes #29113.
(cherry picked from commit 0ac4a82f3b)
2017-09-09 10:20:42 -07:00
s-hertel
972fbbba22 cloudtrail: import botocore.exceptions in a try/except.
(cherry picked from commit 6ae201d3b1)
2017-09-09 10:11:04 -07:00
Brian Coca
63b4e41d0c fixes to config/setting retrieval
- better variable precedence management
- universal plugin option handling
- also updated comments for future directions
- leverage fragments for plugins
- removed fact namespacing
- added 'firendly name' field
- updated missing descriptions
- removed some unused yaml entries, updated others to reflect possible future
- documented more plugins
- allow reading docs using alias
- short licenses
- corrected args for 'all plugins'
- fixed -a option for ansible-doc
- updated vars plugins to allow docs
- fixed 'gathering'
- only set options IF connection
- added path list and renamed pathspec mostly the diff is , vs : as separator
- readded removed config entries that were deprecated but had no message ... and deprecated again
- now deprecated entries give warning when set

(cherry picked from commit 075ead8fb0)
2017-09-09 09:50:11 -07:00
Ross Williams
57f2fee4d9 Fixes #19666 Correct AMI information output by ec2_ami module (#27021)
Add AMI name and platform to outputs on AMI creation
2017-09-08 15:08:57 -07:00
Adrian Likins
51949fdeec generate rst doc pages for command line tools (#27530)
* let generate_man also gen rst pages for cli tools
* make template-file, output-dir, output format cli options for generate_man
* update main Makefile to use generate_man.py for docs (man pages and rst)
* update vault docs that use :option:
* Edits based on
6e34ea6242 and
a3afc78535

* add a optparse 'desc' to lib/ansible/cli/config.py

  The man page needs a short desc for the 'NAME' field
  which it gets from the option parse 'desc' value.

  Fixes building ansible-config man page.

* add trim_docstring from pep257 to generate_man

  use pep258 docstring trim function to fix up any indention
  weirdness inherit to doc strings (ie, lines other than
  first line being indented.

* Add refs to cli command actions

To reference ansible-vaults --vault-id option, use:

:option:`The link text here <ansible-vault --vault-id>`

or:

:option:`--vault-id <ansible-vault --vault-id>`

To reference ansible-vault's 'encrypt' action, use:

:ref:`The link text here <ansible_vault_encrypt>`

or most of the time:

:ref:`ansible-vault encrypt <ansible_vault_encrypt>`
(cherry picked from commit 89c973445c)
2017-09-08 12:16:33 -07:00
Adrian Likins
66a244facc change generated playbooks_keywords.rst to use an rst 'glossary' (#28843)
* Use a rst glossary for playbooks_keywords docs
* Add a 'Task' and 'Tasks' to glossary.
* Update keywords desciptions,
* use :term: rst ref, some quoting
* Make it more obvious that 'retries' and 'until' need to be used in combination.

(cherry picked from commit 52f2edf19d)
2017-09-08 12:15:22 -07:00
Rene Moser
84203a45e9 config: use path list for default inventory
This allows to use a pathlist in the ansible.cfg:

  [default]
  inventory = path/inventory:other_path/inventory

Since ansible allows to use --inventory on CLI more then once, we should also support a pathlist in the config.

(cherry picked from commit da488a8db5)
2017-09-08 11:37:48 -07:00
Willem van Ketwich
c072a5406f [cloud] EC2 AutoScaling fix for respecting zero as the desired, min&max size values (#27870) 2017-09-08 10:05:33 -07:00
Matt Clay
69721cade6 Revert "Temporarily disable failing opensuse test jobs."
This reverts commit 31d2eb0828.

(cherry picked from commit 67c7bd8745)
2017-09-08 09:56:10 -07:00
Brian Coca
a9d81ef3db Db cache fix (#29048)
* cleaner get for file based caches
* now db based facts behave like file ones
we now keep local in mem cache to avoid race conditions on expiration during ansible runs
(cherry picked from commit 13d1520f3d)
2017-09-07 09:22:34 -07:00
Jordan Borean
6d5eb06cc5 win_regedit: fixed up diff output to be more representative of type (#28974)
* win_regedit: fixed up diff output to be more representative of type

* added diff fix for creation of key and prop in one go

(cherry picked from commit 91e7c3ec81)
2017-09-07 04:07:40 -07:00
Jordan Borean
37c174b5ec win_user: add return info (#28975)
(cherry picked from commit 4a577bd67f)
2017-09-07 04:06:59 -07:00
Brian Coca
18fdc34ecf clarify import_ docs (#28395)
* clarify import_ docs

* fixed izpellz

* Copy edits.

(cherry picked from commit f4fff54f68)
2017-09-06 21:59:07 -07:00
Brian Coca
647170b040 introducing ALSO YAML inventory (#28596)
* introducing ALSO YAML inventory

* Copy edits

(cherry picked from commit c3550b58ed)
2017-09-06 21:57:24 -07:00
Matt Clay
9ff5ac344f Fix rst syntax issue in docs. 2017-09-06 20:45:56 -07:00
Brian Coca
dbc7444376 fix check mode for solaris enable/disable (#29049)
(cherry picked from commit 7804049592)
2017-09-06 18:11:57 -07:00
Dylan Silva
78cae22938 updated modules support page with new information (#29071)
* updated modules support page with new information

* Minor wording tweaks.
2017-09-06 17:15:12 -07:00
Matt Clay
294560e91e Improve handling of first CI run for new branch. (#29070)
(cherry picked from commit a1453a7917)
2017-09-06 16:40:48 -07:00
Brian Coca
5ce6066e4c less confusing 'args' message (#29053)
* less confusing 'args' message

* fix test

* gone native

(cherry picked from commit fe3b4325c2)
2017-09-06 15:33:09 -07:00
Toshio Kuratomi
39dd34f05e Revert "Remove windows tests so that we can workaround a timeout running all windows tests on shippable"
This reverts commit a61fd31e2e.

Now that shippable has run once, it won't run the complete windows tests
anymore so we don't have to worry about any timeouts anymore.
2017-09-06 15:26:41 -07:00
Toshio Kuratomi
a61fd31e2e Remove windows tests so that we can workaround a timeout running all windows tests on shippable 2017-09-06 15:25:12 -07:00
Toshio Kuratomi
e18aff861e New release v2.4.0.0-0.1.rc1 2017-09-06 13:36:33 -07:00
1202 changed files with 31308 additions and 14397 deletions

View file

@ -13,7 +13,7 @@ Also test if the latest release, and master branch are affected too.
<!--- Name of the module/plugin/task/feature -->
##### ANSIBLE VERSION
<!--- Paste verbatim output from “ansible --version” between quotes below -->
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
```
@ -27,7 +27,7 @@ Mention any settings you have changed/added/removed in ansible.cfg
##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say “N/A” for anything that is not platform-specific.
managing, or say "N/A" for anything that is not platform-specific.
Also mention the specific version of what you are trying to control,
e.g. if this is a network bug the version of firmware on the network device.
-->

View file

@ -18,7 +18,7 @@ the change does.
<!--- Name of the module/plugin/module/task -->
##### ANSIBLE VERSION
<!--- Paste verbatim output from “ansible --version” between quotes below -->
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
```

5
.gitignore vendored
View file

@ -35,9 +35,11 @@ docs/docsite/rst/*_module.rst
docs/docsite/rst/modules_by_category.rst
docs/docsite/rst/network_maintained.rst
docs/docsite/rst/partner_maintained.rst
docs/docsite/rst/playbook_keywords.rst
docs/docsite/rst/playbooks_keywords.rst
docs/docsite/rst/playbooks_directives.rst
docs/docsite/*.html
docs/docsite/rst/ansible.rst
docs/docsite/rst/ansible-*.rst
docs/docsite/_static/*.gif
docs/docsite/_static/*.png
docs/docsite/_static/websupport.js
@ -62,6 +64,7 @@ results.xml
coverage.xml
/test/units/cover-html
/test/integration/targets/*/backup/
/test/cache/*
# Development
/test/develop
venv

View file

@ -1,7 +1,622 @@
Ansible Changes By Release
==========================
## 2.4 "Dancing Days" - ACTIVE DEVELOPMENT
<a id="2.4.7"></a>
## 2.4.7 "Dancing Days" - TBD
### Bugfixes
* The fix for CVE-2018-10875 (https://access.redhat.com/security/cve/cve-2018-10875)
prints out a warning message about skipping a config file from a world
writable current working directory. However, if the user explicitly
specifies that the config file should be used via the ANSIBLE_CONFIG
environment variable then Ansible would honor that but still print out the
warning message. This has been fixed so that Ansible honors the user's
explicit wishes and does not print a warning message in that circumstance.
<a id="2.4.6"></a>
## 2.4.6 "Dancing Days" - 2018-07-05
### Bugfixes
* **Security Fix** - avoid loading host/group vars from cwd when not specifying
a playbook or playbook base dir (https://github.com/ansible/ansible/pull/42067)
* **Security Fix** - avoid using ansible.cfg in a world writable dir
https://github.com/ansible/ansible/pull/42070
<a id="2.4.5"></a>
## 2.4.5 "Dancing Days" - 2018-06-21
### Bugfixes
* **Security Fix** - Some connection exceptions would cause no_log specified on
a task to be ignored. If this happened, the task information, including any
private information could have been displayed to stdout and (if enabled, not
the default) logged to a log file specified in ansible.cfg''s log_path.
Additionally, sites which redirected stdout from ansible runs to a log file
may have stored that private information onto disk that way as well.
(https://github.com/ansible/ansible/pull/41414)
* Fix win_copy to preserve the global Ansible local tmp path instead of
deleting it when dealing with multiple files
(https://github.com/ansible/ansible/pull/37964)
* Fix Windows setup.ps1 for slow performance in large domain environments
(https://github.com/ansible/ansible/pull/38646)
* Fix eos_logging idempotency issue when trying to set both logging destination & facility
(https://github.com/ansible/ansible/pull/40604)
* Fix ios_logging idempotency issue when trying to set both logging destination & facility
(https://github.com/ansible/ansible/pull/41076)
<a id="2.4.4"></a>
## 2.4.4 "Dancing Days" - 2018-04-04
### Bugfixes
* Fix python 3 dictionary runtime error in ios_confg and eos_config
(https://github.com/ansible/ansible/issues/36717)
* Fix `win_script` to work with large arguments and removed uneeded function
that produces errors and was not needed
(https://github.com/ansible/ansible/pull/33855)
* Fix timeout when using piped ssh transfer with become
https://github.com/ansible/ansible/issues/34523
* Fix win_scheduled_task docs to correctly reflect what is required and when
(https://github.com/ansible/ansible/issues/35072)
* Updated copy test to create recursive symlink during the test and not have it
located in the git repo
(https://github.com/ansible/ansible/pull/35073)
* Fix Digital Ocean tags data type due to backend API changes no longer
acceping integers
(https://github.com/ansible/ansible/pull/33486)
* Fix for nxos_vxlan_vtep_vni issues: https://github.com/ansible/ansible/pull/34946
* Fixes for nxos_bgp: https://github.com/ansible/ansible/pull/34590
* Enable nxapi nxos_banner test: https://github.com/ansible/ansible/pull/35033
* fix vxlan idempotent issue in nxos_vxlan_vtep: https://github.com/ansible/ansible/pull/34750
* Fix win_dns_client to allow setting dynamic IP from static IP
(https://github.com/ansible/ansible/pull/35149)
* Fix azure_rm_subnet absent idempotency issues
(https://github.com/ansible/ansible/pull/35037)
* Fix azure_rm_virtualmachine creating VM with vnet in another resource group
(https://github.com/ansible/ansible/pull/35038)
* Fix nxos terminal plugin regex to support certain commands
(https://github.com/ansible/ansible/pull/35186)
* Fix network os_config modules backward diff
(https://github.com/ansible/ansible/pull/35332)
* Fix nxos_snmp_user removing encryption from user on subsequent runs of the task
(https://github.com/ansible/ansible/pull/35433)
* Fix traceback in winrm module when the ipaddress module is not installed
https://github.com/ansible/ansible/pull/35723/files
* Fix bug in `lineinfile` where the line would not be inserted when using `insertbefore` or `insertafter` if the pattern occured anywhere in the file. (https://github.com/ansible/ansible/issues/28721)
* Fix connection local getting overridden by network_cli for transport nxapi,eapi for platform agnostic modules
(https://github.com/ansible/ansible/pull/35590)
* Include dest i nthe results from file copy:
https://github.com/ansible/ansible/pull/35702/
* Fix eos_config second-level indent idempotece
https://github.com/ansible/ansible/pull/35588
* Fix the removed_in_version to 2.6 ios_config force option
https://github.com/ansible/ansible/pull/35853
* Fix memory ballooning caused as a result of task caching changes
https://github.com/ansible/ansible/pull/35921
* Fix nxos_igmp_interface for diff nxos versions
(https://github.com/ansible/ansible/pull/35959)
* Fix recursion error with many flat includes
(https://github.com/ansible/ansible/pull/36075)
* Fix win_uri to work with `creates` and `removed` option
(https://github.com/ansible/ansible/pull/36016)
* Fix the oom_killer parameter to docker_container not being honored
https://github.com/ansible/ansible/pull/34130
* Fix docker_service so a build is not triggered every time
https://github.com/ansible/ansible/issues/36145
* Be more tolerant about spaces when gathering virtual facts (https://github.com/ansible/ansible/pull/36042)
* validate add_host name parameter (https://github.com/ansible/ansible/pull/36055)
* spelling fixes (https://github.com/ansible/ansible/pull/36007)
* avoid needles vault prompt on ansible-console (https://github.com/ansible/ansible/pull/36244)
* fix callback function signatures (https://github.com/ansible/ansible/pull/35664)
* Clarify error message from convert_bool()
https://github.com/ansible/ansible/pull/36041
* Fix EC2 C5 instance_type fact to be kvm:
https://github.com/ansible/ansible/pull/35063
* Fix templating of loop_control properties:
https://github.com/ansible/ansible/pull/36124
* Fix dependency in the deb package on Ubuntu-12.04:
https://github.com/ansible/ansible/pull/36407
* Fix WinRM Python 3 encoding when getting Kerberos ticket
(https://github.com/ansible/ansible/issues/36255)
* Always show custom prompt in pause module
(https://github.com/ansible/ansible/issues/36057)
* Improve performance and recursion depth in include_role
(https://github.com/ansible/ansible/pull/36470)
* Fix using ansible_*_interpreter on Python3 with non-new-style modules
(old-style ansible python modules, modules written in another language, etc)
https://github.com/ansible/ansible/pull/36541
* Fix vyos_config IndexError in sanitize_config
(https://github.com/ansible/ansible/issues/36351)
* Fix vyos_l3_interface multiple address assignment to interfaces
(https://github.com/ansible/ansible/pull/36721)
* Protect from inventory plugins using verify incorrectly
https://github.com/ansible/ansible/pull/36591
* loop control templating
https://github.com/ansible/ansible/pull/36124
* fix debug output
https://github.com/ansible/ansible/pull/36307
* Fix credentials for Ansible Tower modules to work with v1 and v2 of the API
(https://github.com/ansible/ansible/pull/36587)
(https://github.com/ansible/ansible/pull/36662)
* Python3 fixes:
* Fix for the znode zookeeper module: https://github.com/ansible/ansible/pull/36999
* Fix for the maven_artifact module: https://github.com/ansible/ansible/pull/37035
* Add changes to get docker_container, docker_common, and docker_network
working with Docker SDK 3.x: https://github.com/ansible/ansible/pull/36973
* Ensure we install ansible-config and ansible-inventory with `pip install -e`
(https://github.com/ansible/ansible/pull/37151)
* Fix for unarchive when users use the --strip-components extra_opt to tar
causing ansible to set permissions on the wrong directory.
https://github.com/ansible/ansible/pull/37048
* Fix powershell plugin to handle special chars in environment keys as well as
int and bool values
(https://github.com/ansible/ansible/pull/37215)
* Fix error messages to not be inappropriately templated:
https://github.com/ansible/ansible/pull/37329
* Fix Python 3 error in the openssl_certificate module:
https://github.com/ansible/ansible/pull/35143
* Fix traceback when creating or stopping ovirt vms
(https://github.com/ansible/ansible/pull/37249)
* Connection error messages may contain characters that jinja2 would
interpret as a template. Wrap the error string so this doesn't happen
(https://github.com/ansible/ansible/pull/37329)
* Fix python3 compatibility bug in wait_for_connection
(https://github.com/ansible/ansible/pull/37646)
* Fix output of the interfaces_file module:
https://github.com/ansible/ansible/pull/37818/files
* Fix haproxy traceback on Python 3 https://github.com/ansible/ansible/pull/35176
* Fix the csvfile lookup plugin for python3 tracebacks: https://github.com/ansible/ansible/pull/37665
* Fix ec2 user_data parameter to properly convert to base64 on python3 (https://github.com/ansible/ansible/pull/37628)
* ansible-pull - fixed a bug checking for changes when we've pulled from the
git repository on python3 https://github.com/ansible/ansible/issues/36962
* Fix digital_ocean module unique_name parameter for a python3 bug:
https://github.com/ansible/ansible/issues/37114
* Fix a Python3 bug in the vagrant dynamic inventory script: https://github.com/ansible/ansible/pull/37631
* Fix python3 bug in the jira module: https://github.com/ansible/ansible/pull/33862
* Fix consul module's state=absent: https://github.com/ansible/ansible/issues/34628
* fix required args for nxos_snapshot: https://github.com/ansible/ansible/pull/37232
* Properly check that nxos_snapshot parameters that are required in certain circumstances are present:
https://github.com/ansible/ansible/pull/37232
* Fix error messages to not be inappropriately templated:
https://github.com/ansible/ansible/pull/37329
* Fix Python 3 error in the openssl_certificate module:
https://github.com/ansible/ansible/pull/35143
* Fix nxos enable mode
https://github.com/ansible/ansible/pull/39898
<a id="2.4.3"></a>
## 2.4.3 "Dancing Days" - 2018-01-31
### Bugfixes
* Fix `pamd` rule args regexp to match file paths (https://github.com/ansible/ansible/pull/33432)
* Check if SELinux policy exists before setting (https://github.com/ansible/ansible/pull/31834)
* Set locale to `C` in `letsencrypt` module to fix date parsing errors (https://github.com/ansible/ansible/pull/31339)
* Fix include in loop when stategy=free
(https://github.com/ansible/ansible/pull/33094)
* Fix save parameter in asa_config (https://github.com/ansible/ansible/pull/32761)
* Fix --vault-id support in ansible-pull (https://github.com/ansible/ansible/pull/33629)
* In nxos_interface_ospf, fail nicely if loopback is used with passive_interface:
(https://github.com/ansible/ansible/pull/33252)
* Fix quote filter when given an integer to quote (https://github.com/ansible/ansible/issues/33272)
* nxos_vrf_interface fix when validating the interface (https://github.com/ansible/ansible/issues/33227)
* Fix for win_copy when sourcing files from an SMBv1 share
(https://github.com/ansible/ansible/pull/33576)
* correctly report callback plugin file
* restrict revaulting to vault cli
https://github.com/ansible/ansible/pull/33656
* Fix python3 tracebacks in letsencrypt module (https://github.com/ansible/ansible/pull/32734)
* Fix ansible_*_interpreter variables to be templated prior to being used:
https://github.com/ansible/ansible/pull/33698
* Fix setting of environment in a task that uses a loop:
https://github.com/ansible/ansible/issues/32685
* Fix fetch on Windows failing to fetch files or particular block size
(https://github.com/ansible/ansible/pull/33697)
* preserve certain fields during no log. https://github.com/ansible/ansible/pull/33637
* fix issue with order of declaration of sections in ini inventory https://github.com/ansible/ansible/pull/33781
* Fix win_iis_webapppool to correctly stop a apppool
(https://github.com/ansible/ansible/pull/33777)
* Fix CloudEngine host failed (https://github.com/ansible/ansible/pull/27876)
* Fix ios_config save issue (https://github.com/ansible/ansible/pull/33791)
* Handle vault filenames with nonascii chars when displaying messages (https://github.com/ansible/ansible/pull/33926)
* Fix win_iis_webapppool to not return passwords
(https://github.com/ansible/ansible/pull/33931)
* Fix extended file attributes detection and changing:
(https://github.com/ansible/ansible/pull/18731)
* correctly ensure 'ungrouped' membership rules (https://github.com/ansible/ansible/pull/33878)
* made warnings less noisy when empty/no inventory is supplied (https://github.com/ansible/ansible/pull/32806)
* Fixes a failure which prevents to create servers in module cloudscale_server
* Fix win_firewall_rule "Specified cast is invalid" error when modifying a rule with all of Domain/Public/Private profiles set (https://github.com/ansible/ansible/pull/34383)
* Fix case for multilib when installing from a file in the yum module
(https://github.com/ansible/ansible/pull/32236)
* Fix WinRM parsing/escaping of IPv6 addresses (https://github.com/ansible/ansible/pull/34072)
* Fix win_package to detect MSI regardless of the extension case
(https://github.com/ansible/ansible/issues/34465)
* Updated win_mapped_drive docs to clarify what it is used for
(https://github.com/ansible/ansible/pull/34478)
* Fix file related modules run in check_mode when the file being operated on does not exist
(https://github.com/ansible/ansible/pull/33967)
* Make eos_vlan idempotent
(https://github.com/ansible/ansible/pull/34443)
* Fix win_iis_website to properly check attributes before setting
(https://github.com/ansible/ansible/pull/34501)
* Fixed the removal date for ios_config save and force parameters
(https://github.com/ansible/ansible/pull/33885)
* cloudstack: fix timeout from ini config file being ignored
https://github.com/ansible/ansible/pull/34854
* fixes memory usage issues with many blocks/includes
https://github.com/ansible/ansible/issues/31673
https://github.com/ansible/ansible/pull/34461
* Fixes maximum recursion depth exceeded with include_role
https://github.com/ansible/ansible/issues/23609
* Fix to win_dns_client module to take ordering of DNS servers to resolve into account:
https://github.com/ansible/ansible/pull/34656
* Fix for the nxos_banner module where some nxos images nest the output inside of an additional dict:
https://github.com/ansible/ansible/pull/34695
* Fix failure message "got multiple values for keyword argument id" in the
azure_rm_securitygroup module (caused by changes to the azure python API):
https://github.com/ansible/ansible/pull/34810
* Bump Azure storage client minimum to 1.5.0 to fix deserialization issues. This will break Azure Stack
until it receives storage API version 2017-10-01 or changes are made to support multiple versions.
(https://github.com/ansible/ansible/pull/34442)
* Flush stdin when passing the become password. Fixes some cases of timeout on
Python 3 with the ssh connection plugin: https://github.com/ansible/ansible/pull/35049
<a id="2.4.2"></a>
## 2.4.2 "Dancing Days" - 2017-11-29
### Bugfixes
* Fix formatting typo in panos_security_rule.py docs. (https://github.com/ansible/ansible/commit/c0fc797a06451d2fe1ac4fc077fc64f3a1666447)
* Fix rpm spec file to build on RHEL6 without EPEL packages (https://github.com/ansible/ansible/pull/31653)
* Keep hosts in play vars if inside of a rescue task (https://github.com/ansible/ansible/pull/31710)
* Fix wait_for module to treat broken connections as unready so that the connection continues to be retried:
https://github.com/ansible/ansible/pull/28839
* Python3 fixes:
* windows_azure, clc_firewall_policy, and ce_template modules fixed for
imports of urllib which changed between Python2 and Python3 lookup plugin
for consul_kv.py fixed for imports of urllib
(https://github.com/ansible/ansible/issues/31240)
* Make internal hashing of hostvars use bytes on both python2 and python3
(https://github.com/ansible/ansible/pull/31788)
* Fix logging inside of KubernetesAnsibleModule() to not use
self.helper.logging. the Ansible builtin log() method will strip out
parameters marked no_log and will not log if no_log was set in the playbook.
self.helper.log() circumvents that (https://github.com/ansible/ansible/pull/31789)
* Correct task results display so that it more closely matches what was present
in 2.3.x and previous.
* Warn when a group has a bad key (Should be one of vars, children, or hosts)
https://github.com/ansible/ansible/pull/31495
* Use controller configured ansible_shell_executable to run commands in the module
(https://github.com/ansible/ansible/pull/31361)
* Add documentation about writing unittests for Ansible
* Fix bugs in get_url/uri's SNI and TLS version handling when used on systems
that have Python-2.7.9+ and urllib3 installed.
* Have ansible-pull process inventory in its own way. Fixes issues with
ansible-pull not using the correct inventory, especially for localhost
(https://github.com/ansible/ansible/pull/32135)
* Fix for implicit localhost receiving too many variables from the all group
(https://github.com/ansible/ansible/pull/31959)
* Fix the service module to correctly detect which type of init system is
present on the host. (https://github.com/ansible/ansible/pull/32086)
* Fix inventory patterns to convert to strings before processing:
(https://github.com/ansible/ansible/issues/31978)
* Fix traceback in firewalld module instead of a nice error message:
(https://github.com/ansible/ansible/pull/31949)
* Fix for entering privileged mode using eos network modules:
(https://github.com/ansible/ansible/issues/30802)
* Validate that the destination for ansible-pull is a valid.directory:
(https://github.com/ansible/ansible/pull/31499)
* Document how to preserve strings of digits as strings in the ini inventory:
(https://github.com/ansible/ansible/pull/32047)
* Make sure we return ansible_distribution_major_version to macOS:
(https://github.com/ansible/ansible/pull/31708)
* Fix to ansible-doc -l to list custom inventory plugins:
(https://github.com/ansible/ansible/pull/31996)
* Fix win_chocolatey to respect case sensitivity in URLs:
(https://github.com/ansible/ansible/pull/31983)
* Fix config_format json in the junos_facts module:
(https://github.com/ansible/ansible/pull/31818)
* Allow the apt module's autoremove parameter to take effect in upgrades:
(https://github.com/ansible/ansible/pull/30747)
* When creating a new use via eos_user, create the user before setting the
user's privilege level: (https://github.com/ansible/ansible/pull/32162)
* Fixes nxos_portchannel idempotence failure on N1 images:
(https://github.com/ansible/ansible/pull/31057)
* Remove provider from prepare_ios_tests integration test:
(https://github.com/ansible/ansible/pull/31038)
* Fix nxos_acl change ports to non well known ports and drop time_range for N1:
(https://github.com/ansible/ansible/pull/31261)
* Fix nxos_banner removal idempotence issue in N1 images:
(https://github.com/ansible/ansible/pull/31259)
* Return error message back to the module
(https://github.com/ansible/ansible/pull/31035)
* Fix nxos_igmp_snooping idempotence:
(https://github.com/ansible/ansible/pull/31688)
* NXOS integration test nxos_file_copy, nxos_igmp, nxos_igmp_interface
nxos_igmp_snooping, nxos_ntp_auth, nxos_ntp_options:
(https://github.com/ansible/ansible/pull/29030)
* Fix elb_target_group module traceback when ports were specified inside of the targets parameter:
(https://github.com/ansible/ansible/pull/32202)
* Fix creation of empty virtual directories in aws_s3 module:
(https://github.com/ansible/ansible/pull/32169)
* Enable echo for `pause` module: (https://github.com/ansible/ansible/issues/14160)
* Fix for `hashi_vault` lookup to return all keys at a given path when no key is specified (https://github.com/ansible/ansible/pull/32182)
* Fix for `win_package` to allow TLS 1.1 and 1.2 on web requests:
(https://github.com/ansible/ansible/pull/32184)
* Remove provider from ios integration test:
(https://github.com/ansible/ansible/pull/31037)
* Fix eos_user tests
(https://github.com/ansible/ansible/pull/32261)
* Fix ansible-galaxy --force with installed roles:
(https://github.com/ansible/ansible/pull/32282)
* ios_interface testfix:
(https://github.com/ansible/ansible/pull/32335)
* Fix ios integration tests:
(https://github.com/ansible/ansible/pull/32342)
* Ensure there is always a basdir so we always pickup group/host_vars
https://github.com/ansible/ansible/pull/32269
* Fix vars placement in ansible-inventory
https://github.com/ansible/ansible/pull/32276
* Correct options for luseradd in user module
https://github.com/ansible/ansible/pull/32262
* Clarified package docs on 'latest' state
https://github.com/ansible/ansible/pull/32397
* Fix issue with user module when local is true
(https://github.com/ansible/ansible/pull/32262 and https://github.com/ansible/ansible/pull/32411)
* Fix for max_fail_percentage being inaccurate:
(https://github.com/ansible/ansible/issues/32255)
* Fix check mode when deleting ACS instance in azure_rm_acs module:
(https://github.com/ansible/ansible/pull/32063)
* Fix ios_logging smaller issues and make default size for buffered work:
(https://github.com/ansible/ansible/pull/32321)
* Fix ios_logging module issue where facility is being deleted along with host:
(https://github.com/ansible/ansible/pull/32234)
* Fix wrong prompt issue for network modules (https://github.com/ansible/ansible/pull/32426)
* Fix eos_eapi to enable non-default vrfs if the default vrf is already configured (https://github.com/ansible/ansible/pull/32112)
* Fix network parse_cli filter in case of single match is not caught when using start_block and end_block
(https://github.com/ansible/ansible/pull/31092)
* Fix win_find failing on files it can't access, change behaviour to be more
like the find module (https://github.com/ansible/ansible/issues/31898)
* Amended tracking of 'changed'
https://github.com/ansible/ansible/pull/31812
* Fix label assignment in ovirt_host_networks
(https://github.com/ansible/ansible/pull/31973)
* Fix fencing and kuma usage in ovirt_cluster module
(https://github.com/ansible/ansible/pull/32190)
* Fix failure during upgrade due to NON_RESPONSIVE state for ovirt_hosts module
(https://github.com/ansible/ansible/pull/32192)
* ini inventory format now correclty handles group creation w/o need for specific orders
https://github.com/ansible/ansible/pull/32471
* Fix for quoted paths in win_service
(https://github.com/ansible/ansible/issues/32368)
* Fix tracebacks for non-ascii paths when parsing inventory
(https://github.com/ansible/ansible/pull/32511)
* Fix git archive when update is set to no
(https://github.com/ansible/ansible/pull/31829)
* Fix locale when screen scraping in the yum module
(https://github.com/ansible/ansible/pull/32203)
* Fix for validating proxy results on Python3 for modules making http requests:
(https://github.com/ansible/ansible/pull/32596)
* Fix unreferenced variable in SNS topic module
(https://github.com/ansible/ansible/pull/29117)
* Handle ignore_errors in loops
(https://github.com/ansible/ansible/pull/32546)
* Fix running with closed stdin on python 3
(https://github.com/ansible/ansible/pull/31695)
* Fix undefined variable in script inventory plugin
(https://github.com/ansible/ansible/pull/31381)
* Fix win_copy on Python 2.x to support files greater than 4GB
(https://github.com/ansible/ansible/pull/32682)
* Add extra error handling for wmare connect to correctly detect scenarios where
username does not have the required logon permissions
(https://github.com/ansible/ansible/pull/32613)
* Fix ios_config file prompt issue while using save_when
(https://github.com/ansible/ansible/pull/32744)
* Prevent host_group_vars plugin load errors when using 'path as inventory hostname'
https://github.com/ansible/ansible/issues/32764
* Better errors when loading malformed vault envelopes
(https://github.com/ansible/ansible/issues/28038)
* nxos_interface error handling
(https://github.com/ansible/ansible/pull/32846)
* Fix snmp bugs on Nexus 3500 platform
(https://github.com/ansible/ansible/pull/32773)
* nxos_config and nxos_facts - fixes for N35 platform
(https://github.com/ansible/ansible/pull/32762)
* fix dci failure nxos
(https://github.com/ansible/ansible/pull/32877)
* Do not execute `script` tasks is check mode (https://github.com/ansible/ansible/issues/30676)
* Keep newlines when reading LXC container config file (https://github.com/ansible/ansible/pull/32219)
* Fix a traceback in os_floating_ip when required instance is already present in the cloud:
https://github.com/ansible/ansible/pull/32887
* Fix for modifying existing application load balancers using certificates (https://github.com/ansible/ansible/pull/28217)
* Fix --ask-vault-pass with no tty and password from stdin
(https://github.com/ansible/ansible/issues/30993)
* Fix for IIS windows modules to use hashtables instead of PSCustomObject
(https://github.com/ansible/ansible/pull/32710)
* Fix nxos_snmp_host bug
(https://github.com/ansible/ansible/pull/32916)
* Make IOS devices consistent ios_logging
(https://github.com/ansible/ansible/pull/33100)
* restore error on orphan group:vars delcaration for ini inventories
https://github.com/ansible/ansible/pull/32866
* restore host/group_vars merge order
https://github.com/ansible/ansible/pull/32963
* use correct loop var when delegating
https://github.com/ansible/ansible/pull/32986
* Handle sets and datetime objects in inventory sources fixing tracebacks
https://github.com/ansible/ansible/pull/32990
* Fix for breaking change to Azure Python SDK DNS RecordSet constructor in azure-mgmt-dns==1.2.0
https://github.com/ansible/ansible/pull/33165
* Fix for breaking change to Azure Python SDK that prevented some members from being returned in facts modules
https://github.com/ansible/ansible/pull/33169
* restored glob/regex host pattern matching to traverse groups and hosts and not return after first found
https://github.com/ansible/ansible/pull/33158
* change nxos_interface module to use "show interface" to support more platforms
https://github.com/ansible/ansible/pull/33037
<a id="2.4.1"></a>
## 2.4.1 "Dancing Days" - 2017-10-25
### Bugfixes
* Security fix for CVE-2017-7550 the jenkins_plugin module was logging the jenkins
server password if the url_password was passed via the params field:
https://github.com/ansible/ansible/pull/30875
* Update openssl\* module documentation to show openssl-0.16 is the minimum version
* Fix openssl_certificate's csr handling
* Python-3 fixes
* Fix openssl_certificate parameter assertion on Python3
* Fix for python3 and nonascii strings in inventory plugins (https://github.com/ansible/ansible/pull/30666)
* Fix missing urllib in iam_policy
* Fix crypttab module for bytes<=>text string mismatch ( https://github.com/ansible/ansible/pull/30457 )
* Fix lxc_container module combining bytes with text ( https://github.com/ansible/ansible/pull/30572 )
* Fix map doesn't return a list on python3 in ec2_snapshot_facts module (https://github.com/ansible/ansible/pull/30606)
* Fix uri (and other url retrieving) modules when used with a proxy. (https://github.com/ansible/ansible/issues/31109)
* Fix azure_rm dynamic inventory script ConfigParser usage.
* Fix for win_file to respect check mode when deleting directories
* Fix for Ansible.ModuleUtils.Legacy.psm1 to return list params correctly
* Fix for a proper logout in the module ovirt_vms
* Fixed docs for 'password' lookup
* Corrected and added missing feature and porting docs for 2.4
* Fix for Ansible.ModuleUtils.CamelConversion to handle empty lists and lists with one entry
* Fix nxos terminal regex to parse username correctly.
* Fix colors for selective callback
* Fix for 'New password' prompt on 'ansible-vault edit' (https://github.com/ansible/ansible/issues/30491)
* Fix for 'ansible-vault encrypt' with vault_password_file in config and --ask-vault-pass cli (https://github.com/ansible/ansible/pull/30514#pullrequestreview-63395903)
* updated porting guide with notes for callbacks and config
* Added backwards compatiblity shim for callbacks that do not inherit from CallbackBase
* Corrected issue with configuration and multiple ini entries being overwriten even when not set.
* backported fix for doc generation (plugin_formatter)
* Fix ec2_lc module for an unknown parameter name (https://github.com/ansible/ansible/pull/30573)
* Change configuration of defaults to use standard jinja2 instead of custom
eval() for using variables in the default field of config (https://github.com/ansible/ansible/pull/30650)
* added missing entry in chlog deprecation
* Fixed precedence and values for become flags and executable settings
* Fix for win_domain_membership to throw more helpful error messages and check/fix when calling WMI function after changing workgroup
* Fix for win_power_plan to compare the OS version's correctly and work on Windows 10/Server 2016
* Fix module doc for typo in telnet command option
* Fix OpenBSD pkg_mgr fact (https://github.com/ansible/ansible/issues/30623)
* Fix encoding error when there are nonascii values in the path to the ssh binary
* removed YAML inventory group name validation, broke existing setups and should be global in any case, and configurable
* performance improvment for inventory, had slown down considerably from 2.3
* Fix cpu facts on sparc64 (https://github.com/ansible/ansible/pull/30261)
* Fix ansible_distribution fact for Arch linux (https://github.com/ansible/ansible/issues/30600)
* remove print statements from play_context/become
* Fix vault errors after 'ansible-vault edit' (https://github.com/ansible/ansible/issues/30575)
* updated api doc example to match api changes
* corrected issues with slack callback plugin
* it is import_playbook .. not import_plays .. docs now reflect this
* fixed typo and missed include/import conversion in import_tasks docs
* updated porting docs with note about inventory_dir
* removed extension requirement for yaml inventory plugin to restore previous behaviour
* fixed ansible-pull to now correctly deal with inventory
* corrected dig lookup docs
* fix type handling for sensu_silence so the module works
* added fix for win_iis_webapppool to correctly handle array elements
* Fix bugs caused by lack of collector ordering like service_mgr being incorrect (https://github.com/ansible/ansible/issues/30753)
* Fix os_image when the id parameter is not set in the task. ( https://github.com/ansible/ansible/pull/29147 )
* Fix for the winrm connection to use proper task vars
* removed typo from dig lookup docs
* Updated win_chocolatey example to be clearer around what should be used with become
* Fix for copy module when permissions are changed but the file contents are not ( https://github.com/ansible/ansible/issues/30556 )
* corrected YAML_FILENAME_EXTENSIONS ini setter as key/section were swapped
* Better error message when a yaml inventory is invalid
* avoid include_Xs conflating vars with options
* Fix aws_s3 module handling `encrypt` option (https://github.com/ansible/ansible/pull/31203)
* Fix for win_msg to document and show error when message is greater than 255 characters
* Fix for win_dotnet_ngen to work after recent regression
* fixed backwards compat method for config
* removed docs for prematurely added ssh specific pipelining settings
* fixed redis cache typo
* Fix AttributeError during inventory group deserialization (https://github.com/ansible/ansible/issues/30903)
* Fix 'ansible-vault encrypt --output=-' (https://github.com/ansible/ansible/issues/30550)
* restore pre 2.4 pipeline configuration options (env and ini)
* Fix win_copy regression: handling of vault-encrypted source files (https://github.com/ansible/ansible/pull/31084)
* Updated return values for win_reg_stat to correctly show what is being returned (https://github.com/ansible/ansible/pull/31252)
* reduced normal error redundancy and verbosity, display on increased and when needed
* Give an informative error instead of a traceback if include_vars dir is file instead of directory (https://github.com/ansible/ansible/pull/31157)
* Fix monit module's version check for color support (https://github.com/ansible/ansible/pull/31212)
* Make `elasticsearch_plugin` module work with both 2.x and 5.x (https://github.com/ansible/ansible/issues/21989)
* Fix for become on Windows to handle ignored errors (https://github.com/ansible/ansible/issues/30468)
* Fix removal of newlines when writing SELinux config (https://github.com/ansible/ansible/issues/30618)
* clarified extension requirement for constructed inv plugin
* really turn off inventory caching, toggle will be added in 2.5
* for inventory sources, dont follow symlinks to calculate base directory, used for group/host_vars
* Port the uptime.py example script to the new inventory API.
* inventory_file variable again returns full path, not just basename
* added info about cwd group/host vars to porting guide
* Fix name parsing out of envra in the yum module
* give user friendly error on badly formatted yaml inventory source
* Fix any_errors_fatal setting in playbooks.
* Fix setting of ssh-extra-args from the cli (https://github.com/ansible/ansible/pull/31326)
* Change SELinux fact behavior to always return a dictionary. (https://github.com/ansible/ansible/issues/18692)
* Revert a fix for using non /bin/sh shells for modules' running commands as
this was causing output from commands to change, thus breaking playbooks.
See the original bug for details and links to the eventual fix:
https://github.com/ansible/ansible/issues/24169
* Do not log data field in `docker_secrets` module (https://github.com/ansible/ansible/pull/31366)
* Fix rpm_key taking the wrong 8 chars from the keyid (https://github.com/ansible/ansible/pull/31045)
* chown errors now more informative
* Fix for win_copy to copy a source file that has invalid windows characters in the filename, the dest still must be have valid windows characters (https://github.com/ansible/ansible/issues/31336#issuecomment-334649927)
* Fix systemd module to not run daemon-reload in check mode.
* fixed some parsing and selection issues with inventory manager, fixed minor bugs in yaml and constructed plugins
* Fix the ping module documentation to reference win_ping instead of itself: https://github.com/ansible/ansible/pull/31444
* Fix for ec2_win_password to allow blank key_passphrase again (https://github.com/ansible/ansible/pull/28791)
* added toggle for vars_plugin behaviour to execute relative to playbook, set default to revert to previous way.
* Fix for win_copy to not remove destination file on change when in check mode (https://github.com/ansible/ansible/pull/31469)
* Fix include_role usage of role_name (https://github.com/ansible/ansible/pull/31463)
* Fix service and package forcing a second run of the setup module to function (https://github.com/ansible/ansible/issues/31485)
* Better error message when attempting to use include or import with /usr/bin/ansible (https://github.com/ansible/ansible/pull/31492/)
* Fix `sysctl` module to remove etries when `state=absent` (https://github.com/ansible/ansible/issues/29920)
* Fix for ec2_group to avoid trying to iterate over None (https://github.com/ansible/ansible/pull/31531)
* Fix for ec2_group for a possible KeyError bug (https://github.com/ansible/ansible/pull/31540)
* Fix for the rpm_key module when importing the first gpg key on a system (https://github.com/ansible/ansible/pull/31514)
* Fix for aws_s3 metadata to use the correct parameters when uploading a file (https://github.com/ansible/ansible/issues/31232)
* Fix for the yum module when installing from file/url crashes (https://github.com/ansible/ansible/pull/31529)
* Improved error messaging for Windows become/runas when username is bogus (https://github.com/ansible/ansible/pull/31551)
* Fix rollback feature in junos_config to now allow configuration rollback on device (https://github.com/ansible/ansible/pull/31424)
* Remove command executed log from ansible-connection (https://github.com/ansible/ansible/pull/31581)
* Fix relative paths to be relative to config file when there is no playbook available (https://github.com/ansible/ansible/issues/31533)
* Fix Inventory plugins to use the configured inventory plugin path (https://github.com/ansible/ansible/issues/31605)
* Fix include task to be dynamic (https://github.com/ansible/ansible/issues/31593)
* A couple fixes to the test process to account for new testing resources in
our ci system and an upstream cryptography update that didn't work with
pip-8.x
* Document backup_path in a few dellos modules and vyos_config (https://github.com/ansible/ansible/issues/31844)
* Fix for vmware_vm_facts with dangling inaccessible VM which don't have MAC addresses (https://github.com/ansible/ansible/pull/31629)
* Fix for win_regedit sending extra data that could confuse ansible's result parsing (https://github.com/ansible/ansible/pull/31813)
* Fix git module to correctly cleanup temporary dirs (https://github.com/ansible/ansible/pull/31541)
* Fix for modules which use atomic_move() to rename files raising an exception
if a file could not be opened. Fix will return a nice error message instead:
https://github.com/ansible/ansible/issues/31786
* Fix ansible-doc and ansible-console module-path option (https://github.com/ansible/ansible/pull/31744)
* Fix for hostname module on RHEL 7.5 (https://github.com/ansible/ansible/issues/31811)
* Fix provider password leak in logs for asa modules (https://github.com/ansible/ansible/issues/32343)
* Fix tagging for dynamodb_table if region is not explicitly passed to the module (https://github.com/ansible/ansible/pull/32557)
* Fix Python 3 decode error in `cloudflare_dns` (https://github.com/ansible/ansible/pull/32065)
### Known Bugs
* Implicit localhost is getting ansible_connection from all:vars instead of
from the implicit localhost definition (https://github.com/ansible/ansible/issues/31420)
<a id="2.4"></a>
## 2.4 "Dancing Days" - 2017-09-19
### Major Changes
@ -9,8 +624,6 @@ Ansible Changes By Release
* New import/include keywords to replace the old bare `include` directives. The use of `static: {yes|no}` on such includes is now deprecated.
- Using `import_*` (`import_playbook`, `import_tasks`, `import_role`) directives are static.
- Using `include_*` (`include_tasks`, `include_role`) directives are dynamic.
* Added fact namespacing, from now on facts will be available under `ansible_facts` namespace (i.e. `ansible_facts.ansible_os_distribution`).
They will continue to be added into the main namespace directly, but now a configuration toggle to disable this, currently off by default, in the future it will be on by default.
This is done to avoid collisions and possible security issues as facts come from the remote targets and they might be compromised.
* New `order` play level keyword that allows the user to change the order in which Ansible processes hosts when dispatching tasks.
* Users can now set group merge priority for groups of the same depth (parent child relationship), using the new `ansible_group_priority` variable, when values are the same or don't exist it will fallback to the previous sorting by name'.
@ -22,19 +635,21 @@ Ansible Changes By Release
- New inventory plugins for creating inventory
- Old inventory formats are still supported via plugins
- Inline host_list is also an inventory plugin, an example alternative `advanced_host_list` is also provided (it supports ranges)
- New configuration option to list enabled plugins and precedence order: `whitelist_inventory` in ansible.cfg
- New configuration option to list enabled plugins and precedence order `[inventory]enable_plugins` in ansible.cfg
- vars_plugins have been reworked, they are now run from Vars manager and API has changed (need docs)
- Loading group_vars/host_vars is now a vars plugin and can be overridden
- It is now possible to specify mulitple inventory sources in the command line (-i /etc/hosts1 -i /opt/hosts2)
- Inventory plugins can use the cache plugin (i.e. virtualbox) and is affected by `meta: refresh_inventory`
- Group variable precedence is now configurable via new 'precedence' option in ansible.cfg (needs docs)
- Improved warnings and error messages across the board
* Configuration has been changed from a hardcoded into the constants module to dynamically loaded from yaml definitions
* Configuration has been changed from a hardcoded listing in the constants module to dynamically loaded from yaml definitions
- Also added an ansible-config CLI to allow for listing config options and dumping current config (including origin)
- TODO: build upon this to add many features detailed in ansible-config proposal https://github.com/ansible/proposals/issues/35
* Windows modules now support the use of multiple shared module_utils files in the form of Powershell modules (.psm1), via `#Requires -Module Ansible.ModuleUtils.Whatever.psm1`
* Python module argument_spec now supports custom validation logic by accepting a callable as the `type` argument.
* Windows become_method: runas now works across all authtypes and will auto-elevate under UAC if WinRM user has "Act as part of the operating system" privilege
* Do not escape backslashes in the template lookup plugin to mirror what the template module does
https://github.com/ansible/ansible/issues/26397
### Deprecations
* The behaviour when specifying `--tags` (or `--skip-tags`) multiple times on the command line
@ -49,33 +664,36 @@ Ansible Changes By Release
moved to `ansible.utils.unsafe_proxy` to avoid a circular import.
* The win_get_url module has the dictionary 'win_get_url' in its results deprecated,
its content is now also available directly in the resulting output, like other modules.
* previouslly deprecated 'hostfile' config settings have been 're-deprecated' as before the code did not warn about deprecated configuration settings
, but it does now.
#### Deprecated Modules (to be removed in 2.8):
* ec2_facts: replaced by ec2_metadata_facts
* azure: use M(azure_rm_virtualmachine) instead
* cs_nic: replaced by cs_instance_nic_secondaryip, also see new module cs_instance_nic for managing nics
* ec2_facts: replaced by ec2_metadata_facts
* ec2_remote_facts: replaced by ec2_instance_facts
* panos_address: use M(panos_object) instead
* panos_service: use M(panos_object) instead
* panos_security_policy: use M(panos_security_rule) instead
* panos_nat_policy: use M(panos_nat_rule) instead
* panos_security_policy: use M(panos_security_rule) instead
* panos_service: use M(panos_object) instead
* s3: replaced by aws_s3
* ec2_remote_facts: replaced by
* win_msi: use M(win_package) instead
#### Removed Modules (previouslly deprecated):
#### Removed Modules (previously deprecated):
* eos_template: use eos_config instead
* ios_template: use ios_config instead
* iosxr_template: use iosxr_config instead
* junos_template: use junos_config instead
* nxos_template: use nxos_config instead
* ops_template: use ops_config instead
* openswitch
* ops_template: use ops_config instead
### Minor Changes
* Removed previously deprecated config option `hostfile` and env var `ANSIBLE_HOSTS`
* Now deprecated configuration options issue warnings when set.
* Removed unused and deprecated config option `pattern`
* Updated the copy of six bundled for modules to use from 1.4.1 to 1.10.0
* The `include_dir` var is not a global anymore, as we now allow multiple inventory sources, it is now host dependant.
* The `inventory_dir` var is not a global anymore, as we now allow multiple inventory sources, it is now host dependant.
This means it cannot be used wherever host vars are not permitted, for example in task/handler names.
* Fixed a cornercase with ini inventory vars. Previously, if an inventory var
was a quoted string with hash marks ("#") in it then the parsed string
@ -130,21 +748,51 @@ Ansible Changes By Release
- extensions of files to ignore when using inventory directory
- patterns of flies to ignore when using inventory directory
- option to toggle failed inventory source parsing between an error or a warning
* More fixes for Python 3 across the code base.
* win_shell and win_command modules now properly preserve quoted arguments passed on the command-line. Tasks that attempted to work around the issue by adding extra quotes/escaping may need to be reworked. See https://github.com/ansible/ansible/issues/23019 for additional detail.
* All configuration paths are now relative to the `ansible.cfg` file used.
* By user request, a 'configuration macro' (``CWD``) is available to force configured paths to be relative to the current working directory. Please note that this is unsafe and not recommended.
#### New Callbacks:
- full_skip
- profile_roles
- stderr
#### New Connection plugins:
- buildah
- saltstack
#### New Filters:
- ipaddr filter gained several new suboptions
- first_usable
- ip/prefix
- ip_netmask
- last_usable
- next_usable
- network_id
- network/prefix
- network_netmask
- network_wildcard
- previous_usable
- range_usable
- size_usable
- wildcard
- next_nth_usable
- network_in_network
- network_in_usable
- previous_nth_usable
- parse_cli
- parse_cli_textfsm
- strftime
- urlsplit
#### New Inventory Plugins:
- advanced_host_list
- constructed
- host_list
- ini
- openstack
- script
- virtualbox
- yaml
@ -152,11 +800,22 @@ Ansible Changes By Release
#### New Inventory scripts:
- lxd
#### New: Tests
#### New Lookups:
- chef_databag
- cyberarkpassword
- hiera
#### New Tests:
- any : true if any element is true
- all: true if all elements are true
### Module Notes
- By mistake, an early version of elb_classic_lb, elb_instance, and elb_classic_lb_facts modules
were released and marked as stableinterface. These are now marked as preview in 2.4.1 and their
parameters and return values may change in 2.5.0. Part of this mistake included deprecating the
ec2_elb_lb, ec2_lb, and ec2_elb_facts modules prematurely. These modules won't be deprecated
until the replacements above have a stableinterface and the erroneous deprecation has been fixed
in 2.4.1.
- The docker_container module has gained a new option, `working_dir` which allows
specifying the working directory for the command being run in the image.
- The ec2_win_password module now requires the cryptography python module be installed to run
@ -578,6 +1237,140 @@ Ansible Changes By Release
* win_wait_for
* win_wakeonlan
<a id="2.3.3"></a>
## 2.3.3 "Ramble On" - TBD
### Bugfixes
* Fix alternatives module handlling of non existing options
* Fix synchronize traceback with the docker connection plugin
* Fix the expires option of the postgresq_user module
* Fix for win_acl when settings permissions on registry objects that use `ALL APPLICATION PACKAGES` and `ALL RESTRICTED APPLICATION PACKAGES`
* Python3 fixes
* asorted azure modules
* pause module
* hacking/env-setup script
* Fix traceback when checking for passwords in logged strings when logging executed commands.
* docker_login module
* Workaround python-libselinux API change in the seboolean module
* digital_ocean_tag module
* Fix the zip filter
* Fix user module combining bytes and text
* Fix for security groups in the amazon efs module
* Fix for the jail connection plugin not finding the named jail
* Fix for blockinfile's parameters insertbefore and insertafter
* ios_config: Fix traceback when the efaults parameter is not set
* iosxr_config: Fixed unicode error when UTF-8 characters are in configs
* Fix check mode in archive module
* Fix UnboundLocalError in check mode in cs_role module
* Fix to always use lowercase hostnames for host keys in known_hosts module
* Added missing return results for win_stat
* Fix rabbitmq modules to give a helpful error if requests is not installed
* Fix yum module not deleting rpms that it downloaded
* Fix yum module failing with a URL to an rpm
* Fix file module inappropriately expanding literal dollar signs in a path read
from the filesystem as an environment variable.
* Fix the ssh "smart" transport setting which automatically selects the best means of
transferring files over ssh (sftp, ssh, piped).
* Fix authentication by api_key parameter in exoscale modules.
* vmware module_utils shared code ssl/validate_certs fixes in connection logic
* allow 'bridge' facts to work for certain containers that create conflicting ones with connection plugins
* Fix for win_get_url to use TLS 1.2/1.1 if it is available on the host
* Fix for the filetree lookup with non-ascii group names
* Better message for invalid keywords/options in task due to undefined expressions
* Fixed check mode for enable on Solaris for service module
* Fix cloudtrail module to allow AWS profiles other than the default
* Fix an encoding issue with secret (password) vars_prompts
<a id="2.3.2"></a>
## 2.3.2 "Ramble On" - 2017-08-04
### Bugfixes
* Fix partend i18n issues
* fixed handling of extra vars for tower_job_template (#25272)
* Python3 bugfixes
* Fix sorting of ec2 policies
* Fix digital_ocean dynamic inventory script
* Fix for the docker connection plugin
* Fix pip module when using python3's pyvenv and python3 -m venv to create virtualenvs
* Fix for the AnsiBallZ wrapper so that it gives a better error message when
there's not enough disk space to create its tempdir.
* Fix so ansilbe-galaxy install --force with unversioned roles will once again
overwrite old versions.
* Fix for RabbitMQ 3.6.7 endpoint return code changing.
* Fix for Foreman organization creation
* fixed incorrect fail_json ref in rpm_key
* Corrected requried on hash_name for dynamodb_table
* Fix for fetch action plugin not validating correctly
* Avoid vault view writing display to logs
* htpasswd: fix passlib module version comparison
* Fix for flowdock error message when external_user_name is missing
* fixed corner case for delegate_to, loops and delegate_facts
* fixed wait_for python2.4/2.5 compatibility (this is last version this is needed)
* fix for adhoc not obeying callback options
* fix for win_find where it fails to recursively scan empty nested directories
* fix non-pipelined code paths for Windows (eg, ANSIBLE_KEEP_REMOTE_FILES, non-pipelined connection plugins)
* fix for win_updates where args and check mode were ignored due to common code change
* fix for unprivileged users to Windows runas become method
* fix starttls code path for mail module
* fix missing LC_TYPE in parted module
* fix CN parsing with OpenSSL 1.1 in letsencrypt module
* fix params assignment in jabber module
* fix TXT record type handling in exo_dns_record module
* fix message queue message ttl can't be 0 in rabbitmq_queue module
* CloudStack bugfixes:
* fix template upload for users in cs_template module, change default to is_routing=None
* several fixes in cs_host module fixes hypervisor handling
* fix network param ignored due typo in cs_nic module
* fix missing type bool in module cs_zone
* fix KeyError: 'sshkeypair' in cs_instance module for CloudStack v4.5 and before
* fix for win_chocolatey where trying to upgrade all the packages as per the example docs fails
* fix for win_chocolatey where it did not fail if the version set did not exist
* fix for win_regedit always changing a reg key if the dword values set is a hex
* fix for wait_for on non-Linux systems with newer versions of psutil
* fix eos_banner code and test issues
* run tearup and teardown of EAPI service only on EAPI tests
* fix eos_config tests so only Eth1 and Eth2 are used
* Fix for potential bug when using legacy inventory vars for configuring the su password.
* Fix crash in file module when directories contain non-utf8 filenames
* Fix for dnf groupinstall with dnf-2.x
* Fix seboolean module for incompatibility in newer Python3 selinux bindings
* Optimization for inventory, no need to dedup at every stage, its redundant and slow
* Fix fact gathering for package and service action plugins
* make random_choice more error resilient (#27380)
* ensure prefix in plugin loading to avoid conflicts
* fix for a small number of modules (tempfile, possibly copy) which could fail
if the tempdir on the remote box was a symlink
+ fix non-pipelined code paths for Windows (eg, ANSIBLE_KEEP_REMOTE_FILES, non-pipelined connection plugins)
* fix for win_updates where args and check mode were ignored due to common code change
<a id="2.3.1"></a>
## 2.3.1 "Ramble On" - 2017-06-01
### Bugfixes
* Security fix for CVE-2017-7481 - data for lookup plugins used as variables was not being correctly marked as "unsafe".
* Fix default value of fetch module's validate_checksum to be True
* Added fix for "meta: refresh_connection" not working with default 'smart' connection.
* Fix template so that the --diff command line option works when the destination is a directory
* Fix python3 bugs in pam_limits
* Fix unbound error when using module deprecation as a single string
* Several places in which error handling was broken due to bad conversions or just typos
* Fix to user module for appending/setting groups on OpenBSD (flags were reversed)
* assemble fix to use safer os.join.path, avoids charset issues
* fixed issue with solaris facts and i18n
* added python2.4 compatiblity fix to sysctl module
* Fix comparison of exisiting container security opts in the docker_container module
* fixed service module invocation of insserv on certain platforms
* Fix traceback in os_user in an error case.
* Fix docker container to restart a container when changing to fewer exposed ports
* Fix tracebacks in docker_network
* Fixes to detection of updated docker images
* Handle detection of docker image changes when published ports is changed
* Fix for docker_container restarting images when links list is empty.
<a id="2.3"></a>
## 2.3 "Ramble On" - 2017-04-12
@ -613,6 +1406,7 @@ Moving to Ansible 2.3 guide http://docs.ansible.com/ansible/porting_guide_2.3.ht
* 'service' tasks can now use async again, we had lost this capability when changed into an action plugin.
* made any_errors_fatal inheritable from play to task and all other objects in between.
* many small performance improvements in inventory and variable handling and in task execution.
* Added a retry class to the ec2_asg module since customers were running into throttling errors (AWSRetry is a solution for modules using boto3 which isn't applicable here).
### Deprecations
* Specifying --tags (or --skip-tags) multiple times on the command line
@ -844,6 +1638,14 @@ Moving to Ansible 2.3 guide http://docs.ansible.com/ansible/porting_guide_2.3.ht
* panos_service
- postgresql_schema
- proxmox_kvm
- proxysql:
* proxysql_backend_servers
* proxysql_global_variables
* proxysql_manage_config
* proxysql_mysql_users
* proxysql_query_rules
* proxysql_replication_hostgroups
* proxysql_scheduler
- pubnub_blocks
- pulp_repo
- runit
@ -1640,7 +2442,7 @@ Module fixes:
This re-executes inventory scripts, but does not force them to ignore any cache they might use.
* New delegate_facts directive, a boolean that allows you to apply facts to the delegated host (true/yes) instead of the inventory_hostname (no/false) which is the default and previous behaviour.
* local connections now work with 'su' as a privilege escalation method
* Ansible 2.0 has deprecated the “ssh” from ansible_ssh_user, ansible_ssh_host, and ansible_ssh_port to become ansible_user, ansible_host, and ansible_port.
* Ansible 2.0 has deprecated the "ssh" from ansible_ssh_user, ansible_ssh_host, and ansible_ssh_port to become ansible_user, ansible_host, and ansible_port.
* New ssh configuration variables (`ansible_ssh_common_args`, `ansible_ssh_extra_args`) can be used to configure a
per-group or per-host ssh ProxyCommand or set any other ssh options.
`ansible_ssh_extra_args` is used to set options that are accepted only by ssh (not sftp or scp, which have their own analogous settings).

View file

@ -29,6 +29,7 @@ ASCII2HTMLMAN = a2x -L -D docs/html/man/ -d manpage -f xhtml
else
ASCII2MAN = @echo "ERROR: AsciiDoc 'a2x' command is not installed but is required to build $(MANPAGES)" && exit 1
endif
GENERATE_CLI = docs/bin/generate_man.py
PYTHON=python
SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
@ -343,8 +344,9 @@ webdocs:
.PHONY: generate_asciidoc
generate_asciidoc: lib/ansible/cli/*.py
mkdir -p ./docs/man/man1/
PYTHONPATH=./lib ./docs/bin/generate_man.py
mkdir -p ./docs/man/man1/ ; \
PYTHONPATH=./lib $(GENERATE_CLI) --template-file=docs/templates/man.j2 --output-dir=docs/man/man1/ --output-format man lib/ansible/cli/*.py
docs: generate_asciidoc
make $(MANPAGES)

View file

@ -4,7 +4,20 @@ Ansible Releases at a Glance
VERSION RELEASE CODE NAME
++++++++++++++++++++++++++++++
2.4.0 TBD "Dancing Days"
2.6.0 TBD "HeartBreaker"
2.5.5 14-06-2018 "Kashmir"
2.5.4 31-05-2018 "Kashmir"
2.5.3 17-05-2018 "Kashmir"
2.5.2 26-04-2018 "Kashmir"
2.5.1 19-04-2018 "Kashmir"
2.5.0 23-03-2018 "Kashmir"
2.4.6 07-05-2018 "Dancing Days"
2.4.5 06-21-2018 "Dancing Days"
2.4.4 04-04-2018 "Dancing Days"
2.4.3 01-31.2018 "Dancing Days"
2.4.2 11-29-2017 "Dancing Days"
2.4.1 10-25-2017 "Dancing Days"
2.4.0 09-19-2017 "Dancing Days"
2.3.2 08-04-2017 "Ramble On"
2.3.1 06-01-2017 "Ramble On"
2.3.0 04-12-2017 "Ramble On"

View file

@ -1 +1 @@
2.4.0 0.0.devel
2.4.6.0 1

View file

@ -214,7 +214,6 @@ class Server():
def do_EXEC(self, data):
cmd = data.split(b'EXEC: ')[1]
display.display('Command executed: %s' % cmd, log_only=True)
return self.connection.exec_command(cmd)
def do_PUT(self, data):

View file

@ -187,14 +187,18 @@ Version: 1.0.0
'''
import argparse
import ConfigParser
import json
import os
import re
import sys
import inspect
import traceback
try:
# python2
import ConfigParser as cp
except ImportError:
# python3
import configparser as cp
from packaging.version import Version
@ -326,7 +330,7 @@ class AzureRM(object):
path = expanduser("~")
path += "/.azure/credentials"
try:
config = ConfigParser.ConfigParser()
config = cp.ConfigParser()
config.read(path)
except Exception as exc:
self.fail("Failed to access {0}. Check that the file exists and you have read "
@ -795,7 +799,7 @@ class AzureInventory(object):
config = None
settings = None
try:
config = ConfigParser.ConfigParser()
config = cp.ConfigParser()
config.read(path)
except:
pass

View file

@ -473,10 +473,7 @@ class ConsulConfig(dict):
scheme = 'http'
if hasattr(self, 'url'):
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from ansible.module_utils.six.moves.urllib.parse import urlparse
o = urlparse(self.url)
if o.hostname:
host = o.hostname

View file

@ -371,7 +371,6 @@ HAS_DOCKER_PY = True
HAS_DOCKER_ERROR = False
try:
from docker import Client
from docker.errors import APIError, TLSParameterError
from docker.tls import TLSConfig
from docker.constants import DEFAULT_TIMEOUT_SECONDS, DEFAULT_DOCKER_API_VERSION
@ -379,6 +378,19 @@ except ImportError as exc:
HAS_DOCKER_ERROR = str(exc)
HAS_DOCKER_PY = False
# Client has recently been split into DockerClient and APIClient
try:
from docker import Client
except ImportError as exc:
try:
from docker import APIClient as Client
except ImportError as exc:
HAS_DOCKER_ERROR = str(exc)
HAS_DOCKER_PY = False
class Client:
pass
DEFAULT_DOCKER_HOST = 'unix://var/run/docker.sock'
DEFAULT_TLS = False
DEFAULT_TLS_VERIFY = False
@ -779,6 +791,10 @@ class DockerInventory(object):
if config_path:
try:
config_file = os.path.abspath(config_path)
# default config path is docker.yml in same directory as this script
# old behaviour is docker.yml in current directory. Handle both.
if not os.path.exists(config_file):
config_file = os.path.abspath(os.path.basename(config_path))
except:
config_file = None
@ -813,7 +829,7 @@ class DockerInventory(object):
# Parse command line arguments
basename = os.path.splitext(os.path.basename(__file__))[0]
default_config = basename + '.yml'
default_config = os.path.join(os.path.dirname(__file__), basename + '.yml')
parser = argparse.ArgumentParser(
description='Return Ansible inventory for one or more Docker hosts.')

View file

@ -56,12 +56,8 @@ import argparse
import six
import httplib2 as http
from time import time
from six.moves import configparser
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from ansible.module_utils.six.moves import configparser
from ansible.module_utils.six.moves.urllib.parse import urlparse
try:
import json

View file

@ -38,14 +38,17 @@ import os.path
import subprocess
import re
from paramiko import SSHConfig
from cStringIO import StringIO
from optparse import OptionParser
from collections import defaultdict
try:
import json
except:
except Exception:
import simplejson as json
from ansible.module_utils._text import to_text
from ansible.module_utils.six.moves import StringIO
_group = 'vagrant' # a default group
_ssh_to_ansible = [('user', 'ansible_ssh_user'),
('hostname', 'ansible_ssh_host'),
@ -74,7 +77,8 @@ def get_ssh_config():
# list all the running boxes
def list_running_boxes():
output = subprocess.check_output(["vagrant", "status"]).split('\n')
output = to_text(subprocess.check_output(["vagrant", "status"]), errors='surrogate_or_strict').split('\n')
boxes = []
@ -90,7 +94,7 @@ def list_running_boxes():
def get_a_ssh_config(box_name):
"""Gives back a map of all the machine's ssh configurations"""
output = subprocess.check_output(["vagrant", "ssh-config", box_name])
output = to_text(subprocess.check_output(["vagrant", "ssh-config", box_name]), errors='surrogate_or_strict')
config = SSHConfig()
config.parse(StringIO(output))
host_config = config.lookup(box_name)
@ -104,6 +108,7 @@ def get_a_ssh_config(box_name):
return dict((v, host_config[k]) for k, v in _ssh_to_ansible)
# List out servers that vagrant has running
# ------------------------------
if options.list:

View file

@ -39,7 +39,7 @@ import re
import sys
import argparse
import os
from urlparse import urlparse
from ansible.module_utils.six.moves.urllib.parse import urlparse
from time import time
try:
import json

View file

@ -1,8 +1,11 @@
#!/usr/bin/env python
import optparse
import yaml
import re
from distutils.version import LooseVersion
import jinja2
import yaml
from jinja2 import Environment, FileSystemLoader
from ansible.playbook import Play
@ -18,7 +21,7 @@ class_list = [Play, Role, Block, Task]
p = optparse.OptionParser(
version='%prog 1.0',
usage='usage: %prog [options]',
description='Generate module documentation from metadata',
description='Generate playbook keyword documentation from code and descriptions',
)
p.add_option("-T", "--template-dir", action="store", dest="template_dir", default="../templates", help="directory containing Jinja2 templates")
p.add_option("-o", "--output-dir", action="store", dest="output_dir", default='/tmp/', help="Output directory for rst files")
@ -65,5 +68,10 @@ template = env.get_template(template_file)
outputname = options.output_dir + template_file.replace('.j2', '')
tempvars = {'oblist': oblist, 'clist': clist}
keyword_page = template.render(tempvars)
if LooseVersion(jinja2.__version__) < LooseVersion('2.10'):
# jinja2 < 2.10's indent filter indents blank lines. Cleanup
keyword_page = re.sub(' +\n', '\n', keyword_page)
with open(outputname, 'w') as f:
f.write(template.render(tempvars))
f.write(keyword_page)

View file

@ -1,6 +1,8 @@
#!/usr/bin/env python
import optparse
import os
import pprint
import sys
from jinja2 import Environment, FileSystemLoader
@ -8,6 +10,46 @@ from jinja2 import Environment, FileSystemLoader
from ansible.module_utils._text import to_bytes
def generate_parser():
p = optparse.OptionParser(
version='%prog 1.0',
usage='usage: %prog [options]',
description='Generate cli documentation from cli docstrings',
)
p.add_option("-t", "--template-file", action="store", dest="template_file", default="../templates/man.j2", help="path to jinja2 template")
p.add_option("-o", "--output-dir", action="store", dest="output_dir", default='/tmp/', help="Output directory for rst files")
p.add_option("-f", "--output-format", action="store", dest="output_format", default='man', help="Output format for docs (the default 'man' or 'rst')")
return p
# from https://www.python.org/dev/peps/pep-0257/
def trim_docstring(docstring):
if not docstring:
return ''
# Convert tabs to spaces (following the normal Python rules)
# and split into a list of lines:
lines = docstring.expandtabs().splitlines()
# Determine minimum indentation (first line doesn't count):
indent = sys.maxint
for line in lines[1:]:
stripped = line.lstrip()
if stripped:
indent = min(indent, len(line) - len(stripped))
# Remove indentation (first line is special):
trimmed = [lines[0].strip()]
if indent < sys.maxint:
for line in lines[1:]:
trimmed.append(line[indent:].rstrip())
# Strip off trailing and leading blank lines:
while trimmed and not trimmed[-1]:
trimmed.pop()
while trimmed and not trimmed[0]:
trimmed.pop(0)
# Return a single string:
return '\n'.join(trimmed)
def get_options(optlist):
''' get actual options '''
@ -24,107 +66,215 @@ def get_options(optlist):
return opts
def get_option_groups(option_parser):
groups = []
for option_group in option_parser.option_groups:
group_info = {}
group_info['desc'] = option_group.get_description()
group_info['options'] = option_group.option_list
group_info['group_obj'] = option_group
groups.append(group_info)
return groups
def opt_doc_list(cli):
''' iterate over options lists '''
results = []
for optg in cli.parser.option_groups:
results.extend(get_options(optg.option_list))
for option_group in cli.parser.option_groups:
results.extend(get_options(option_group.option_list))
results.extend(get_options(cli.parser.option_list))
return results
def opts_docs(cli, name):
# def opts_docs(cli, name):
def opts_docs(cli_class_name, cli_module_name):
''' generate doc structure from options '''
# cli name
if '-' in name:
name = name.split('-')[1]
else:
name = 'adhoc'
cli_name = 'ansible-%s' % cli_module_name
if cli_module_name == 'adhoc':
cli_name = 'ansible'
# cli info
# WIth no action/subcommand
# shared opts set
# instantiate each cli and ask its options
cli_klass = getattr(__import__("ansible.cli.%s" % cli_module_name,
fromlist=[cli_class_name]), cli_class_name)
cli = cli_klass([])
# parse the common options
try:
cli.parse()
except:
pass
# base/common cli info
docs = {
'cli': name,
'cli': cli_module_name,
'cli_name': cli_name,
'usage': cli.parser.usage,
'short_desc': cli.parser.description,
'long_desc': cli.__doc__,
'long_desc': trim_docstring(cli.__doc__),
'actions': {},
}
option_info = {'option_names': [],
'options': [],
'groups': []}
for extras in ('ARGUMENTS'):
if hasattr(cli, extras):
docs[extras.lower()] = getattr(cli, extras)
common_opts = opt_doc_list(cli)
groups_info = get_option_groups(cli.parser)
shared_opt_names = []
for opt in common_opts:
shared_opt_names.extend(opt.get('options', []))
option_info['options'] = common_opts
option_info['option_names'] = shared_opt_names
option_info['groups'].extend(groups_info)
docs.update(option_info)
# now for each action/subcommand
# force populate parser with per action options
if cli.VALID_ACTIONS:
docs['actions'] = {}
# use class attrs not the attrs on a instance (not that it matters here...)
for action in getattr(cli_klass, 'VALID_ACTIONS', ()):
# instantiate each cli and ask its options
action_cli_klass = getattr(__import__("ansible.cli.%s" % cli_module_name,
fromlist=[cli_class_name]), cli_class_name)
# init with args with action added?
cli = action_cli_klass([])
cli.args.append(action)
try:
cli.parse()
except:
pass
# FIXME/TODO: needed?
# avoid dupe errors
cli.parser.set_conflict_handler('resolve')
for action in cli.VALID_ACTIONS:
cli.args.append(action)
cli.set_action()
docs['actions'][action] = getattr(cli, 'execute_%s' % action).__doc__
cli.set_action()
action_info = {'option_names': [],
'options': []}
# docs['actions'][action] = {}
# docs['actions'][action]['name'] = action
action_info['name'] = action
action_info['desc'] = trim_docstring(getattr(cli, 'execute_%s' % action).__doc__)
# docs['actions'][action]['desc'] = getattr(cli, 'execute_%s' % action).__doc__.strip()
action_doc_list = opt_doc_list(cli)
uncommon_options = []
for action_doc in action_doc_list:
# uncommon_options = []
option_aliases = action_doc.get('options', [])
for option_alias in option_aliases:
if option_alias in shared_opt_names:
continue
# TODO: use set
if option_alias not in action_info['option_names']:
action_info['option_names'].append(option_alias)
if action_doc in action_info['options']:
continue
uncommon_options.append(action_doc)
action_info['options'] = uncommon_options
docs['actions'][action] = action_info
docs['options'] = opt_doc_list(cli)
return docs
if __name__ == '__main__':
template_file = 'man.j2'
parser = generate_parser()
options, args = parser.parse_args()
template_file = options.template_file
template_path = os.path.expanduser(template_file)
template_dir = os.path.abspath(os.path.dirname(template_path))
template_basename = os.path.basename(template_file)
output_dir = os.path.abspath(options.output_dir)
output_format = options.output_format
cli_modules = args
# various cli parsing things checks sys.argv if the 'args' that are passed in are []
# so just remove any args so the cli modules dont try to parse them resulting in warnings
sys.argv = [sys.argv[0]]
# need to be in right dir
os.chdir(os.path.dirname(__file__))
allvars = {}
output = {}
cli_list = []
for binary in os.listdir('../../lib/ansible/cli'):
cli_bin_name_list = []
# for binary in os.listdir('../../lib/ansible/cli'):
for cli_module_name in cli_modules:
binary = os.path.basename(os.path.expanduser(cli_module_name))
if not binary.endswith('.py'):
continue
elif binary == '__init__.py':
continue
libname = os.path.splitext(binary)[0]
print("Found CLI %s" % libname)
cli_name = os.path.splitext(binary)[0]
if libname == 'adhoc':
myclass = 'AdHocCLI'
output[libname] = 'ansible.1.asciidoc.in'
if cli_name == 'adhoc':
cli_class_name = 'AdHocCLI'
# myclass = 'AdHocCLI'
output[cli_name] = 'ansible.1.asciidoc.in'
cli_bin_name = 'ansible'
else:
myclass = "%sCLI" % libname.capitalize()
output[libname] = 'ansible-%s.1.asciidoc.in' % libname
# myclass = "%sCLI" % libname.capitalize()
cli_class_name = "%sCLI" % cli_name.capitalize()
output[cli_name] = 'ansible-%s.1.asciidoc.in' % cli_name
cli_bin_name = 'ansible-%s' % cli_name
# instantiate each cli and ask its options
mycli = getattr(__import__("ansible.cli.%s" % libname, fromlist=[myclass]), myclass)
cli_object = mycli([])
try:
cli_object.parse()
except:
# no options passed, we expect errors
pass
allvars[libname] = opts_docs(cli_object, libname)
for extras in ('ARGUMENTS'):
if hasattr(cli_object, extras):
allvars[libname][extras.lower()] = getattr(cli_object, extras)
# FIXME:
allvars[cli_name] = opts_docs(cli_class_name, cli_name)
cli_bin_name_list.append(cli_bin_name)
cli_list = allvars.keys()
for libname in cli_list:
doc_name_formats = {'man': '%s.1.asciidoc.in',
'rst': '%s.rst'}
for cli_name in cli_list:
# template it!
env = Environment(loader=FileSystemLoader('../templates'))
template = env.get_template('man.j2')
env = Environment(loader=FileSystemLoader(template_dir))
template = env.get_template(template_basename)
# add rest to vars
tvars = allvars[libname]
tvars = allvars[cli_name]
tvars['cli_list'] = cli_list
tvars['cli'] = libname
tvars['cli_bin_name_list'] = cli_bin_name_list
tvars['cli'] = cli_name
if '-i' in tvars['options']:
print('uses inventory')
manpage = template.render(tvars)
filename = '../man/man1/%s' % output[libname]
filename = os.path.join(output_dir, doc_name_formats[output_format] % tvars['cli_name'])
with open(filename, 'wb') as f:
f.write(to_bytes(manpage))
print("Wrote man docs to %s" % filename)
print("Wrote doc to %s" % filename)

View file

@ -30,6 +30,9 @@ import re
import sys
import warnings
from collections import defaultdict
from distutils.version import LooseVersion
from pprint import PrettyPrinter
try:
from html import escape as html_escape
except ImportError:
@ -39,6 +42,7 @@ except ImportError:
def html_escape(text, quote=True):
return cgi.escape(text, quote)
import jinja2
import yaml
from jinja2 import Environment, FileSystemLoader
from six import iteritems
@ -120,6 +124,9 @@ def write_data(text, output_dir, outputname, module=None):
if output_dir is not None:
if module:
outputname = outputname % module
if not os.path.exists(output_dir):
os.makedirs(output_dir)
fname = os.path.join(output_dir, outputname)
fname = fname.replace(".py", "")
with open(fname, 'wb') as f:
@ -379,6 +386,9 @@ def process_modules(module_map, templates, outputname, output_dir, ansible_versi
doc['returndocs'] = None
text = templates['plugin'].render(doc)
if LooseVersion(jinja2.__version__) < LooseVersion('2.10'):
# jinja2 < 2.10's indent filter indents blank lines. Cleanup
text = re.sub(' +\n', '\n', text)
write_data(text, output_dir, outputname, module)

View file

@ -4,6 +4,7 @@ FORMATTER=../bin/plugin_formatter.py
TESTING_FORMATTER=../bin/testing_formatter.sh
DUMPER=../bin/dump_keywords.py
CONFIG_DUMPER=../bin/dump_config.py
GENERATE_CLI=../bin/generate_man.py
ifeq ($(shell echo $(OS) | egrep -ic 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}')
else
@ -19,7 +20,8 @@ all: docs
docs: clean htmldocs
htmldocs: testing keywords modules staticmin config
htmldocs: testing keywords modules staticmin cli config
CPUS=$(CPUS) $(MAKE) -f Makefile.sphinx html
webdocs: docs
@ -45,9 +47,14 @@ clean:
-rm rst/*_maintained.rst
-rm rst/playbooks_directives.rst
-rm rst/playbooks_keywords.rst
# -rm rst/cli/ansible*.rst
.PHONEY: docs clean
# TODO: make generate_man output dir cli option
cli: $(GENERATE_CLI)
PYTHONPATH=../../lib $(GENERATE_CLI) --template-file=../templates/cli_rst.j2 --output-dir=rst/ --output-format rst ../../lib/ansible/cli/*.py
keywords: $(FORMATTER) ../templates/playbooks_keywords.rst.j2
PYTHONPATH=../../lib $(DUMPER) --template-dir=../templates --output-dir=rst/ -d ./keyword_desc.yml
@ -57,7 +64,7 @@ config:
modules: $(FORMATTER) ../templates/plugin.rst.j2
# Limit building of module documentation if requested.
ifdef MODULES
PYTHONPATH=../../lib $(FORMATTER) -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/ -l $(MODULES)
PYTHONPATH=../../lib $(FORMATTER) -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/ -l $(MODULES)
else
PYTHONPATH=../../lib $(FORMATTER) -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/
endif

View file

@ -0,0 +1,4 @@
{# Creates a banner at the top of the page for EOL versions. #}
<div id='banner' class='Admonition caution'>
<p>You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See <a href="https://docs.ansible.com/ansible/latest/index.html">the latest Ansible documentation</a>.</p>
</div>

View file

@ -33,6 +33,7 @@
{% if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{% endif %}
<link rel="canonical" href="https://docs.ansible.com/ansible/latest/{{ pagename }}.html"/>
{# CSS #}
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
@ -158,14 +159,14 @@
<a class="DocSiteProduct-header DocSiteProduct-header--core" href="/">
<div class="DocSiteProduct-productName">
<div class="DocSiteProduct-logoText">
Ansible
Ansible
<div class="DocSiteProduct-CurrentVersion" align="right">
devel
v2.4
</div>
</div>
</div>
</a>
<div class="DocSiteProduct-CheckVersionPara">For previous versions, see the <a class="DocSiteProduct-versionheader" href="/#coreversionselect">documentation archive.</a></div>
</div>
@ -228,6 +229,7 @@
</div> -->
{% include "breadcrumbs.html" %}
{% include "ansible_eol_banner.html" %}
<div id="page-content">
{% block body %}{% endblock %}
</div>

View file

@ -1,55 +1,72 @@
accelerate: DEPRECATED, set to True to use accelerate connection plugin.
accelerate_ipv6: DEPRECATED, set to True to force accelerate plugin to use ipv6 for it's connection.
accelerate_port: DEPRECATED, set to override default port use for accelerate connection.
action: The 'action' to execute for a task, it normally translates into a C(module) or action plugin.
args: DEPRECATED, A secondary way to add arguments into a task, it takes a dictionary in which keys map to options and values .. well you get it.
accelerate: "*DEPRECATED*, set to True to use accelerate connection plugin."
accelerate_ipv6: "*DEPRECATED*, set to True to force accelerate plugin to use ipv6 for its connection."
accelerate_port: "*DEPRECATED*, set to override default port use for accelerate connection."
action: "The 'action' to execute for a task, it normally translates into a C(module) or action plugin."
args: "*DEPRECATED*, A secondary way to add arguments into a task. Takes a dictionary in which keys map to options and values."
always: List of tasks, in a block, that execute no matter if there is an error in the block or not.
always_run: DEPRECATED, forces a task to run even in check mode, use check_mode directive instead.
always_run: "*DEPRECATED*, forces a task to run even in check mode. Use :term:`check_mode` directive instead."
any_errors_fatal: Force any un-handled task errors on any host to propagate to all hosts and end the play.
async: Run a task asyncronouslly if the C(action) supports this.
become: Boolean that controls if privilege escalation is used or not on Task execution.
become_flags: A string of flag(s) to pass to the privilege escalation program when ``become`` is True.
become_method: Which method of privilege escalation to use. i.e. sudo/su/etc.
become_user: User that you 'become' after using privilege escalation, the remote/login user must have permissions to become this user.
become: Boolean that controls if privilege escalation is used or not on :term:`Task` execution.
become_flags: A string of flag(s) to pass to the privilege escalation program when :term:`become` is True.
become_method: Which method of privilege escalation to use (such as sudo or su).
become_user: "User that you 'become' after using privilege escalation. The remote/login user must have permissions to become this user."
block: List of tasks in a block.
changed_when: Conditional expression that overrides the task's normal 'changed' status.
check_mode: A boolean that controls if a task is executed in 'check' mode
connection: Allows you to change the connection plugin used for tasks to execute on the target.
delay: Number of seconds to delay between retries, this setting only makes sense when used with 'until'.
delegate_facts: Boolean that allows you to apply facts to delegated host instead of inventory_hostname.
delegate_to: Host to execute task instead of the target (inventory_hostname), connection vars from the delegated host will also be used for the task.
diff: Toggle to make tasks return 'diff' information or not.
changed_when: "Conditional expression that overrides the task's normal 'changed' status."
check_mode: |
A boolean that controls if a task is executed in 'check' mode
.. seealso:: :ref:`check_mode_dry`
connection: |
Allows you to change the connection plugin used for tasks to execute on the target.
.. seealso:: :ref:`using_connection`
delay: Number of seconds to delay between retries. This setting is only used in combination with :term:`until`.
delegate_facts: Boolean that allows you to apply facts to a delegated host instead of inventory_hostname.
delegate_to: Host to execute task instead of the target (inventory_hostname). Connection vars from the delegated host will also be used for the task.
diff: "Toggle to make tasks return 'diff' information or not."
environment: A dictionary that gets converted into environment vars to be provided for the task upon execution.
fact_path: Set the fact path option for the fact gathering plugin controlled by ``gather_facts``.
failed_when: Conditional expression that overrides the task's normal 'failed' status.
force_handlers: Will force notified handler execution for hosts even if they failed during the play, it will not trigger if the play itself fails.
gather_facts: A boolean that controls if the play will automatically run the 'setup' task to gather facts for the hosts.
gather_subset: Allows you to pass subset options to the fact gathering plugin controlled by ``gather_facts``.
gather_timeout: Allows you to set the timeout for the fact gathering plugin controlled by ``gather_facts``.
handlers: A section with tasks that are treated as handlers, these won't get executed normally, only when notified. After each section of tasks is complete.
hosts: A list of groups, hosts or host pattern that translates into a list of hosts that are the play's target.
fact_path: Set the fact path option for the fact gathering plugin controlled by :term:`gather_facts`.
failed_when: "Conditional expression that overrides the task's normal 'failed' status."
force_handlers: Will force notified handler execution for hosts even if they failed during the play. Will not trigger if the play itself fails.
gather_facts: "A boolean that controls if the play will automatically run the 'setup' task to gather facts for the hosts."
gather_subset: Allows you to pass subset options to the fact gathering plugin controlled by :term:`gather_facts`.
gather_timeout: Allows you to set the timeout for the fact gathering plugin controlled by :term:`gather_facts`.
handlers: "A section with tasks that are treated as handlers, these won't get executed normally, only when notified after each section of tasks is complete."
hosts: "A list of groups, hosts or host pattern that translates into a list of hosts that are the play's target."
ignore_errors: Boolean that allows you to ignore task failures and continue with play. It does not affect connection errors.
loop_control: Several keys here allow you to modify/set loop behaviour in a task see http://docs.ansible.com/ansible/latest/playbooks_loops.html#loop-control for details.
loop: "Takes a list for the task to iterate over, saving each list element into the ``item`` variable (configurable via loop_control)"
loop_control: |
Several keys here allow you to modify/set loop behaviour in a task.
.. seealso:: :ref:`loop_control`
max_fail_percentage: can be used to abort the run after a given percentage of hosts in the current batch has failed.
name: It's a name, works mostly for documentation, in the case of tasks/handlers it can be an identifier.
name: "Identifier. Can be used for documentation, in or tasks/handlers."
no_log: Boolean that controls information disclosure.
notify: list of handlers to notify when the task returns a 'changed=True' status.
notify: "List of handlers to notify when the task returns a 'changed=True' status."
order: Controls the sorting of hosts as they are used for executing the play. Possible values are inventory (default), sorted, reverse_sorted, reverse_inventory and shuffle.
poll: Sets the polling interval in seconds for async tasks (default 10s).
port: Used to override the default port used in a connection.
post_tasks: A list of tasks to execute after the ``tasks`` section.
pre_tasks: A list of tasks to execute before ``roles``.
remote_user: User used to log into the target via the connection plugin. AKA login user.
post_tasks: A list of tasks to execute after the :term:`tasks` section.
pre_tasks: A list of tasks to execute before :term:`roles`.
remote_user: User used to log into the target via the connection plugin.
register: Name of variable that will contain task status and module return data.
rescue: List of tasks in a block that run if there is a task error in the main ``block`` list.
retries: Number of retries before giving up in a 'until' loop, this setting is ignored on it's own.
rescue: List of tasks in a :term:`block` that run if there is a task error in the main :term:`block` list.
retries: "Number of retries before giving up in a :term:`until` loop. This setting is only used in combination with :term:`until`."
roles: List of roles to be imported into the play
run_once: Boolean that will bypass the host loop, forcing the task to execute on the first host available and will also apply any facts to all active hosts.
serial: Defines the 'batch' of hosts to execute the current play until the end.
serial: |
Explicitly define how Ansible batches the execution of the current play on the play's target
.. seealso:: :ref:`rolling_update_batch_size`
strategy: Allows you to choose the connection plugin to use for the play.
tags: Tags applied to the task or included tasks, this allows selecting subsets of tasks from the command line.
tasks: Main list of tasks to execute in the play, they run after ``roles`` and before ``post_tasks``.
until: This keyword implies a 'retry loop' that will go on until the condition supplied here is met or we hit the retry limit.
tasks: Main list of tasks to execute in the play, they run after :term:`roles` and before :term:`post_tasks`.
until: "This keyword implies a ':term:`retries` loop' that will go on until the condition supplied here is met or we hit the :term:`retries` limit."
vars: Dictionary/map of variables
vars_files: List of files that contain vars to include in the play.
vars_prompt: list of variables to prompt for.

View file

@ -8,7 +8,7 @@ Ansible can use existing privilege escalation systems to allow a user to execute
Become
``````
Ansible allows you to 'become' another user, different from the user that logged into the machine (remote user). This is done using existing
privilege escalation tools, which you probably already use or have configured, like `sudo`, `su`, `pfexec`, `doas`, `pbrun`, `dzdo`, `ksu` and others.
privilege escalation tools, which you probably already use or have configured, like `sudo`, `su`, `pfexec`, `doas`, `pbrun`, `dzdo`, `ksu`, and others.
.. note:: Before 1.9 Ansible mostly allowed the use of `sudo` and a limited use of `su` to allow a login/remote user to become a different user

View file

@ -0,0 +1,15 @@
Command Line Tools
==================
.. toctree:: :maxdepth: 1
ansible
ansible-playbook
ansible-vault
ansible-galaxy
ansible-console
ansible-config
ansible-doc
ansible-inventory
ansible-pull

View file

@ -3,7 +3,7 @@ Committers Guidelines (for people with commit rights to Ansible on GitHub)
These are the guidelines for people with commit access to Ansible. Committers are essentially acting as members of the Ansible Core team, although not necessarily as an employee of Ansible and Red Hat. Please read the guidelines before you commit.
These guidelines apply to everyone. At the same time, this ISNT a process document. So just use good judgement. Youve been given commit access because we trust your judgement.
These guidelines apply to everyone. At the same time, this ISN'T a process document. So just use good judgement. You've been given commit access because we trust your judgement.
That said, use the trust wisely.
@ -19,18 +19,18 @@ Any other new features and changes to high level design should go through the pr
Our Workflow on GitHub
======================
As a committer, you may already know this, but our workflow forms a lot of our team policies. Please ensure youre aware of the following workflow steps:
As a committer, you may already know this, but our workflow forms a lot of our team policies. Please ensure you're aware of the following workflow steps:
* Fork the repository upon which you want to do some work to your own personal repository
* Work on the specific branch upon which you need to commit
* Create a Pull Request back to the Ansible repository and tag the people you would like to review; assign someone as the primary “owner” of your request
* Create a Pull Request back to the Ansible repository and tag the people you would like to review; assign someone as the primary "owner" of your request
* Adjust code as necessary based on the Comments provided
* Ask someone on the Core Team to do a final review and merge
Addendum to workflow for Committers:
------------------------------------
The Core Team is aware that this can be a difficult process at times. Sometimes, the team breaks the rules: Direct commits, merging their own PRs. This section is a set of guidelines. If youre changing a comma in a doc, or making a very minor change, you can use your best judgement. This is another trust thing. The process is critical for any major change, but for little things or getting something done quickly, use your best judgement and make sure people on the team are aware of your work.
The Core Team is aware that this can be a difficult process at times. Sometimes, the team breaks the rules: Direct commits, merging their own PRs. This section is a set of guidelines. If you're changing a comma in a doc, or making a very minor change, you can use your best judgement. This is another trust thing. The process is critical for any major change, but for little things or getting something done quickly, use your best judgement and make sure people on the team are aware of your work.
Roles on Core
=============
@ -41,12 +41,12 @@ General Rules
=============
Individuals with direct commit access to ansible/ansible are entrusted with powers that allow them to do a broad variety of things--probably more than we can write down. Rather than rules, treat these as general *guidelines*, individuals with this power are expected to use their best judgement.
* Dont
* Don't
- Commit directly.
- Merge your own PRs. Someone else should have a chance to review and approve the PR merge. If you are a Core Committer, you have a small amount of leeway here for very minor changes.
- Forget about alternate environments. Consider the alternatives--yes, people have bad environments, but they are the ones who need us the most.
- Drag your community team members down. Always discuss the technical merits, but you should never address the persons limitations (you can later go for beers and call them idiots, but not in IRC/Github/etc.).
- Drag your community team members down. Always discuss the technical merits, but you should never address the person's limitations (you can later go for beers and call them idiots, but not in IRC/Github/etc.).
- Forget about the maintenance burden. Some things are really cool to have, but they might not be worth shoehorning in if the maintenance burden is too great.
- Break playbooks. Always keep backwards compatibility in mind.
- Forget to keep it simple. Complexity breeds all kinds of problems.
@ -55,12 +55,12 @@ Individuals with direct commit access to ansible/ansible are entrusted with powe
- Squash, avoid merges whenever possible, use github's squash commits or cherry pick if needed (bisect thanks you).
- Be active. Committers who have no activity on the project (through merges, triage, commits, etc.) will have their permissions suspended.
- Consider backwards compatibility (goes back to "dont break existing playbooks").
- Consider backwards compatibility (goes back to "don't break existing playbooks").
- Write tests. PRs with tests are looked at with more priority than PRs without tests that should have them included. While not all changes require tests, be sure to add them for bug fixes or functionality changes.
- Discuss with other committers, specially when you are unsure of something.
- Document! If your PR is a new feature or a change to behavior, make sure you've updated all associated documentation or have notified the right people to do so. It also helps to add the version of Core against which this documentation is compatible (to avoid confusion with stable versus devel docs, for backwards compatibility, etc.).
- Consider scope, sometimes a fix can be generalized
- Keep it simple, then things are maintainable, debuggable and intelligible.
- Keep it simple, then things are maintainable, debuggable, and intelligible.
Committers are expected to continue to follow the same community and contribution guidelines followed by the rest of the Ansible community.

View file

@ -2,7 +2,7 @@ Community Information & Contributing
````````````````````````````````````
Ansible is an open source project designed to bring together administrators and developers of all kinds to collaborate on building
IT automation solutions that work well for them.
IT automation solutions that work well for them.
Should you wish to get more involved -- whether in terms of just asking a question, helping other users, introducing new people to Ansible, or helping with the software or documentation, we welcome your contributions to the project.
@ -16,7 +16,7 @@ I've Got A Question
We're happy to help!
Ansible questions are best asked on the `Ansible Google Group Mailing List <http://groups.google.com/group/ansible-project>`_.
Ansible questions are best asked on the `Ansible Google Group Mailing List <http://groups.google.com/group/ansible-project>`_.
This is a very large high-traffic list for answering questions and sharing tips
and tricks. Anyone can join, and email delivery is optional if you just want to read the group online. To cut down on spam, your first post is moderated, though posts are approved quickly.
@ -42,10 +42,10 @@ This is a low-traffic read-only list, where we'll share release announcements an
I'd Like To Help Share and Promote Ansible
------------------------------------------
You can help share Ansible with others by telling friends and colleagues, writing a blog post,
or presenting at user groups (like DevOps groups or the local LUG).
You can help share Ansible with others by telling friends and colleagues, writing a blog post,
or presenting at user groups (like DevOps groups or the local LUG).
You are also welcome to share slides on speakerdeck, sign up for a free account and tag it “Ansible”. On Twitter,
You are also welcome to share slides on speakerdeck, sign up for a free account, and tag it "Ansible". On Twitter,
you can also share things with #ansible and may wish to `follow us <https://twitter.com/ansible>`_.
I'd Like To Help Ansible Move Faster
@ -73,31 +73,31 @@ more quickly.
Do not use the issue tracker for "how do I do this" type questions. These are great candidates
for IRC or the mailing list instead where things are likely to be more of a discussion.
To be respectful of reviewers' time and allow us to help everyone efficiently, please
To be respectful of reviewers' time and allow us to help everyone efficiently, please
provide minimal well-reduced and well-commented examples versus sharing your entire production
playbook. Include playbook snippets and output where possible.
playbook. Include playbook snippets and output where possible.
When sharing YAML in playbooks, formatting can be preserved by using `code blocks <https://help.github.com/articles/creating-and-highlighting-code-blocks/>`_.
For multiple-file content, we encourage use of gist.github.com. Online pastebin content can expire, so it's nice to have things around for a longer term if they
are referenced in a ticket.
If you are not sure if something is a bug yet, you are welcome to ask about something on
the mailing list or IRC first.
If you are not sure if something is a bug yet, you are welcome to ask about something on
the mailing list or IRC first.
As we are a very high volume project, if you determine that
As we are a very high volume project, if you determine that
you do have a bug, please be sure to open the issue yourself to ensure we have a record of
it. Dont rely on someone else in the community to file the bug report for you.
it. Don't rely on someone else in the community to file the bug report for you.
It may take some time to get to your report, see our information about priority flags below.
I'd Like To Help With Documentation
-----------------------------------
Ansible documentation is a community project too!
Ansible documentation is a community project too!
If you would like to help with the
documentation, whether correcting a typo or improving a section, or maybe even
If you would like to help with the
documentation, whether correcting a typo or improving a section, or maybe even
documenting a new feature, submit a GitHub pull request to the code that
lives in the ``docsite/rst`` subdirectory of the project for most pages, and there is an "Edit on GitHub"
link up on those.
@ -107,9 +107,9 @@ Module documentation is generated from a ``DOCUMENTATION`` structure embedded in
For more information on module documentation see `How to document modules <http://docs.ansible.com/ansible/dev_guide/developing_modules_documenting.html>`_.
Aside from modules, the main docs are in restructured text
format.
format.
If you arent comfortable with restructured text, you can also open a ticket on
If you aren't comfortable with restructured text, you can also open a ticket on
GitHub about any errors you spot or sections you would like to see added. For more information
on creating pull requests, please refer to the
`GitHub help guide <https://help.github.com/articles/using-pull-requests>`_.
@ -155,7 +155,7 @@ If you make a mistake you do not need to close your PR. Instead, create a clean
with ``--force`` to overwrite the existing branch (permissible in this case as no one else should be using that
branch as reference). Code comments won't be lost, they just won't be attached to the existing branch.
Well then review your contributions and engage with you about questions and so on.
We'll then review your contributions and engage with you about questions and so on.
Because we have a very large and active community it may take awhile to get your contributions
in! See the notes about priorities in a later section for understanding our work queue.
@ -171,18 +171,18 @@ Contributions can be for new features like modules, or to fix bugs you or others
are interested in writing new modules to be included in the core Ansible distribution, please refer
to the `module development documentation <http://docs.ansible.com/developing_modules.html>`_.
Ansible's aesthetic encourages simple, readable code and consistent,
conservatively extending, backwards-compatible improvements. When contributing code to Ansible,
Ansible's aesthetic encourages simple, readable code, and consistent,
conservatively extending, backwards-compatible improvements. When contributing code to Ansible,
please observe the following guidelines:
- Code developed for Ansible needs to support Python2-2.6 or higher and Python3-3.5 or higher.
- Use a 4-space indent, not tabs.
- We do not enforce 80 column lines; up to 160 columns are acceptable.
- We do not accept 'style only' pull requests unless the code is nearly unreadable.
- We are "PEP8ish", but not strictly compliant, see :doc:`testing_pep8` for more information.
- We are not strictly compliant with PEP8. See :doc:`dev_guide/testing_pep8` for more information.
You can also contribute by testing and revising other requests, especially if it is one you are interested
in using. Please keep your comments clear and to the point, courteous and constructive, tickets are not a
in using. Please keep your comments clear, to the point, courteous, and constructive, tickets are not a
good place to start discussions (ansible-devel and IRC exist for this).
Tip: To easily run from a checkout, source ``./hacking/env-setup`` and that's it -- no install
@ -194,7 +194,7 @@ Other Topics
Ansible Staff
-------------
Ansible, Inc is a company supporting Ansible and building additional solutions based on
Ansible, Inc. is a company supporting Ansible and building additional solutions based on
Ansible. We also do services and support for those that are interested. We also offer an
enterprise web front end to Ansible (see Tower below).
@ -228,7 +228,7 @@ To subscribe to a group from a non-google account, you can send an email to the
IRC Meetings
------------
The Ansible community holds regular IRC meetings on various topics, and anyone who is interested is invited to
The Ansible community holds regular IRC meetings on various topics, and anyone who is interested is invited to
participate. For more information about Ansible meetings, consult the `meeting schedule and agenda page <https://github.com/ansible/community/blob/master/meetings/README.md>`_.
Release Numbering
@ -286,7 +286,7 @@ These labels don't really have a definition - they are a simple ordering. Howev
affecting a major module (yum, apt, etc) is likely to be prioritized higher than a module
affecting a smaller number of users.
Since we place a strong emphasis on testing and code review, it may take a few months for a minor feature to get merged. This doesn't mean that we'll be exhausting all of the higher-priority queues before getting to your ticket; we will also take periodic sweeps through the lower priority queues and give them some attention as well, particularly in the area of new module changes.
Since we place a strong emphasis on testing and code review, it may take a few months for a minor feature to get merged. This doesn't mean that we'll be exhausting all of the higher-priority queues before getting to your ticket; we will also take periodic sweeps through the lower priority queues and give them some attention as well, particularly in the area of new module changes.
Every bit of effort helps - if you're wishing to expedite the inclusion of a P3 feature pull request for instance, the best thing you can do is help close P2 bug reports.
@ -310,7 +310,7 @@ All Ansible events and participants therein are governed by this Code of Conduct
anti-harassment policy. We expect organizers to enforce these guidelines throughout all events,
and we expect attendees, speakers, sponsors, and volunteers to help ensure a safe
environment for our whole community. Specifically, this Code of Conduct covers
participation in all Ansible-related forums and mailing lists, code and documentation
participation in all Ansible-related forums, mailing lists, code, documentation
contributions, public IRC channels, private correspondence, and public meetings.
Ansible community members are...
@ -341,7 +341,7 @@ rudeness, hostility, threatening behavior, abuse (verbal or physical), or person
**Kind**
Everyone should feel welcome in the Ansible community, regardless of their background.
Please be courteous, respectful and polite to fellow community members. Do not make or
Please be courteous, respectful, and polite to fellow community members. Do not make or
post offensive comments related to skill level, gender, gender identity or expression,
sexual orientation, disability, physical appearance, body size, race, or religion.
Sexualized images or imagery, real or implied violence, intimidation, oppression,

View file

@ -41,9 +41,9 @@ Each module has at least one assigned maintainer, listed in a `maintainer's file
.. _Ansibullbot: https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md
.. _maintainer's file: https://github.com/ansible/ansible/blob/devel/.github/BOTMETA.yml
Some modules have no community maintainers assigned. In this case, the maintainer is listed as ``$team_ansible``. Ultimately, its our goal to have at least one community maintainer for every module.
Some modules have no community maintainers assigned. In this case, the maintainer is listed as ``$team_ansible``. Ultimately, it's our goal to have at least one community maintainer for every module.
The maintainers job is to review PRs and decide whether that PR should be merged (``shipit``) or revised (``needs_revision``).
The maintainer's job is to review PRs and decide whether that PR should be merged (``shipit``) or revised (``needs_revision``).
The ultimate goal of any pull request is to reach **shipit** status, where the Core team then decides whether the PR is ready to be merged. Not every PR that reaches the **shipit** label is actually ready to be merged, but the better our reviewers are, and the better our guidelines are, the more likely it will be that a PR that reaches **shipit** will be mergeable.
@ -54,7 +54,7 @@ Workflow
Ansibullbot runs continuously. You can generally expect to see changes to your issue or pull request within thirty minutes. Ansibullbot examines every open pull request in the repositories, and enforces state roughly according to the following workflow:
- If a pull request has no workflow labels, its considered **new**. Files in the pull request are identified, and the maintainers of those files are pinged by the bot, along with instructions on how to review the pull request. (Note: sometimes we strip labels from a pull request to “reboot” this process.)
- If a pull request has no workflow labels, it's considered **new**. Files in the pull request are identified, and the maintainers of those files are pinged by the bot, along with instructions on how to review the pull request. (Note: sometimes we strip labels from a pull request to "reboot" this process.)
- If the module maintainer is not ``$team_ansible``, the pull request then goes into the **community_review** state.
- If the module maintainer is ``$team_ansible``, the pull request then goes into the **core_review** state (and probably sits for a while).
- If the pull request is in **community_review** and has received comments from the maintainer:
@ -110,4 +110,4 @@ Special Labels
- **new_plugin**: this is for new modules or plugins that are not yet in Ansible.
**Note:** `new_plugin` kicks off a completely separate process, and frankly it doesnt work very well at present. Were working our best to improve this process.
**Note:** `new_plugin` kicks off a completely separate process, and frankly it doesn't work very well at present. We're working our best to improve this process.

View file

@ -15,13 +15,13 @@ In addition to the information below, module maintainers should be familiar with
Maintainer Responsibilities
===========================
When you contribute a new module to the [ansible/ansible](https://github.com/ansible/ansible) repository, you become the maintainer for that module once it has been merged. Maintainership empowers you with the authority to accept, reject, or request revisions to pull requests on your module -- but as they say, "with great power comes great responsibility."
When you contribute a new module to the `ansible/ansible <https://github.com/ansible/ansible>`_ repository, you become the maintainer for that module once it has been merged. Maintainership empowers you with the authority to accept, reject, or request revisions to pull requests on your module -- but as they say, "with great power comes great responsibility."
Maintainers of Ansible modules are expected to provide feedback, responses, or actions on pull requests or issues to the module(s) they maintain in a reasonably timely manner.
It is also recommended that you occasionally revisit the [contribution guidelines](https://github.com/ansible/ansible/blob/devel/CONTRIBUTING.md), as they are continually refined. Occasionally, you may be requested to update your module to move it closer to the general accepted standard requirements. We hope for this to be infrequent, and will always be a request with a fair amount of lead time (ie: not by tomorrow!).
It is also recommended that you occasionally revisit the `contribution guidelines <https://github.com/ansible/ansible/blob/devel/CONTRIBUTING.md>`_, as they are continually refined. Occasionally, you may be requested to update your module to move it closer to the general accepted standard requirements. We hope for this to be infrequent, and will always be a request with a fair amount of lead time (ie: not by tomorrow!).
Finally, following the [ansible-devel](https://groups.google.com/forum/#!forum/ansible-devel) mailing list can be a great way to participate in the broader Ansible community, and a place where you can influence the overall direction, quality, and goals of Ansible and its modules. If you're not on this relatively low-volume list, please join us here: https://groups.google.com/forum/#!forum/ansible-devel
Finally, following the `ansible-devel <https://groups.google.com/forum/#!forum/ansible-devel>`_ mailing list can be a great way to participate in the broader Ansible community, and a place where you can influence the overall direction, quality, and goals of Ansible and its modules. If you're not on this relatively low-volume list, please join us here: https://groups.google.com/forum/#!forum/ansible-devel
The Ansible community hopes that you will find that maintaining your module is as rewarding for you as having the module is for the wider community.
@ -31,21 +31,21 @@ Pull Requests, Issues, and Workflow
Pull Requests
-------------
Module pull requests are located in the [main Ansible repository](https://github.com/ansible/ansible/pulls).
Module pull requests are located in the `main Ansible repository <https://github.com/ansible/ansible/pulls>`_.
Because of the high volume of pull requests, notification of PRs to specific modules are routed by an automated bot to the appropriate maintainer for handling. It is recommended that you set an appropriate notification process to receive notifications which mention your GitHub ID.
Issues
------
Issues for modules, including bug reports, documentation bug reports, and feature requests, are tracked in the [ansible repository](https://github.com/ansible/ansible/issues).
Issues for modules, including bug reports, documentation bug reports, and feature requests, are tracked in the `ansible repository <https://github.com/ansible/ansible/issues>`_.
Issues for modules are routed to their maintainers via an automated process. This process is still being refined, and currently depends upon the issue creator to provide adequate details (specifically, providing the proper module name) in order to route it correctly. If you are a maintainer of a specific module, it is recommended that you periodically search module issues for issues which mention your module's name (or some variation on that name), as well as setting an appropriate notification process for receiving notification of mentions of your GitHub ID.
PR Workflow
-----------
Automated routing of pull requests is handled by a tool called [Ansibot](https://github.com/ansible/ansibullbot).
Automated routing of pull requests is handled by a tool called `Ansibot <https://github.com/ansible/ansibullbot>`_.
Being moderately familiar with how the workflow behind the bot operates can be helpful to you, and -- should things go awry -- your feedback can be helpful to the folks that continually help Ansibullbot to evolve.

View file

@ -25,7 +25,7 @@ For multiple-file content, we encourage use of gist.github.com. Online pastebin
If you are not sure if something is a bug yet, you are welcome to ask about something on the mailing list or IRC first.
As we are a very high volume project, if you determine that you do have a bug, please be sure to open the issue yourself to ensure we have a record of it. Dont rely on someone else in the community to file the bug report for you.
As we are a very high volume project, if you determine that you do have a bug, please be sure to open the issue yourself to ensure we have a record of it. Don't rely on someone else in the community to file the bug report for you.
Requesting a feature
====================

View file

@ -44,8 +44,8 @@ In 2.0 things get a bit more complicated to start, but you end up with much more
import json
from collections import namedtuple
from ansible.parsing.dataloader import DataLoader
from ansible.vars import VariableManager
from ansible.inventory import Inventory
from ansible.vars.manager import VariableManager
from ansible.inventory.manager import InventoryManager
from ansible.playbook.play import Play
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.plugins.callback import CallbackBase
@ -63,21 +63,21 @@ In 2.0 things get a bit more complicated to start, but you end up with much more
This method could store the result in an instance attribute for retrieval later
"""
host = result._host
print json.dumps({host.name: result._result}, indent=4)
print(json.dumps({host.name: result._result}, indent=4))
Options = namedtuple('Options', ['connection', 'module_path', 'forks', 'become', 'become_method', 'become_user', 'check'])
Options = namedtuple('Options', ['connection', 'module_path', 'forks', 'become', 'become_method', 'become_user', 'check', 'diff'])
# initialize needed objects
variable_manager = VariableManager()
loader = DataLoader()
options = Options(connection='local', module_path='/path/to/mymodules', forks=100, become=None, become_method=None, become_user=None, check=False)
options = Options(connection='local', module_path='/path/to/mymodules', forks=100, become=None, become_method=None, become_user=None, check=False,
diff=False)
passwords = dict(vault_pass='secret')
# Instantiate our ResultCallback for handling results as they come in
results_callback = ResultCallback()
# create inventory and pass to var manager
inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list='localhost')
variable_manager.set_inventory(inventory)
inventory = InventoryManager(loader=loader, sources=['localhost'])
variable_manager = VariableManager(loader=loader, inventory=inventory)
# create play with tasks
play_source = dict(

View file

@ -55,7 +55,7 @@ The complete module metadata specification is here: `Ansible metadata block <htt
* Examples--include them whenever possible and make sure they are reproducible.
* Document the return structure of the module. Refer to :ref:`common_return_values` and :ref:`module_documenting` for additional information.
* Predictable user interface: This is a particularly important section as it is also an area where we need significant improvements.
* Name consistency across modules (weve gotten better at this, but we still have many deviations).
* Name consistency across modules (we've gotten better at this, but we still have many deviations).
* Declarative operation (not CRUD)--this makes it easy for a user not to care what the existing state is, just about the final state. ``started/stopped``, ``present/absent``--don't overload options too much. It is preferable to add a new, simple option than to add choices/states that don't fit with existing ones.
* Keep options small, having them take large data structures might save us a few tasks, but adds a complex requirement that we cannot easily validate before passing on to the module.
* Allow an "expert mode". This may sound like the absolute opposite of the previous one, but it is always best to let expert users deal with complex data. This requires different modules in some cases, so that you end up having one (1) expert module and several 'piecemeal' ones (ec2_vpc_net?). The reason for this is not, as many users express, because it allows a single task and keeps plays small (which just moves the data complexity into vars files, leaving you with a slightly different structure in another YAML file). It does, however, allow for a more 'atomic' operation against the underlying APIs and services.

View file

@ -109,11 +109,11 @@ Structure
Fields
^^^^^^
:metadata_version: An “X.Y” formatted string. X and Y are integers which
:metadata_version: An "X.Y" formatted string. X and Y are integers which
define the metadata format version. Modules shipped with Ansible are
tied to an Ansible release, so we will only ship with a single version
of the metadata. Well increment Y if we add fields or legal values
to an existing field. Well increment X if we remove fields or values
of the metadata. We'll increment Y if we add fields or legal values
to an existing field. We'll increment X if we remove fields or values
or change the type or meaning of a field.
Current metadata_version is "1.1"
:supported_by: This field records who supports the module.
@ -130,13 +130,13 @@ Fields
`Modules Support <http://docs.ansible.com/ansible/modules_support.html>`_.
:status: This field records information about the module that is
important to the end user. Its a list of strings. The default value
is a single element list [“preview”]. The following strings are valid
important to the end user. It's a list of strings. The default value
is a single element list ["preview"]. The following strings are valid
statuses and have the following meanings:
:stableinterface: This means that the modules parameters are
:stableinterface: This means that the module's parameters are
stable. Every effort will be made not to remove parameters or change
their meaning. It is not a rating of the modules code quality.
their meaning. It is not a rating of the module's code quality.
:preview: This module is a tech preview. This means it may be
unstable, the parameters may change, or it may require libraries or
web services that are themselves subject to incompatible changes.
@ -223,6 +223,8 @@ The following fields can be used and are all required unless specified otherwise
* If `required` is false/missing, `default` may be specified (assumed 'null' if missing).
* Ensure that the default parameter in the docs matches the default parameter in the code.
* The default option must not be listed as part of the description.
* If the option is a boolean value, you can use any of the boolean values recognized by Ansible:
(such as true/false or yes/no). Choose the one that reads better in the context of the option.
:choices:
List of option values. Should be absent if empty.
:type:

View file

@ -26,7 +26,7 @@ Although it's tempting to get straight into coding, there are a few things to be
* Shared code can be placed into ``lib/ansible/module_utils/``
* Shared documentation (for example describing common arguments) can be placed in ``lib/ansible/utils/module_docs_fragments/``.
* With great power comes great responsibility: Ansible module maintainers have a duty to help keep modules up to date. As with all successful community projects, module maintainers should keep a watchful eye for reported issues and contributions.
* Although not required, unit and/or integration tests are strongly recommended. Unit tests are especially valuable when external resources (such as cloud or network devices) are required. For more information see :doc:`testing` and the `Testing Working Group <https://github.com/ansible/community/blob/master/meetings/README.md>`_.
* Although not required, unit and/or integration tests are strongly recommended. Unit tests are especially valuable when external resources (such as cloud or network devices) are required. For more information see :doc:`dev_guide/testing` and the `Testing Working Group <https://github.com/ansible/community/blob/master/meetings/README.md>`_.
* Starting with Ansible 2.4 all :doc:`../list_of_network_modules` MUST have unit tests.

View file

@ -295,7 +295,7 @@ new exception-catching syntax which uses the ``as`` keyword:
Do **not** use the following syntax as it will fail on every version of Python-3:
.. This code block won't highlight because python2 isn't recognized. This is necessary to pass tests under python 3.
.. code-block:: python2
.. code-block:: none
try:
a = 2/0

View file

@ -30,7 +30,6 @@ To get started, select one of the following topics.
developing_core
developing_python3
developing_api
developing_test_pr
developing_rebasing
testing
repomerge

View file

@ -25,7 +25,7 @@ Inventory
By default, Ansible represents what machines it manages using a very simple INI file that puts all of your managed machines in groups of your own choosing.
To add new machines, there is no additional SSL signing server involved, so there's never any hassle deciding why a particular machine didnt get linked up due to obscure NTP or DNS issues.
To add new machines, there is no additional SSL signing server involved, so there's never any hassle deciding why a particular machine didn't get linked up due to obscure NTP or DNS issues.
If there's another source of truth in your infrastructure, Ansible can also plugin to that, such as drawing inventory, group, and variable information from sources like EC2, Rackspace, OpenStack, and more.
@ -69,4 +69,4 @@ Here's what a simple playbook looks like::
Extending Ansible with Plug-ins and the API
````````````````````````````````````````````
Should you want to write your own, Ansible modules can be written in any language that can return JSON (Ruby, Python, bash, etc). Inventory can also plug in to any datasource by writing a program that speaks to that datasource and returns JSON. There's also various Python APIs for extending Ansibles connection types (SSH is not the only transport possible), callbacks (how Ansible logs, etc), and even for adding new server side behaviors.
Should you want to write your own, Ansible modules can be written in any language that can return JSON (Ruby, Python, bash, etc). Inventory can also plug in to any datasource by writing a program that speaks to that datasource and returns JSON. There's also various Python APIs for extending Ansible's connection types (SSH is not the only transport possible), callbacks (how Ansible logs, etc), and even for adding new server side behaviors.

View file

@ -110,7 +110,7 @@ Never use "we" when writing. "We" aren't doing anything on the user side. Ansibl
Hyphen
~~~~~~~~~~~~~~
The hyphens primary function is the formation of certain compound terms. Do not use a hyphen unless it serves a purpose. If a compound adjective cannot be misread or, as with many psychological terms, its meaning is established, a hyphen is not necessary.
The hyphen's primary function is the formation of certain compound terms. Do not use a hyphen unless it serves a purpose. If a compound adjective cannot be misread or, as with many psychological terms, its meaning is established, a hyphen is not necessary.
Use hyphens to avoid ambiguity or confusion:

View file

@ -78,7 +78,7 @@ Use to describes where to place options for a command, but not where to type the
Daylight saving time (DST)
+++++++++++++++++++++++++++++++
Correct. Do not use daylight savings time. Daylight Saving Time (DST) is often misspelled “Daylight Savings”, with an “s” at the end. Other common variations are “Summer Time”and “Daylight-Saving Time”. (http://www.timeanddate.com/time/dst/daylight-savings-time.html)
Correct. Do not use daylight savings time. Daylight Saving Time (DST) is often misspelled "Daylight Savings", with an "s" at the end. Other common variations are "Summer Time"and "Daylight-Saving Time". (http://www.timeanddate.com/time/dst/daylight-savings-time.html)
Download
@ -99,7 +99,7 @@ When used as a verb, fail over is two words since there can be different tenses
Fewer
+++++++++++++++++++
Fewer is used with plural nouns. Think things you could count. Time, money, distance, and weight are often listed as exceptions to the traditional “can you count it” rule, often thought of a singular amounts (the work will take less than 5 hours, for example).
Fewer is used with plural nouns. Think things you could count. Time, money, distance, and weight are often listed as exceptions to the traditional "can you count it" rule, often thought of a singular amounts (the work will take less than 5 hours, for example).
File name
+++++++++++++

View file

@ -13,8 +13,8 @@ This style guide incorporates current Ansible resources and information so that
<blockquote class="note info">
“If you don't find it in the index, look very carefully through the entire catalogue.”
― Sears, Roebuck and Co., 1897 Sears Roebuck & Co. Catalogue
"If you don't find it in the index, look very carefully through the entire catalogue."
― Sears, Roebuck and Co., 1897 Sears Roebuck & Co. Catalogue
.. raw:: html

View file

@ -33,9 +33,14 @@ At a high level we have the following classifications of tests:
* Tests directly against individual parts of the code base.
If you're a developer, one of the most valuable things you can do is look at the GitHub issues list and help fix bugs. We almost always prioritize bug fixing over feature development, so helping to fix bugs is one of the best things you can do.
If you're a developer, one of the most valuable things you can do is look at the GitHub
issues list and help fix bugs. We almost always prioritize bug fixing over feature
development.
Even if you're not a developer, helping to test pull requests for bug fixes and features is still immensely valuable.
Even for non developers, helping to test pull requests for bug fixes and features is still
immensely valuable. Ansible users who understand writing playbooks and roles should be
able to add integration tests and so Github pull requests with integration tests that show
bugs in action will also be a great way to help.
Testing within GitHub & Shippable
@ -47,7 +52,6 @@ Organization
When Pull Requests (PRs) are created they are tested using Shippable, a Continuous Integration (CI) tool. Results are shown at the end of every PR.
When Shippable detects an error and it can be linked back to a file that has been modified in the PR then the relevant lines will be added as a GitHub comment. For example::
The test `ansible-test sanity --test pep8` failed with the following errors:
@ -69,7 +73,6 @@ Then run the tests detailed in the GitHub comment::
ansible-test sanity --test pep8
ansible-test sanity --test validate-modules
If there isn't a GitHub comment stating what's failed you can inspect the results by clicking on the "Details" button under the "checks have failed" message at the end of the PR.
Rerunning a failing CI job
@ -91,10 +94,6 @@ If the issue persists, please contact us in ``#ansible-devel`` on Freenode IRC.
How to test a PR
================
If you're a developer, one of the most valuable things you can do is look at the GitHub issues list and help fix bugs. We almost always prioritize bug fixing over feature development, so helping to fix bugs is one of the best things you can do.
Even if you're not a developer, helping to test pull requests for bug fixes and features is still immensely valuable.
Ideally, code should add tests that prove that the code works. That's not always possible and tests are not always comprehensive, especially when a user doesn't have access to a wide variety of platforms, or is using an API or web service. In these cases, live testing against real equipment can be more valuable than automation that runs against simulated interfaces. In any case, things should always be tested manually the first time as well.
Thankfully, helping to test Ansible is pretty straightforward, assuming you are familiar with how Ansible works.
@ -188,8 +187,26 @@ If the PR does not resolve the issue, or if you see any failures from the unit/i
| some other output
| \```
Code Coverage Online
````````````````````
`The online code coverage reports <https://codecov.io/gh/ansible/ansible>` are a good way
to identify areas for testing improvement in Ansible. By following red colors you can
drill down through the reports to find files which have no tests at all. Adding both
integration and unit tests which show clearly how code should work, verify important
Ansible functions and increase testing coverage in areas where there is none is a valuable
way to help improve Ansible.
The code coverage reports only cover the ``devel`` branch of Ansible where new feature
development takes place. Pull requests and new code will be missing from the codecov.io
coverage reports so local reporting is needed. Most ``ansible-test`` commands allow you
to collect code coverage, this is particularly useful to indicate where to extend
testing. See :doc:`testing_running_locally` for more information.
Want to know more about testing?
================================
If you'd like to know more about the plans for improving testing Ansible then why not join the `Testing Working Group <https://github.com/ansible/community/blob/master/meetings/README.md>`_.
If you'd like to know more about the plans for improving testing Ansible then why not join the
`Testing Working Group <https://github.com/ansible/community/blob/master/meetings/README.md>`_.

View file

@ -0,0 +1,10 @@
Sanity Tests » azure-requirements
=================================
Update the Azure integration test requirements file when changes are made to the Azure packaging requirements file:
.. code-block:: bash
cp packaging/requirements/requirements-azure.txt test/runner/requirements/integration.cloud.azure.txt
This copy of the requirements file is used when building the ``ansible/ansible:default`` Docker container from ``test/runner/Dockerfile``.

View file

@ -0,0 +1,4 @@
Sanity Tests » no-smart-quotes
==============================
Smart quotes (``”“‘’``) should not be used. Use plain ascii quotes (``"'``) instead.

View file

@ -0,0 +1,16 @@
Sanity Tests » no-unicode_literals
==================================
The use of :code:`from __future__ import unicode_literals` has been deemed an anti-pattern. The
problems with it are:
* It makes it so one can't jump into the middle of a file and know whether a bare literal string is
a byte string or text string. The programmer has to first check the top of the file to see if the
import is there.
* It removes the ability to define native strings (a string which should be a byte string on python2
and a text string on python3) via a string literal.
* It makes for more context switching. A programmer could be reading one file which has
`unicode_literals` and know that bare string literals are text strings but then switch to another
file (perhaps tracing program execution into a third party library) and have to switch their
understanding of what bare string literals are.

View file

@ -45,7 +45,19 @@ Use the ``ansible-test shell`` command to get an interactive shell in the same e
Code Coverage
=============
Add the ``--coverage`` option to any test command to collect code coverage data.
Code coverage reports make it easy to identify untested code for which more tests should
be written. Online reports are available but only cover the ``devel`` branch (see
:doc:`testing`). For new code local reports are needed.
Add the ``--coverage`` option to any test command to collect code coverage data. If you
aren't using the ``--tox`` or ``--docker`` options which create an isolated python
environment then you may have to use the ``--requirements`` option to ensure that the
correct version of the coverage module is installed
ansible-test units --coverage apt
ansible-test integration --coverage aws_lambda --tox --requirements
ansible-test coverage html
Reports can be generated in several different formats:
@ -53,4 +65,7 @@ Reports can be generated in several different formats:
* ``ansible-test coverage html`` - HTML report.
* ``ansible-test coverage xml`` - XML report.
To clear data between test runs, use the ``ansible-test coverage erase`` command.
To clear data between test runs, use the ``ansible-test coverage erase`` command. For a full list of features see the online help::
ansible-test coverage --help

View file

@ -2,19 +2,24 @@
Unit Tests
**********
Unit tests are small isolated tests that target a specific library or module.
Unit tests are small isolated tests that target a specific library or module. Unit tests
in Ansible are currently the only way of driving tests from python within Ansible's
continuous integration process. This means that in some circumstances the tests may be a
bit wider than just units.
.. contents:: Topics
Available Tests
===============
Unit tests can be found in `test/units <https://github.com/ansible/ansible/tree/devel/test/units>`_, notice that the directory structure matches that of ``lib/ansible/``
Unit tests can be found in `test/units
<https://github.com/ansible/ansible/tree/devel/test/units>`_. Notice that the directory
structure of the tests matches that of ``lib/ansible/``.
Running Tests
=============
Unit tests can be run across the whole code base by doing:
The Ansible unit tests can be run across the whole code base by doing:
.. code:: shell
@ -35,18 +40,22 @@ Or against a specific Python version by doing:
ansible-test units --tox --python 2.7 apt
For advanced usage see the online help::
ansible-test units --help
You can also run tests in Ansible's continuous integration system by opening a pull
request. This will automatically determine which tests to run based on the changes made
in your pull request.
Installing dependencies
=======================
``ansible-test`` has a number of dependencies , for ``units`` tests we suggest using ``tox``
``ansible-test`` has a number of dependencies. For ``units`` tests we suggest using ``tox``.
The dependencies can be installed using the ``--requirements`` argument, which will install all the required dependencies needed for unit tests. For example:
The dependencies can be installed using the ``--requirements`` argument, which will
install all the required dependencies needed for unit tests. For example:
.. code:: shell
@ -58,7 +67,11 @@ The dependencies can be installed using the ``--requirements`` argument, which w
When using ``ansible-test`` with ``--tox`` requires tox >= 2.5.0
The full list of requirements can be found at `test/runner/requirements <https://github.com/ansible/ansible/tree/devel/test/runner/requirements>`_. Requirements files are named after their respective commands. See also the `constraints <https://github.com/ansible/ansible/blob/devel/test/runner/requirements/constraints.txt>`_ applicable to all commands.
The full list of requirements can be found at `test/runner/requirements
<https://github.com/ansible/ansible/tree/devel/test/runner/requirements>`_. Requirements
files are named after their respective commands. See also the `constraints
<https://github.com/ansible/ansible/blob/devel/test/runner/requirements/constraints.txt>`_
applicable to all commands.
Extending unit tests
@ -67,22 +80,98 @@ Extending unit tests
.. warning:: What a unit test isn't
If you start writing a test that requires external services then you may be writing an integration test, rather than a unit test.
If you start writing a test that requires external services then
you may be writing an integration test, rather than a unit test.
Structuring Unit Tests
``````````````````````
Ansible drives unit tests through `pytest <https://docs.pytest.org/en/latest/>`_. This
means that tests can either be written a simple functions which are included in any file
name like ``test_<something>.py`` or as classes.
Here is an example of a function::
#this function will be called simply because it is called test_*()
def test_add()
a = 10
b = 23
c = 33
assert a + b = c
Here is an example of a class::
import unittest:
class AddTester(unittest.TestCase)
def SetUp()
self.a = 10
self.b = 23
# this function will
def test_add()
c = 33
assert self.a + self.b = c
# this function will
def test_subtract()
c = -13
assert self.a - self.b = c
Both methods work fine in most circumstances; the function-based interface is simpler and
quicker and so that's probably where you should start when you are just trying to add a
few basic tests for a module. The class-based test allows more tidy set up and tear down
of pre-requisites, so if you have many test cases for your module you may want to refactor
to use that.
Assertions using the simple ``assert`` function inside the tests will give give full
information on the cause of the failure with a trace-back of functions called during the
assertion. This means that plain asserts are recommended over other external assertion
libraries.
A number of the unit test suites include functions that are shared between several
modules, especially in the networking arena. In these cases a file is created in the same
directory, which is then included directly.
Module test case common code
````````````````````````````
Keep common code as specific as possible within the `test/units/` directory structure. For
example, if it's specific to testing Amazon modules, it should be in
`test/units/modules/cloud/amazon/`. Don't import common unit test code from directories
outside the current or parent directories.
Don't import other unit tests from a unit test. Any common code should be in dedicated
files that aren't themselves tests.
Fixtures files
``````````````
To mock out fetching results from devices, you can use ``fixtures`` to read in pre-generated data.
To mock out fetching results from devices, or provide other complex datastructures that
come from external libraries, you can use ``fixtures`` to read in pre-generated data.
Text files live in ``test/units/modules/network/PLATFORM/fixtures/``
Data is loaded using the ``load_fixture`` method
See `eos_banner test <https://github.com/ansible/ansible/blob/devel/test/units/modules/network/eos/test_eos_banner.py>`_ for a practical example.
See `eos_banner test
<https://github.com/ansible/ansible/blob/devel/test/units/modules/network/eos/test_eos_banner.py>`_
for a practical example.
Code Coverage
`````````````
Most ``ansible-test`` commands allow you to collect code coverage, this is particularly useful when to indicate where to extend testing.
If you are simulating APIs you may find that python placebo is useful. See
doc:`testing_units_modules` for more information.
Code Coverage For New or Updated Unit Tests
```````````````````````````````````````````
New code will be missing from the codecov.io coverage reports (see :doc:`testing`), so
local reporting is needed. Most ``ansible-test`` commands allow you to collect code
coverage; this is particularly useful when to indicate where to extend testing.
To collect coverage data add the ``--coverage`` argument to your ``ansible-test`` command line:
@ -99,7 +188,21 @@ Reports can be generated in several different formats:
* ``ansible-test coverage html`` - HTML report.
* ``ansible-test coverage xml`` - XML report.
To clear data between test runs, use the ``ansible-test coverage erase`` command. For a full list of features see the online help::
To clear data between test runs, use the ``ansible-test coverage erase`` command. See
:doc:`testing_units_running_locally` for more information about generating coverage
reports.
ansible-test coverage --help
.. seealso::
:doc:`testing_units_modules`
Special considerations for unit testing modules
:doc:`testing_running_locally`
Running tests locally including gathering and reporting coverage data
`Python 3 documentation - 26.4. unittest — Unit testing framework <https://docs.python.org/3/library/unittest.html>`_
The documentation of the unittest framework in python 3
`Python 2 documentation - 25.3. unittest — Unit testing framework <https://docs.python.org/3/library/unittest.html>`_
The documentation of the earliest supported unittest framework - from Python 2.6
`pytest: helps you write better programs <https://docs.pytest.org/en/latest/>`_
The documentation of pytest - the framework actually used to run Ansible unit tests

View file

@ -0,0 +1,555 @@
****************************
Unit Testing Ansible Modules
****************************
.. contents:: Topics
Introduction
============
This document explains why, how and when you should use unit tests for Ansible modules.
The document doesn't apply to other parts of Ansible for which the recommendations are
normally closer to the Python standard. There is basic documentation for Ansible unit
tests in the developer guide :doc:`testing_units`. This document should
be readable for a new Ansible module author. If you find it incomplete or confusing,
please open a bug or ask for help on Ansible IRC.
What Are Unit Tests?
====================
Ansible includes a set of unit tests in the :file:`test/unit` directory. These tests primarily cover the
internals but can also can cover Ansible modules. The structure of the unit tests matches
the structure of the code base, so the tests that reside in the :file:`test/unit/modules/` directory
are organized by module groups.
Integration tests can be used for most modules, but there are situations where
cases cannot be verified using integration tests. This means that Ansible unit test cases
may extend beyond testing only minimal units and in some cases will include some
level of functional testing.
Why Use Unit Tests?
===================
Ansible unit tests have advantages and disadvantages. It is important to understand these.
Advantages include:
* Most unit tests are much faster than most Ansible integration tests. The complete suite
of unit tests can be run regularly by a developer on their local system.
* Unit tests can be run by developers who don't have access to the system which the module is
designed to work on, allowing a level of verification that changes to core functions
haven't broken module expectations.
* Unit tests can easily substitute system functions allowing testing of software that
would be impractical. For example, the ``sleep()`` function can be replaced and we check
that a ten minute sleep was called without actually waiting ten minutes.
* Unit tests are run on different Python versions. This allows us to
ensure that the code behaves in the same way on different Python versions.
There are also some potential disadvantages of unit tests. Unit tests don't normally
directly test actual useful valuable features of software, instead just internal
implementation
* Unit tests that test the internal, non-visible features of software may make
refactoring difficult if those internal features have to change (see also naming in How
below)
* Even if the internal feature is working correctly it is possible that there will be a
problem between the internal code tested and the actual result delivered to the user
Normally the Ansible integration tests (which are written in Ansible YAML) provide better
testing for most module functionality. If those tests already test a feature and perform
well there may be little point in providing a unit test covering the same area as well.
When To Use Unit Tests
======================
There are a number of situations where unit tests are a better choice than integration
tests. For example, testing things which are impossible, slow or very difficult to test
with integration tests, such as:
* Forcing rare / strange / random situations that can't be forced, such as specific network
failures and exceptions
* Extensive testing of slow configuration APIs
* Situations where the integration tests cannot be run as part of the main Ansible
continuous integraiton running in Shippable.
Providing quick feedback
------------------------
Example:
A single step of the rds_instance test cases can take up to 20
minutes (the time to create an RDS instance in Amazon). The entire
test run can last for well over an hour. All 16 of the unit tests
complete execution in less than 2 seconds.
The time saving provided by being able to run the code in a unit test makes it worth
creating a unit test when bug fixing a module, even if those tests do not often identify
problems later. As a basic goal, every module should have at least one unit test which
will give quick feedback in easy cases without having to wait for the integration tests to
complete.
Ensuring correct use of external interfaces
-------------------------------------------
Unit tests can check the way in which external services are run to ensure that they match
specifications or are as efficient as possible *even when the final output will not be changed*.
Example:
Package managers are often far more efficient when installing multiple packages at once
rather than each package separately. The final result is the
same: the packages are all installed, so the efficiency is difficult to verify through
integration tests. By providing a mock package manager and verifying that it is called
once, we can build a valuable test for module efficiency.
Another related use is in the situation where an API has versions which behave
differently. A programmer working on a new version may change the module to work with the
new API version and unintentially break the old version. A test case
which checks that the call happens properly for the old version can help avoid the
problem. In this situation it is very important to include version numbering in the test case
name (see `Naming unit tests`_ below).
Providing specific design tests
--------------------------------
By building a requirement for a particular part of the
code and then coding to that requirement, unit tests _can_ sometimes improve the code and
help future developers understand that code.
Unit tests that test internal implementation details of code, on the other hand, almost
always do more harm than good. Testing that your packages to install are stored in a list
would slow down and confuse a future developer who might need to change that list into a
dictionary for efficiency. This problem can be reduced somewhat with clear test naming so
that the future developer immediately knows to delete the test case, but it is often
better to simply leave out the test case altogether and test for a real valuable feature
of the code, such as installing all of the packages supplied as arguments to the module.
How to unit test Ansible modules
================================
There are a number of techniques for unit testing modules. Beware that most
modules without unit tests are structured in a way that makes testing quite difficult and
can lead to very complicated tests which need more work than the code. Effectively using unit
tests may lead you to restructure your code. This is often a good thing and leads
to better code overall. Good restructuring can make your code clearer and easier to understand.
Naming unit tests
-----------------
Unit tests should have logical names. If a developer working on the module being tested
breaks the test case, it should be easy to figure what the unit test covers from the name.
If a unit test is designed to verify compatibility with a specific software or API version
then include the version in the name of the unit test.
As an example, ``test_v2_state_present_should_call_create_server_with_name()`` would be a
good name, ``test_create_server()`` would not be.
Use of Mocks
------------
Mock objects (from https://docs.python.org/3/library/unittest.mock.html) can be very
useful in building unit tests for special / difficult cases, but they can also
lead to complex and confusing coding situations. One good use for mocks would be in
simulating an API. As for 'six', the 'mock' python package is bundled with Ansible (use
'import ansible.compat.tests.mock'). See for example
Ensuring failure cases are visible with mock objects
----------------------------------------------------
Functions like module.fail_json() are normally expected to terminate execution. When you
run with a mock module object this doesn't happen since the mock always returns another mock
from a function call. You can set up the mock to raise an exception as shown above, or you can
assert that these functions have not been called in each test. For example::
module = MagicMock()
function_to_test(module, argument)
module.fail_json.assert_not_called()
This applies not only to calling the main module but almost any other
function in a module which gets the module object.
Mocking of the actual module
----------------------------
The setup of an actual module is quite complex (see `Passing Arguments`_ below) and often
isn't needed for most functions which use a module. Instead you can use a mock object as
the module and create any module attributes needed by the function you are testing. If
you do this, beware that the module exit functions need special handling as mentioned
above, either by throwing an exception or ensuring that they haven't been called. For example::
class AnsibleExitJson(Exception):
"""Exception class to be raised by module.exit_json and caught by the test case"""
pass
#you may also do the same to fail json
module=MagicMock()
module.exit_json.side_effect = AnsibleExitJson(Exception)
with self.assertRaises(AnsibleExitJson) as result:
return = my_module.test_this_function(module, argument)
module.fail_json.assert_not_called()
assert return["changed"] == True
API definition with unit test cases
-----------------------------------
API interaction is usually best tested with the function tests defined in Ansible's
integration testing section, which run against the actual API. There are several cases
where the unit tests are likely to work better.
Defining a module against an API specification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This case is especially important for modules interacting with web services, which provide
an API that Ansible uses but which are beyond the control of the user.
By writing a custom emulation of the calls that return data from the API, we can ensure
that only the features which are clearly defined in the specification of the API are
present in the message. This means that we can check that we use the correct
parameters and nothing else.
*Example: in rds_instance unit tests a simple instance state is defined*::
def simple_instance_list(status, pending):
return {u'DBInstances': [{u'DBInstanceArn': 'arn:aws:rds:us-east-1:1234567890:db:fakedb',
u'DBInstanceStatus': status,
u'PendingModifiedValues': pending,
u'DBInstanceIdentifier': 'fakedb'}]}
This is then used to create a list of states::
rds_client_double = MagicMock()
rds_client_double.describe_db_instances.side_effect = [
simple_instance_list('rebooting', {"a": "b", "c": "d"}),
simple_instance_list('available', {"c": "d", "e": "f"}),
simple_instance_list('rebooting', {"a": "b"}),
simple_instance_list('rebooting', {"e": "f", "g": "h"}),
simple_instance_list('rebooting', {}),
simple_instance_list('available', {"g": "h", "i": "j"}),
simple_instance_list('rebooting', {"i": "j", "k": "l"}),
simple_instance_list('available', {}),
simple_instance_list('available', {}),
]
These states are then used as returns from a mock object to ensure that the ``await`` function
waits through all of the states that would mean the RDS instance has not yet completed
configuration::
rds_i.await_resource(rds_client_double, "some-instance", "available", mod_mock,
await_pending=1)
assert(len(sleeper_double.mock_calls) > 5), "await_pending didn't wait enough"
By doing this we check that the ``await`` function will keep waiting through
potentially unusual that it would be impossible to reliably trigger through the
integration tests but which happen unpredictably in reality.
Defining a module to work against multiple API versions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This case is especially important for modules interacting with many different versions of
software; for example, package installation modules that might be expected to work with
many different operating system versions.
By using previously stored data from various versions of an API we can ensure that the
code is tested against the actual data which will be sent from that version of the system
even when the version is very obscure and unlikely to be available during testing.
Ansible special cases for unit testing
======================================
There are a number of special cases for unit testing the environment of an Ansible module.
The most common are documented below, and suggestions for others can be found by looking
at the source code of the existing unit tests or asking on the Ansible IRC channel or mailing
lists.
Module argument processing
--------------------------
There are two problems with running the main function of a module:
* Since the module is supposed to accept arguments on ``STDIN`` it is a bit difficult to
set up the arguments correctly so that the module will get them as parameters.
* All modules should finish by calling either the ``module.fail_json`` or
``module.exit_json``, but these won't work correctly in a testing environment.
Passing Arguments
-----------------
.. This section should be updated once https://github.com/ansible/ansible/pull/31456 is
closed since the function below will be provided in a library file.
To pass arguments to a module correctly, use a function that stores the
parameters in a special string variable. Module creation and argument processing is
handled through the AnsibleModule object in the basic section of the utilities. Normally
this accepts input on ``STDIN``, which is not convenient for unit testing. When the special
variable is set it will be treated as if the input came on ``STDIN`` to the module.::
import json
from ansible.module_utils._text import to_bytes
def set_module_args(args):
args = json.dumps({'ANSIBLE_MODULE_ARGS': args})
basic._ANSIBLE_ARGS = to_bytes(args)
simply call that function before setting up your module
def test_already_registered(self):
set_module_args({
'activationkey': 'key',
'username': 'user',
'password': 'pass',
})
Handling exit correctly
-----------------------
.. This section should be updated once https://github.com/ansible/ansible/pull/31456 is
closed since the exit and failure functions below will be provided in a library file.
The ``module.exit_json()`` function won't work properly in a testing environment since it
writes error information to ``STDOUT`` upon exit, where it
is difficult to examine. This can be mitigated by replacing it (and module.fail_json) with
a function that raises an exception::
def exit_json(*args, **kwargs):
if 'changed' not in kwargs:
kwargs['changed'] = False
raise AnsibleExitJson(kwargs)
Now you can ensure that the first function called is the one you expected simply by
testing for the correct exception::
def test_returned_value(self):
set_module_args({
'activationkey': 'key',
'username': 'user',
'password': 'pass',
})
with self.assertRaises(AnsibleExitJson) as result:
my_module.main()
The same technique can be used to replace ``module.fail_json()`` (which is used for failure
returns from modules) and for the ``aws_module.fail_json_aws()`` (used in modules for Amazon
Web Services).
Running the main function
-------------------------
If you do want to run the actual main function of a module you must import the module, set
the arguments as above, set up the appropriate exit exception and then run the module::
# This test is based around pytest's features for individual test functions
import pytest
import ansible.modules.module.group.my_modulle as my_module
def test_main_function(monkeypatch):
monkeypatch.setattr(my_module.AnsibleModule, "exit_json", fake_exit_json)
set_module_args({
'activationkey': 'key',
'username': 'user',
'password': 'pass',
})
my_module.main()
Handling calls to external executables
--------------------------------------
Module must use AnsibleModule.run_command in order to execute an external command. This
method needs to be mocked:
Here is a simple mock of AnsibleModule.run_command (taken from test/units/modules/packaging/os/test_rhn_register.py and
test/units/modules/packaging/os/rhn_utils.py)::
with patch.object(basic.AnsibleModule, 'run_command') as run_command:
run_command.return_value = 0, '', '' # successful execution, no output
with self.assertRaises(AnsibleExitJson) as result:
self.module.main()
self.assertFalse(result.exception.args[0]['changed'])
# Check that run_command has been called
run_command.assert_called_once_with('/usr/bin/command args')
self.assertEqual(run_command.call_count, 1)
self.assertFalse(run_command.called)
A Complete Example
------------------
The following example is a complete skeleton that reuses the mocks explained above and adds a new
mock for Ansible.get_bin_path::
import json
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
from ansible.modules.namespace import my_module
def set_module_args(args):
"""prepare arguments so that they will be picked up during module creation"""
args = json.dumps({'ANSIBLE_MODULE_ARGS': args})
basic._ANSIBLE_ARGS = to_bytes(args)
class AnsibleExitJson(Exception):
"""Exception class to be raised by module.exit_json and caught by the test case"""
pass
class AnsibleFailJson(Exception):
"""Exception class to be raised by module.fail_json and caught by the test case"""
pass
def exit_json(*args, **kwargs):
"""function to patch over exit_json; package return data into an exception"""
if 'changed' not in kwargs:
kwargs['changed'] = False
raise AnsibleExitJson(kwargs)
def fail_json(*args, **kwargs):
"""function to patch over fail_json; package return data into an exception"""
kwargs['failed'] = True
raise AnsibleFailJson(kwargs)
def get_bin_path(self, arg, required=False):
"""Mock AnsibleModule.get_bin_path"""
if arg.endswith('my_command'):
return '/usr/bin/my_command'
else:
if required:
fail_json(msg='%r not found !' % arg)
class TestMyModule(unittest.TestCase):
def setUp(self):
self.mock_module_helper = patch.multiple(basic.AnsibleModule,
exit_json=exit_json,
fail_json=fail_json,
get_bin_path=get_bin_path)
self.mock_module_helper.start()
self.addCleanup(self.mock_module_helper.stop)
def test_module_fail_when_required_args_missing(self):
with self.assertRaises(AnsibleFailJson):
set_module_args({})
self.module.main()
def test_ensure_command_called(self):
set_module_args({
'param1': 10,
'param2': 'test',
})
with patch.object(basic.AnsibleModule, 'run_command') as mock_run_command:
stdout = 'configuration updated'
stderr = ''
rc = 0
mock_run_command.return_value = rc, stdout, stderr # successful execution
with self.assertRaises(AnsibleExitJson) as result:
my_module.main()
self.assertFalse(result.exception.args[0]['changed']) # ensure result is changed
mock_run_command.assert_called_once_with('/usr/bin/my_command --value 10 --name test')
Restructuring modules to enable testing module set up and other processes
-------------------------------------------------------------------------
Often modules have a main() function which sets up the module and then performs other
actions. This can make it difficult to check argument processing. This can be made easier by
moving module configuration and initialization into a separate function. For example::
argument_spec = dict(
# module function variables
state=dict(choices=['absent', 'present', 'rebooted', 'restarted'], default='present'),
apply_immediately=dict(type='bool', default=False),
wait=dict(type='bool', default=False),
wait_timeout=dict(type='int', default=600),
allocated_storage=dict(type='int', aliases=['size']),
db_instance_identifier=dict(aliases=["id"], required=True),
)
def setup_module_object():
module = AnsibleAWSModule(
argument_spec=argument_spec,
required_if=required_if,
mutually_exclusive=[['old_instance_id', 'source_db_instance_identifier',
'db_snapshot_identifier']],
)
return module
def main():
module = setup_module_object()
validate_parameters(module)
conn = setup_client(module)
return_dict = run_task(module, conn)
module.exit_json(**return_dict)
This now makes it possible to run tests against the module initiation function::
def test_rds_module_setup_fails_if_db_instance_identifier_parameter_missing():
# db_instance_identifier parameter is missing
set_module_args({
'state': 'absent',
'apply_immediately': 'True',
})
with self.assertRaises(AnsibleFailJson) as result:
self.module.setup_json
See also ``test/units/module_utils/aws/test_rds.py``
Note that the argument_spec dictionary is visible in a module variable. This has
advantages, both in allowing explicit testing of the arguments and in allowing the easy
creation of module objects for testing.
The same restructuring technique can be valuable for testing other functionality, such as the part of the module which queries the object that the module configures.
Traps for maintaining Python 2 compatibility
============================================
If you use the ``mock`` library from the Python 2.6 standard library, a number of the
assert functions are missing but will return as if successful. This means that test cases should take great care *not* use
functions marked as _new_ in the Python 3 documentation, since the tests will likely always
succeed even if the code is broken when run on older versions of Python.
A helpful development approach to this should be to ensure that all of the tests have been
run under Python 2.6 and that each assertion in the test cases has been checked to work by breaking
the code in Ansible to trigger that failure.
.. seealso::
:doc:`testing_units`
Ansible unit tests documentation
:doc:`testing_running_locally`
Running tests locally including gathering and reporting coverage data
:doc:`developing_modules`
How to develop modules
`Python 3 documentation - 26.4. unittest — Unit testing framework <https://docs.python.org/3/library/unittest.html>`_
The documentation of the unittest framework in python 3
`Python 2 documentation - 25.3. unittest — Unit testing framework <https://docs.python.org/3/library/unittest.html>`_
The documentation of the earliest supported unittest framework - from Python 2.6
`pytest: helps you write better programs <https://docs.pytest.org/en/latest/>`_
The documentation of pytest - the framework actually used to run Ansible unit tests
`Development Mailing List <http://groups.google.com/group/ansible-devel>`_
Mailing list for development topics
`Testing Your Code (from The Hitchhiker's Guide to Python!) <http://docs.python-guide.org/en/latest/writing/tests/>`_
General advice on testing Python code
`Uncle Bob's many videos on YouTube <https://www.youtube.com/watch?v=QedpQjxBPMA&list=PLlu0CT-JnSasQzGrGzddSczJQQU7295D2>`_
Unit testing is a part of the of various philosophies of software development, including
Extreme Programming (XP), Clean Coding. Uncle Bob talks through how to benfit from this
`"Why Most Unit Testing is Waste" http://rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste.pdf`
An article warning against the costs of unit testing
`'A Response to "Why Most Unit Testing is Waste"' https://henrikwarne.com/2014/09/04/a-response-to-why-most-unit-testing-is-waste/`
An response pointing to how to maintain the value of unit tests

View file

@ -362,7 +362,7 @@ When should I use {{ }}? Also, how to interpolate variables or dynamic variable
A steadfast rule is 'always use {{ }} except when `when:`'.
Conditionals are always run through Jinja2 as to resolve the expression,
so `when:`, `failed_when:` and `changed_when:` are always templated and you should avoid adding `{{}}`.
so `when:`, `failed_when:`, and `changed_when:` are always templated and you should avoid adding `{{}}`.
In most other cases you should always use the brackets, even if previously you could use variables without specifying (like `with_` clauses),
as this made it hard to distinguish between an undefined variable and a string.

View file

@ -152,7 +152,7 @@ Content of the *requirements.yml* file:
# from galaxy
- src: yatesr.timezone
- include: <path_to_requirements>/webserver.yml
- import_tasks: <path_to_requirements>/webserver.yml
Content of the *webserver.yml* file:
@ -274,7 +274,7 @@ Alternatively, the role_skeleton and ignoring of files can be configured via ans
Search for Roles
----------------
Search the Galaxy database by tags, platforms, author and multiple keywords. For example:
Search the Galaxy database by tags, platforms, author, and multiple keywords. For example:
::
@ -361,7 +361,7 @@ Use ``remove`` to delete a role from *roles_path*:
Authenticate with Galaxy
------------------------
Using the ``import``, ``delete`` and ``setup`` commands to manage your roles on the Galaxy website requires authentication, and the ``login`` command
Using the ``import``, ``delete``, and ``setup`` commands to manage your roles on the Galaxy website requires authentication, and the ``login`` command
can be used to do just that. Before you can use the ``login`` command, you must create an account on the Galaxy website.
The ``login`` command requires using your GitHub credentials. You can use your username and password, or you can create a `personal access token <https://help.github.com/articles/creating-an-access-token-for-command-line-use/>`_. If you choose to create a token, grant minimal access to the token, as it is used just to verify identify.
@ -382,8 +382,8 @@ The following shows authenticating with the Galaxy website using a GitHub userna
Password for dsmith:
Successfully logged into Galaxy as dsmith
When you choose to use your username and password, your password is not sent to Galaxy. It is used to authenticates with GitHub and create a personal access token.
It then sends the token to Galaxy, which in turn verifies that your identity and returns a Galaxy access token. After authentication completes the GitHub token is
When you choose to use your username and password, your password is not sent to Galaxy. It is used to authenticate with GitHub and create a personal access token.
It then sends the token to Galaxy, which in turn verifies your identity and returns a Galaxy access token. After authentication completes the GitHub token is
destroyed.
If you do not wish to use your GitHub password, or if you have two-factor authentication enabled with GitHub, use the *--github-token* option to pass a personal access token

View file

@ -436,7 +436,7 @@ when a term comes up on the mailing list.
labeled ``ntp``, and then run just the ``ntp`` steps to reconfigure
the time server information on a remote host.
Tasks
Task
:term:`Playbooks` exist to run tasks. Tasks combine an :term:`action`
(a module and its arguments) with a name and optionally some other
keywords (like :term:`looping directives <loops>`). :term:`Handlers`
@ -444,6 +444,9 @@ when a term comes up on the mailing list.
unless they are notified by name when a task reports an underlying
change on a remote system.
Tasks
A list of :term:`Task`.
Templates
Ansible can easily transfer files to remote systems but often it is
desirable to substitute variables in other files. Variables may come

View file

@ -40,11 +40,11 @@ There is now a detailed official tutorial describing `how to create a service pr
After stepping through the tutorial you will have:
* Your Client ID, which is found in the “client id” box in the “Configure” page of your application in the Azure portal
* Your Client ID, which is found in the "client id" box in the "Configure" page of your application in the Azure portal
* Your Secret key, generated when you created the application. You cannot show the key after creation.
If you lost the key, you must create a new one in the “Configure” page of your application.
* And finally, a tenant ID. Its a UUID (e.g. ABCDEFGH-1234-ABCD-1234-ABCDEFGHIJKL) pointing to the AD containing your
application. You will find it in the URL from within the Azure portal, or in the “view endpoints” of any given URL.
If you lost the key, you must create a new one in the "Configure" page of your application.
* And finally, a tenant ID. It's a UUID (e.g. ABCDEFGH-1234-ABCD-1234-ABCDEFGHIJKL) pointing to the AD containing your
application. You will find it in the URL from within the Azure portal, or in the "view endpoints" of any given URL.
Using Active Directory Username/Password
@ -131,14 +131,14 @@ Creating Virtual Machines
-------------------------
There are two ways to create a virtual machine, both involving the azure_rm_virtualmachine module. We can either create
a storage account, network interface, security group and public IP address and pass the names of these objects to the
a storage account, network interface, security group, and public IP address and pass the names of these objects to the
module as parameters, or we can let the module do the work for us and accept the defaults it chooses.
Creating Individual Components
..............................
An Azure module is available to help you create a storage account, virtual network, subnet, network interface,
security group and public IP. Here is a full example of creating each of these and passing the names to the
security group, and public IP. Here is a full example of creating each of these and passing the names to the
azure_rm_virtualmachine module at the end:
.. code-block:: yaml
@ -315,7 +315,7 @@ azure_rm.ini file in your current working directory.
NOTE: An .ini file will take precedence over environment variables.
NOTE: The name of the .ini file is the basename of the inventory script (i.e. 'azure_rm') with a '.ini'
extension. This allows you to copy, rename and customize the inventory script and have matching .ini files all in
extension. This allows you to copy, rename, and customize the inventory script and have matching .ini files all in
the same directory.
Control grouping using the following variables defined in the environment:

View file

@ -134,7 +134,7 @@ Environment Variables
`````````````````````
.. versionadded:: 2.3
Since Ansible 2.3 it is possible to use environment variables for domain (``CLOUDSTACK_DOMAIN``), account (``CLOUDSTACK_ACCOUNT``), project (``CLOUDSTACK_PROJECT``), VPC (``CLOUDSTACK_VPC``) and zone (``CLOUDSTACK_ZONE``). This simplifies the tasks by not repeating the arguments for every tasks.
Since Ansible 2.3 it is possible to use environment variables for domain (``CLOUDSTACK_DOMAIN``), account (``CLOUDSTACK_ACCOUNT``), project (``CLOUDSTACK_PROJECT``), VPC (``CLOUDSTACK_VPC``), and zone (``CLOUDSTACK_ZONE``). This simplifies the tasks by not repeating the arguments for every tasks.
Below you see an example how it can be used in combination with Ansible's block feature:
@ -165,7 +165,7 @@ Below you see an example how it can be used in combination with Ansible's block
.. Note:: You are still able overwrite the environment variables using the module arguments, e.g. ``zone: sf-2``
.. Note:: Unlike ``CLOUDSTACK_REGION`` these additional environment variables are ingored in the CLI ``cs``.
.. Note:: Unlike ``CLOUDSTACK_REGION`` these additional environment variables are ignored in the CLI ``cs``.
Use Cases
`````````
@ -197,7 +197,7 @@ This is how our inventory looks like:
As you can see, the public IPs for our web servers and jumphost has been assigned as variable ``public_ip`` directly in the inventory.
The configure the jumphost, web servers and database servers, we use ``group_vars``. The ``group_vars`` directory contains 4 files for configuration of the groups: cloud-vm, jumphost, webserver and db-server. The cloud-vm is there for specifying the defaults of our cloud infrastructure.
To configure the jumphost, web servers, and database servers, we use ``group_vars``. The ``group_vars`` directory contains 4 files for configuration of the groups: cloud-vm, jumphost, webserver, and db-server. The cloud-vm is there for specifying the defaults of our cloud infrastructure.
.. code-block:: yaml
@ -262,9 +262,9 @@ Now to the fun part. We create a playbook to create our infrastructure we call i
cs_staticnat: vm="{{ inventory_hostname_short }}" ip_address="{{ public_ip }}"
when: public_ip is defined
In the above play we defined 3 tasks and use the group ``cloud-vm`` as target to handle all VMs in the cloud but instead SSH to these VMs, we use ``connetion=local`` to execute the API calls locally from our workstation.
In the above play we defined 3 tasks and used the group ``cloud-vm`` as target to handle all VMs in the cloud but instead SSH to these VMs, we use ``connection=local`` to execute the API calls locally from our workstation.
In the first task, we ensure we have a running VM created with the Debian template. If the VM is already created but stopped, it would just start it. If you like to change the offering on an existing VM, you must add ``force: yes`` to the task, which would stop the VM, change the offering and start the VM again.
In the first task, we ensure we have a running VM created with the Debian template. If the VM is already created but stopped, it would just start it. If you like to change the offering on an existing VM, you must add ``force: yes`` to the task, which would stop the VM, change the offering, and start the VM again.
In the second task we ensure the ports are opened if we give a public IP to the VM.
@ -364,12 +364,12 @@ The playbook looks like the following:
- name: show VM IP
debug: msg="VM {{ inventory_hostname }} {{ vm.default_ip }}"
- name: assing IP to the inventory
- name: assign IP to the inventory
set_fact: ansible_ssh_host={{ vm.default_ip }}
- name: waiting for SSH to come up
wait_for: port=22 host={{ vm.default_ip }} delay=5
In the first play we setup the security groups, in the second play the VMs will created be assigned to these groups. Further you see, that we assign the public IP returned from the modules to the host inventory. This is needed as we do not know the IPs we will get in advance. In a next step you would configure the DNS servers with these IPs for accassing the VMs with their DNS name.
In the first play we setup the security groups, in the second play the VMs will created be assigned to these groups. Further you see, that we assign the public IP returned from the modules to the host inventory. This is needed as we do not know the IPs we will get in advance. In a next step you would configure the DNS servers with these IPs for accessing the VMs with their DNS name.
In the last task we wait for SSH to be accessible, so any later play would be able to access the VM by SSH without failure.

View file

@ -8,11 +8,11 @@ Ansible offers the following modules for orchestrating Docker containers:
Swarm. Supports compose versions 1 and 2.
docker_container
Manages the container lifecycle by providing the ability to create, update, stop, start and destroy a
Manages the container lifecycle by providing the ability to create, update, stop, start, and destroy a
container.
docker_image
Provides full control over images, including: build, pull, push, tag and remove.
Provides full control over images, including: build, pull, push, tag, and remove.
docker_image_facts
Inspects one or more images in the Docker host's image cache, providing the information as facts for making
@ -126,7 +126,7 @@ running Ansible:
The maximum amount of time in seconds to wait on a response from the API.
DOCKER_CERT_PATH
Path to the directory containing the client certificate, client key and CA certificate.
Path to the directory containing the client certificate, client key, and CA certificate.
DOCKER_SSL_VERSION
Provide a valid SSL version number.
@ -205,7 +205,7 @@ options. These are the same environment variables used by the Docker modules.
by docker-py.
DOCKER_TIMEOUT:
The maximum amount of time in seconds to wait on a response fromm the API. Defaults to 60 seconds.
The maximum amount of time in seconds to wait on a response from the API. Defaults to 60 seconds.
DOCKER_TLS:
Secure the connection to the API by using TLS without verifying the authenticity of the Docker host server.
@ -213,18 +213,18 @@ options. These are the same environment variables used by the Docker modules.
DOCKER_TLS_VERIFY:
Secure the connection to the API by using TLS and verifying the authenticity of the Docker host server.
Default is False
Defaults to False.
DOCKER_TLS_HOSTNAME:
When verifying the authenticity of the Docker Host server, provide the expected name of the server. Defaults
to localhost.
DOCKER_CERT_PATH:
Path to the directory containing the client certificate, client key and CA certificate.
Path to the directory containing the client certificate, client key, and CA certificate.
DOCKER_SSL_VERSION:
Provide a valid SSL version number. Default value determined by docker-py, which at the time of this writing
was 1.0
was 1.0.
In addition to the connection variables there are a couple variables used to control the execution and output of the
script:

View file

@ -8,7 +8,7 @@ Introduction
`Packet.net <https://packet.net>`_ is a bare metal infrastructure host that's supported by Ansible (>=2.3) via a dynamic inventory script and two cloud modules. The two modules are:
- packet_sshkey: adds a public SSH key from file or value to the Packet infrastructure. Every subsequently-created device will have this public key installed in .ssh/authorized_keys.
- packet_device: manages servers on Packet. You can use this module to create, restart and delete devices.
- packet_device: manages servers on Packet. You can use this module to create, restart, and delete devices.
Note, this guide assumes you are familiar with Ansible and how it works. If you're not, have a look at their `docs <http://docs.ansible.com/>`_ before getting started.
@ -183,7 +183,7 @@ The following playbook will create an SSH key, 3 Packet servers, and then wait u
As with most Ansible modules, the default states of the Packet modules are idempotent, meaning the resources in your project will remain the same after re-runs of a playbook. Thus, we can keep the ``packet_sshkey`` module call in our playbook. If the public key is already in your Packet account, the call will have no effect.
The second module call provisions 3 Packet Type 0 (specified using the 'plan' parameter) servers in the project identified via the 'project_id' parameter. The servers are all provisioned with CoresOS beta (the 'operating_system' parameter) and are customized with cloud-config user data passed to the 'user_data' parameter.
The second module call provisions 3 Packet Type 0 (specified using the 'plan' parameter) servers in the project identified via the 'project_id' parameter. The servers are all provisioned with CoreOS beta (the 'operating_system' parameter) and are customized with cloud-config user data passed to the 'user_data' parameter.
The ``packet_device`` module has a boolean 'wait' parameter that defaults to 'false'. If set to 'true', Ansible will wait until the GET API call for a device will contain an Internet-routeable IP address. The 'wait' parameter allows us to use the IP address of the device as soon as it's available.

View file

@ -457,7 +457,7 @@ Create an isolated cloud network and build a server
Complete Environment
++++++++++++++++++++
Build a complete webserver environment with servers, custom networks and load balancers, install nginx and create a custom index.html
Build a complete webserver environment with servers, custom networks and load balancers, install nginx, and create a custom index.html.
.. code-block:: yaml

View file

@ -176,7 +176,7 @@ Here's another example, from the same template:
{% endfor %}
This loops over all of the hosts in the group called ``monitoring``, and adds an ACCEPT line for
each monitoring hosts' default IPV4 address to the current machine's iptables configuration, so that Nagios can monitor those hosts.
each monitoring hosts' default IPv4 address to the current machine's iptables configuration, so that Nagios can monitor those hosts.
You can learn a lot more about Jinja2 and its capabilities `here <http://jinja.pocoo.org/docs/>`_, and you
can read more about Ansible variables in general in the :doc:`playbooks_variables` section.
@ -220,6 +220,11 @@ Here is the next part of the update play::
delegate_to: "{{ item }}"
with_items: "{{ groups.lbservers }}"
.. note::
- The ``serial`` keyword forces the play to be executed in 'batches'. Each batch counts as a full play with a subselection of hosts.
This has some consequences on play behavior. For example, if all hosts in a batch fails, the play fails, which in turn fails the entire run. You should consider this when combining with ``max_fail_percentage``.
The ``pre_tasks`` keyword just lets you list tasks to run before the roles are called. This will make more sense in a minute. If you look at the names of these tasks, you can see that we are disabling Nagios alerts and then removing the webserver that we are currently updating from the HAProxy load balancing pool.
The ``delegate_to`` and ``with_items`` arguments, used together, cause Ansible to loop over each monitoring server and load balancer, and perform that operation (delegate that operation) on the monitoring or load balancing server, "on behalf" of the webserver. In programming terms, the outer loop is the list of web servers, and the inner loop is the list of monitoring servers.

View file

@ -113,7 +113,7 @@ single machine environment may look something like this:
If you want to run Ansible manually, you will want to make sure to pass
``ansible`` or ``ansible-playbook`` commands the correct arguments, at least
for the *username*, the *SSH private key* and the *inventory*.
for the *username*, the *SSH private key*, and the *inventory*.
Here is an example using the Vagrant global insecure key (``config.ssh.insert_key``
must be set to ``false`` in your ``Vagrantfile``):

View file

@ -16,7 +16,7 @@ We believe simplicity is relevant to all sizes of environments, so we design for
Ansible manages machines in an agent-less manner. There is never a question of how to
upgrade remote daemons or the problem of not being able to manage systems because daemons are uninstalled. Because OpenSSH is one of the most peer-reviewed open source components, security exposure is greatly reduced. Ansible is decentralized--it relies on your existing OS credentials to control access to remote machines. If needed, Ansible can easily connect with Kerberos, LDAP, and other centralized authentication management systems.
This documentation covers the current released version of Ansible (2.3) and also some development version features (2.4). For recent features, we note in each section the version of Ansible where the feature was added.
This documentation covers the current released version of Ansible (2.4) and also some development version features ('devel'). For recent features, we note in each section the version of Ansible where the feature was added.
Ansible, Inc. releases a new major release of Ansible approximately every two months. The core application evolves somewhat conservatively, valuing simplicity in language design and setup. However, the community around new modules and plugins being developed and contributed moves very quickly, typically adding 20 or so new modules in each release.
@ -32,6 +32,7 @@ Ansible, Inc. releases a new major release of Ansible approximately every two mo
modules
modules_by_category
vault
command_line_tools
guides
dev_guide/index
tower

View file

@ -195,7 +195,7 @@ Deploying From Source Control
Deploy your webapp straight from git::
$ ansible webservers -m git -a "repo=git://foo.example.org/repo.git dest=/srv/myapp version=HEAD"
$ ansible webservers -m git -a "repo=https://foo.example.org/repo.git dest=/srv/myapp version=HEAD"
Since Ansible modules can notify change handlers it is possible to
tell Ansible to run specific tasks when the code is updated, such as

View file

@ -27,7 +27,7 @@ Bootstrapping BSD
As mentioned above, you can bootstrap Ansible with the ``raw`` module and remotely install Python on targets. The following example installs Python 2.7 which includes the json library required for full functionality of Ansible.
On your control machine you can simply execute the following for most versions of FreeBSD::
ansible -m raw -a “pkg install -y python27” mybsdhost1
ansible -m raw -a "pkg install -y python27" mybsdhost1
Once this is done you can now use other Ansible modules apart from the ``raw`` module.
@ -66,7 +66,7 @@ Using BSD as the control machine is as simple as installing the Ansible package
BSD Facts
`````````
Ansible gathers facts from the BSDs in a similar manner to Linux machines, but since the data, names and structures can vary for network, disks and other devices, one should expect the output to be slightly different yet still familiar to a BSD administrator.
Ansible gathers facts from the BSDs in a similar manner to Linux machines, but since the data, names, and structures can vary for network, disks, and other devices, one should expect the output to be slightly different yet still familiar to a BSD administrator.
.. _bsd_contributions:

View file

@ -443,7 +443,7 @@ value is a TTL in seconds::
fact_path
=========
This option allows you to globally configure a custom path for :ref:`_local_facts`:: for the implied `setup` task when using implied fact gathering.
This option allows you to globally configure a custom path for :ref:`local_facts` for the implied `setup` task when using implied fact gathering.
fact_path = /home/centos/ansible_facts.d
@ -657,15 +657,15 @@ merge_multiple_cli_tags
.. versionadded:: 2.3
This allows changing how multiple :option:`--tags` and :option:`--skip-tags`
arguments are handled on the command line. Specifying :option:`--tags` more
than once merges all of the :option:`--tags` options together. If you want
the pre-2.4.x behaviour where only the last value of :option:`--tags` is used,
then set this to False. The same holds true for :option:`--skip-tags`.
This allows changing how multiple :option:`--tags <ansible-playbook --tags>` and :option:`--skip-tags <ansible-playbook --skip-tags>`
arguments are handled on the command line. Specifying :option:`--tags <ansible-playbook --tags>` more
than once merges all of the :option:`--tags <ansible-playbook --tags>` options together. If you want
the pre-2.4.x behaviour where only the last value of :option:`--tags <ansible-playbook --tags>` is used,
then set this to False. The same holds true for :option:`--skip-tags <ansible-playbook --skip-tags>`.
.. note:: The default value for this in 2.3 is False. In 2.4, the
default value is True. After 2.8, the option will be removed.
Multiple :option:`--tags` and multiple :option:`--skip-tags` will always
Multiple :option:`--tags <ansible-playbook --tags>` and multiple :option:`--skip-tags <ansible-playbook --skip-tags>` will always
be merged together.
.. _module_lang:
@ -814,26 +814,6 @@ always default to the current user if this is not defined::
remote_user = root
.. _restrict_facts_namespace:
restrict_facts_namespace
========================
.. versionadded:: 2.4
This allows restricting facts in their own namespace (under ansible_facts) instead of pushing them into the main.
False by default. Can also be set via the environment variable :envvar:`ANSIBLE_RESTRICT_FACTS`. Using `ansible_system` as an example:
When False::
- debug: var=ansible_system
When True::
- debug: var=ansible_facts.ansible_system
.. _retry_files_enabled:
retry_files_enabled
@ -1025,7 +1005,7 @@ As of 1.7 this file can also be a script. If you are using a script instead of a
Privilege Escalation Settings
-----------------------------
Ansible can use existing privilege escalation systems to allow a user to execute tasks as another. As of 1.9 become supersedes the old sudo/su, while still being backwards compatible. Settings live under the [privilege_escalation] header.
Ansible can use existing privilege escalation systems to allow a user to execute tasks as another. As of 1.9 'become' supersedes the old sudo/su, while still being backwards compatible. Settings live under the [privilege_escalation] header.
.. _become:

View file

@ -185,7 +185,7 @@ Security Group
``security_group_Pete_s_Fancy_Group``
Tags
Each instance can have a variety of key/value pairs associated with it called Tags. The most common tag key is 'Name', though anything is possible. Each key/value pair is its own group of instances, again with special characters converted to underscores, in the format ``tag_KEY_VALUE``
Each instance can have a variety of key/value pairs associated with it called Tags. The most common tag key is 'Name', though anything is possible. Each key/value pair is its own group of instances, again with special characters converted to underscores, in the format ``tag_KEY_VALUE``.
e.g.
``tag_Name_Web`` can be used as is
``tag_Name_redis-master-001`` becomes ``tag_Name_redis_master_001``
@ -265,7 +265,7 @@ Source an OpenStack RC file::
.. note::
An OpenStack RC file contains the environment variables required by the client tools to establish a connection with the cloud provider, such as the authentication URL, user name, password and region name. For more information on how to download, create or source an OpenStack RC file, please refer to `Set environment variables using the OpenStack RC file <http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html>`_.
An OpenStack RC file contains the environment variables required by the client tools to establish a connection with the cloud provider, such as the authentication URL, user name, password, and region name. For more information on how to download, create or source an OpenStack RC file, please refer to `Set environment variables using the OpenStack RC file <http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html>`_.
You can confirm the file has been successfully sourced by running a simple command, such as `nova list` and ensuring it return no errors.
@ -286,13 +286,13 @@ Once you confirm the dynamic inventory script is working as expected, you can te
Implicit use of inventory script
++++++++++++++++++++++++++++++++
Download the latest version of the OpenStack dynamic inventory script, make it executable and copy it to `/etc/ansible/hosts`::
Download the latest version of the OpenStack dynamic inventory script, make it executable, and copy it to `/etc/ansible/hosts`::
wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/openstack.py
chmod +x openstack.py
sudo cp openstack.py /etc/ansible/hosts
Download the sample configuration file, modify it to suit your needs and copy it to `/etc/ansible/openstack.yml`::
Download the sample configuration file, modify it to suit your needs, and copy it to `/etc/ansible/openstack.yml`::
wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/openstack.yml
vi openstack.yml

View file

@ -84,7 +84,7 @@ default this uses sftp. If that's not available, you can switch to scp in
By default, Ansible uses Python 2 in order to maintain compatibility with older distributions
such as RHEL 6. However, some Linux distributions (Gentoo, Arch) may not have a
Python 2.X interpreter installed by default. On those systems, you should install one, and set
the 'ansible_python_interpreter' variable in inventory (see :doc:`intro_inventory`) to point at your 2.X Python. Distributions
the ``ansible_python_interpreter`` variable in inventory (see :ref:`inventory`) to point at your 2.X Python. Distributions
like Red Hat Enterprise Linux, CentOS, Fedora, and Ubuntu all have a 2.X interpreter installed
by default and this does not apply to those distributions. This is also true of nearly all
Unix systems.
@ -101,30 +101,38 @@ Installing the Control Machine
``````````````````````````````
.. _from_yum:
Latest Release Via Yum
++++++++++++++++++++++
Latest Release via DNF or Yum
+++++++++++++++++++++++++++++
.. note:: Weve changed how the Ansible community packages are distributed.
For users of RHEL/CentOS/Scientific Linux version 7, the Ansible community RPM
package will transition from the EPEL repository to the Extras channel. There will be no
change for version 6 of RHEL/CentOS/Scientific Linux since Extras is not a part of version 6.
RPMs for RHEL7 are available from `the Extras channel <https://access.redhat.com/solutions/912213>`_.
RPMs for RHEL6 are available from yum for `EPEL
<http://fedoraproject.org/wiki/EPEL>`_ 6 and currently supported
Fedora distributions.
Ansible will also have RPMs/YUM-repo available at `<https://releases.ansible.com/ansible/rpms/`.
Ansible version 2.4 can manage earlier operating
systems that contain Python 2.6 or higher.
You can also build an RPM yourself. From the root of a checkout or tarball, use the ``make rpm`` command to build an RPM you can distribute and install.
On Fedora:
.. code-block:: bash
$ git clone git://github.com/ansible/ansible.git
$ sudo dnf install ansible
On RHEL and CentOS:
.. code-block:: bash
$ sudo yum install ansible
RPMs for RHEL 7 are available from the `Ansible Engine repository <https://access.redhat.com/articles/3174981>`_.
To enable the Ansible Engine repository, run the following command:
.. code-block:: bash
$ sudo subsription-manager repos --enable rhel-7-server-ansible-2.4-rpms
RPMs for currently supported versions of RHEL, CentOS, and Fedora are available from `EPEL <http://fedoraproject.org/wiki/EPEL>`_ as well as `releases.ansible.com <https://releases.ansible.com/ansible/rpm>`_.
Ansible version 2.4 and later can manage earlier operating systems that contain Python 2.6 or higher.
You can also build an RPM yourself. From the root of a checkout or tarball, use the ``make rpm`` command to build an RPM you can distribute and install.
.. code-block:: bash
$ git clone https://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ./rpm-build/ansible-*.noarch.rpm
@ -263,13 +271,13 @@ Then install Ansible with [1]_::
Or if you are looking for the latest development version::
pip install git+git://github.com/ansible/ansible.git@devel
pip install git+https://github.com/ansible/ansible.git@devel
If you are installing on OS X Mavericks, you may encounter some noise from your compiler. A workaround is to do the following::
$ sudo CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install ansible
Readers that use virtualenv can also install Ansible under virtualenv, though we'd recommend to not worry about it and just install Ansible globally. Do not use easy_install to install ansible directly.
Readers that use virtualenv can also install Ansible under virtualenv, though we'd recommend to not worry about it and just install Ansible globally. Do not use easy_install to install Ansible directly.
.. _tagged_releases:
@ -305,7 +313,7 @@ To install from source, clone the Ansible git repository:
.. code-block:: bash
$ git clone git://github.com/ansible/ansible.git --recursive
$ git clone https://github.com/ansible/ansible.git --recursive
$ cd ./ansible
Once git has cloned the Ansible repository, setup the Ansible environment:

View file

@ -11,7 +11,7 @@ which defaults to being saved in the location ``/etc/ansible/hosts``.
You can specify a different inventory file using the ``-i <path>`` option on the command line.
Not only is this inventory configurable, but you can also use multiple inventory files at the same time and
pull inventory from dynamic or cloud sources, as described in :doc:`intro_dynamic_inventory`.
pull inventory from dynamic or cloud sources or different formats (YAML, ini, etc.), as described in :doc:`intro_dynamic_inventory`.
Introduced in version 2.4, Ansible has inventory plugins to make this flexible and customizable.
.. _inventoryformat:
@ -38,12 +38,30 @@ For this example, the format for ``/etc/ansible/hosts`` is an INI-like (one of A
The headings in brackets are group names, which are used in classifying systems
and deciding what systems you are controlling at what times and for what purpose.
A YAML version would look like:
.. code-block:: yaml
all:
hosts:
mail.example.com
children:
webservers:
hosts:
foo.example.com:
bar.example.com:
dbservers:
hosts:
one.example.com:
two.example.com:
three.example.com:
It is ok to put systems in more than one group, for instance a server could be both a webserver and a dbserver.
If you do, note that variables will come from all of the groups they are a member of. Variable precedence is detailed in a later chapter.
If you have hosts that run on non-standard SSH ports you can put the port number
after the hostname with a colon. Ports listed in your SSH config file won't be used with the `paramiko`
connection but will be used with the `openssh` connection.
If you have hosts that run on non-standard SSH ports you can put the port number after the hostname with a colon.
Ports listed in your SSH config file won't be used with the `paramiko` connection but will be used with the `openssh` connection.
To make things explicit, it is suggested that you set them if things are not running on the default port:
@ -51,20 +69,33 @@ To make things explicit, it is suggested that you set them if things are not run
badwolf.example.com:5309
Suppose you have just static IPs and want to set up some aliases that live in your host file, or you are connecting through tunnels. You can also describe hosts like this:
Suppose you have just static IPs and want to set up some aliases that live in your host file, or you are connecting through tunnels.
You can also describe hosts via variables:
In INI:
.. code-block:: ini
jumper ansible_port=5555 ansible_host=192.0.2.50
In the above example, trying to ansible against the host alias "jumper" (which may not even be a real hostname) will contact 192.0.2.50 on port 5555. Note that this is using a feature of the inventory file to define some special variables. Generally speaking this is not the best
way to define variables that describe your system policy, but we'll share suggestions on doing this later. We're just getting started.
In YAML:
.. note:: Values passed in using the ``key=value`` syntax are interpreted as Python literal structure (strings, numbers, tuples, lists, dicts,
booleans, None), alternatively as string. For example ``var=FALSE`` would create a string equal to 'FALSE'. Do not rely on types set
during definition, always make sure you specify type with a filter when needed when consuming the variable.
.. code-block:: yaml
Adding a lot of hosts? If you have a lot of hosts following similar patterns you can do this rather than listing each hostname:
hosts:
jumper:
ansible_port: 5555
ansible_host: 192.0.2.50
In the above example, trying to ansible against the host alias "jumper" (which may not even be a real hostname) will contact 192.0.2.50 on port 5555.
Note that this is using a feature of the inventory file to define some special variables.
Generally speaking, this is not the best way to define variables that describe your system policy, but we'll share suggestions on doing this later.
.. note:: Values passed in the INI format using the ``key=value`` syntax are not interpreted as Python literal structure
(strings, numbers, tuples, lists, dicts, booleans, None), but as a string. For example ``var=FALSE`` would create a string equal to 'FALSE'.
Do not rely on types set during definition, always make sure you specify type with a filter when needed when consuming the variable.
If you are adding a lot of hosts following similar patterns, you can do this rather than listing each hostname:
.. code-block:: ini
@ -91,15 +122,14 @@ You can also select the connection type and user on a per host basis:
other1.example.com ansible_connection=ssh ansible_user=mpdehaan
other2.example.com ansible_connection=ssh ansible_user=mdehaan
As mentioned above, setting these in the inventory file is only a shorthand, and we'll discuss how to store them in individual files
in the 'host_vars' directory a bit later on.
As mentioned above, setting these in the inventory file is only a shorthand, and we'll discuss how to store them in individual files in the 'host_vars' directory a bit later on.
.. _host_variables:
Host Variables
++++++++++++++
As alluded to above, it is easy to assign variables to hosts that will be used later in playbooks:
As described above, it is easy to assign variables to hosts that will be used later in playbooks:
.. code-block:: ini
@ -112,7 +142,11 @@ As alluded to above, it is easy to assign variables to hosts that will be used l
Group Variables
+++++++++++++++
Variables can also be applied to an entire group at once::
Variables can also be applied to an entire group at once:
The INI way:
.. code-block:: ini
[atlanta]
host1
@ -122,14 +156,30 @@ Variables can also be applied to an entire group at once::
ntp_server=ntp.atlanta.example.com
proxy=proxy.atlanta.example.com
Be aware that this is only a convenient way to apply variables to multiple hosts at once; even though you can target hosts by group, variables are always flattened to the host level before a play is executed.
The YAML version:
.. code-block:: yaml
atlanta:
hosts:
host1:
host2:
vars:
ntp_server: ntp.atlanta.example.com
proxy: proxy.atlanta.example.com
Be aware that this is only a convenient way to apply variables to multiple hosts at once; even though you can target hosts by group, **variables are always flattened to the host level** before a play is executed.
.. _subgroups:
Groups of Groups, and Group Variables
+++++++++++++++++++++++++++++++++++++
It is also possible to make groups of groups using the ``:children`` suffix. Just like above, you can apply variables using ``:vars``::
It is also possible to make groups of groups using the ``:children`` suffix in INI or the ``children:`` entry in YAML.
You can apply variables using ``:vars`` or ``vars:``:
.. code-block:: ini
[atlanta]
host1
@ -155,11 +205,38 @@ It is also possible to make groups of groups using the ``:children`` suffix. Jus
southwest
northwest
.. code-block:: yaml
all:
children:
usa:
children:
southeast:
children:
atlanta:
hosts:
host1:
host2:
raleigh:
hosts:
host2:
host3:
vars:
some_server: foo.southeast.example.com
halon_system_timeout: 30
self_destruct_countdown: 60
escape_pods: 2
northeast:
northwest:
southwest:
If you need to store lists or hash data, or prefer to keep host and group specific variables separate from the inventory file, see the next section.
Child groups have a couple of properties to note:
- First, any host that is member of a child group is automatically a member of the parent group.
- Second, a child group's variables will have higher precedence (override) a parent group's variables.
- Any host that is member of a child group is automatically a member of the parent group.
- A child group's variables will have higher precedence (override) a parent group's variables.
- Groups can have multiple parents and children, but not circular relationships.
- Hosts can also be in multiple groups, but there will only be **one** instance of a host, merging the data from the multiple groups.
.. _default_groups:
@ -168,20 +245,20 @@ Default groups
There are two default groups: ``all`` and ``ungrouped``. ``all`` contains every host.
``ungrouped`` contains all hosts that don't have another group aside from ``all``.
Every host will always belong to at least 2 groups.
Though ``all`` and ``ungrouped`` are always present, they can be implicit and not appear in group listings like ``group_names``.
.. _splitting_out_vars:
Splitting Out Host and Group Specific Data
++++++++++++++++++++++++++++++++++++++++++
The preferred practice in Ansible is actually not to store variables in the main inventory file.
The preferred practice in Ansible is to not store variables in the main inventory file.
In addition to storing variables directly in the INI file, host
and group variables can be stored in individual files relative to the
inventory file.
In addition to storing variables directly in the inventory file, host and group variables can be stored in individual files relative to the inventory file (not directory, it is always the file).
These variable files are in YAML format. Valid file extensions include '.yml', '.yaml', '.json',
or no file extension. See :doc:`YAMLSyntax` if you are new to YAML.
These variable files are in YAML format. Valid file extensions include '.yml', '.yaml', '.json', or no file extension.
See :doc:`YAMLSyntax` if you are new to YAML.
Assuming the inventory file path is::
@ -202,10 +279,10 @@ the 'raleigh' group might look like::
ntp_server: acme.example.org
database_server: storage.example.org
It is ok if these files do not exist, as this is an optional feature.
It is okay if these files do not exist, as this is an optional feature.
As an advanced use-case, you can create *directories* named after your groups or hosts, and
Ansible will read all the files in these directories. An example with the 'raleigh' group::
As an advanced use case, you can create *directories* named after your groups or hosts, and
Ansible will read all the files in these directories in lexicographical order. An example with the 'raleigh' group::
/etc/ansible/group_vars/raleigh/db_settings
/etc/ansible/group_vars/raleigh/cluster_settings
@ -242,7 +319,7 @@ General for all connections:
ansible_host
The name of the host to connect to, if different from the alias you wish to give to it.
ansible_port
The ssh port number, if not 22
The ssh port number, if not 22.
ansible_user
The default ssh user name to use.
@ -250,7 +327,7 @@ ansible_user
Specific to the SSH connection:
ansible_ssh_pass
The ssh password to use (never store this variable in plain text; always use a vault. See :ref:`best_practices_for_variables_and_vaults`)
The ssh password to use (never store this variable in plain text; always use a vault. See :ref:`best_practices_for_variables_and_vaults`).
ansible_ssh_private_key_file
Private key file used by ssh. Useful if using multiple keys and you don't want to use SSH agent.
ansible_ssh_common_args
@ -272,17 +349,17 @@ ansible_ssh_executable (added in version 2.2)
Privilege escalation (see :doc:`Ansible Privilege Escalation<become>` for further details):
ansible_become
Equivalent to ``ansible_sudo`` or ``ansible_su``, allows to force privilege escalation
Equivalent to ``ansible_sudo`` or ``ansible_su``, allows to force privilege escalation.
ansible_become_method
Allows to set privilege escalation method
Allows to set privilege escalation method.
ansible_become_user
Equivalent to ``ansible_sudo_user`` or ``ansible_su_user``, allows to set the user you become through privilege escalation
Equivalent to ``ansible_sudo_user`` or ``ansible_su_user``, allows to set the user you become through privilege escalation.
ansible_become_pass
Equivalent to ``ansible_sudo_pass`` or ``ansible_su_pass``, allows you to set the privilege escalation password (never store this variable in plain text; always use a vault. See :ref:`best_practices_for_variables_and_vaults`)
Equivalent to ``ansible_sudo_pass`` or ``ansible_su_pass``, allows you to set the privilege escalation password (never store this variable in plain text; always use a vault. See :ref:`best_practices_for_variables_and_vaults`).
ansible_become_exe
Equivalent to ``ansible_sudo_exe`` or ``ansible_su_exe``, allows you to set the executable for the escalation method selected
Equivalent to ``ansible_sudo_exe`` or ``ansible_su_exe``, allows you to set the executable for the escalation method selected.
ansible_become_flags
Equivalent to ``ansible_sudo_flags`` or ``ansible_su_flags``, allows you to set the flags passed to the selected escalation method. This can be also set globally in :file:`ansible.cfg` in the ``sudo_flags`` option
Equivalent to ``ansible_sudo_flags`` or ``ansible_su_flags``, allows you to set the flags passed to the selected escalation method. This can be also set globally in :file:`ansible.cfg` in the ``sudo_flags`` option.
Remote host environment parameters:
@ -307,7 +384,7 @@ ansible_shell_executable
overrides ``executable`` in :file:`ansible.cfg` which defaults to
:command:`/bin/sh`. You should really only change it if is not possible
to use :command:`/bin/sh` (i.e. :command:`/bin/sh` is not installed on the target
machine or cannot be run from sudo.).
machine or cannot be run from sudo).
Examples from an Ansible-INI host file::
@ -372,7 +449,7 @@ Here is an example of how to instantly deploy to created containers::
:doc:`intro_adhoc`
Examples of basic commands
:doc:`playbooks`
Learning Ansibles configuration, deployment, and orchestration language.
Learning Ansible's configuration, deployment, and orchestration language
`Mailing List <http://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_

View file

@ -216,5 +216,5 @@ conditional.
The waitfor argument must always start with result and then the
command index in [], where 0 is the first command in the commands list,
1 is the second command, 2 is the third and so on.
1 is the second command, 2 is the third, and so on.

View file

@ -58,7 +58,7 @@ is uncommonly used::
webservers:!{{excluded}}:&{{required}}
You also don't have to manage by strictly defined groups. Individual host names, IPs and groups, can also be referenced using
You also don't have to manage by strictly defined groups. Individual host names, IPs, and groups, can also be referenced using
wildcards
.. code-block:: none

View file

@ -59,7 +59,7 @@ Once WSL is enabled, you can open the Bash terminal. At the prompt, you can quic
# https://github.com/Microsoft/BashOnWindows/issues/816#issuecomment-301216901 for details
source ~/.profile
After you've successfully run these commands, you can start to create your inventory, write example playbooks and start targeting systems using the plethora of available Windows modules.
After you've successfully run these commands, you can start to create your inventory, write example playbooks, and start targeting systems using the plethora of available Windows modules.
If you want to run Ansible from source for development purposes, simply uninstall the pip-installed version (which will leave all the necessary dependencies behind), then clone the Ansible source, and run the hacking script to configure it to run from source::
@ -94,7 +94,7 @@ You can specify which authentication option you wish to use by setting it to the
Certificate
+++++++++++
Certificate authentication is similar to SSH where a certificate is assigned to a local user and instead of using a password to authenticate a certificate is used instead.
Certificate authentication is similar to SSH where a certificate is assigned to a local user and instead of using a password to authenticate a certificate is used.
Kerberos
@ -142,7 +142,7 @@ Kerberos is installed and configured by default on OS X and many Linux distribut
Configuring Kerberos
--------------------
Edit your /etc/krb5.conf (which should be installed as a result of installing packages above) and add the following information for each domain you need to connect to:
Edit your `/etc/krb5.conf` (which should be installed as a result of installing packages above) and add the following information for each domain you need to connect to:
In the section that starts with
@ -204,13 +204,13 @@ If you unable to connect using kerberos, check the following:
Ensure that forward and reverse DNS lookups are working properly on your domain.
To test this, ping the windows host you want to control by name then use the ip address returned with nslookup. You should get the same name back from DNS when you use nslookup on the ip address.
To test this, ping the Windows host you want to control by name then use the ip address returned with nslookup. You should get the same name back from DNS when you use nslookup on the ip address.
If you get different hostnames back than the name you originally pinged, speak to your active directory administrator and get them to check that DNS Scavenging is enabled and that DNS and DHCP are updating each other.
Ensure that the Ansible controller has a properly configured computer account in the domain.
Check your Ansible controller's clock is synchronised with your domain controller. Kerberos is time sensitive and a little clock drift can cause tickets not be granted.
Check your Ansible controller's clock is synchronised with your domain controller. Kerberos is time sensitive and a little clock drift can cause tickets not to be granted.
Check you are using the real fully qualified domain name for the domain. Sometimes domains are commonly known to users by aliases. To check this run:
@ -242,7 +242,7 @@ To install credssp you can use pip to install the requests-credssp library:
CredSSP and TLS 1.2
-------------------
CredSSP requires the remote host to have TLS 1.2 configured or else the connection will fail. TLS 1.2 is installed by default from Server 2012 and Windows 8 onwards. For Server 2008, 2008 R2 and Windows 7 you can add TLS 1.2 support by:
CredSSP requires the remote host to have TLS 1.2 configured or else the connection will fail. TLS 1.2 is installed by default from Server 2012 and Windows 8 onward. For Server 2008, 2008 R2, and Windows 7 you can add TLS 1.2 support by:
* Installing the `TLS 1.2 update from Microsoft <https://support.microsoft.com/en-us/help/3080079/update-to-add-rds-support-for-tls-1.1-and-tls-1.2-in-windows-7-or-windows-server-2008-r2>`_
* Adding the TLS 1.2 registry keys as shown on this `page <https://technet.microsoft.com/en-us/library/dn786418.aspx#BKMK_SchannelTR_TLS12>`_
@ -255,7 +255,7 @@ If you need to interact with a remote resource or run a process that requires th
Inventory
`````````
Ansible's windows support relies on a few standard variables to indicate the username, password, and connection type (windows) of the remote hosts. These variables are most easily set up in inventory. This is used instead of SSH-keys or passwords as normally fed into Ansible::
Ansible's Windows support relies on a few standard variables to indicate the username, password, and connection type (Windows) of the remote hosts. These variables are most easily set up in inventory. This is used instead of SSH-keys or passwords as normally fed into Ansible::
[windows]
winserver1.example.com
@ -311,7 +311,7 @@ Since 2.0, the following custom inventory variables are also supported for addit
Windows System Prep
```````````````````
In order for Ansible to manage your windows machines, you will have to enable and configure PowerShell remoting.
In order for Ansible to manage your Windows machines, you will have to enable and configure PowerShell remoting.
To automate the setup of WinRM, you can run the `examples/scripts/ConfigureRemotingForAnsible.ps1 <https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1>`_ script on the remote machine in a PowerShell console as an administrator.
@ -340,7 +340,7 @@ To troubleshoot the ``ConfigureRemotingForAnsible.ps1`` writes every change it m
Management Framework 3.0, it may be necessary to install this
hotfix http://support.microsoft.com/kb/2842230 to avoid receiving
out of memory and stack overflow exceptions. Newly-installed Server 2008
R2 systems which are not fully up to date with windows updates are known
R2 systems which are not fully up to date with Windows updates are known
to have this issue.
Windows 8.1 and Server 2012 R2 are not affected by this issue as they
@ -386,9 +386,9 @@ In addition, the following core modules/action-plugins work with Windows:
* template (also: win_template)
* wait_for_connection
Some modules can be utilised in playbooks that target windows by delegating to localhost, depending on what you are
Some modules can be utilised in playbooks that target Windows by delegating to localhost, depending on what you are
attempting to achieve. For example, ``assemble`` can be used to create a file on your ansible controller that is then
sent to your windows targets using ``win_copy``.
sent to your Windows targets using ``win_copy``.
In many cases, there is no need to use or write an Ansible module. In particular, the ``script`` module can be used to run arbitrary PowerShell scripts, allowing Windows administrators familiar with PowerShell a very native way to do things, as in the following playbook::
@ -425,7 +425,7 @@ Modules (ps1 files) should start as follows::
# code goes here, reading in stdin as JSON and outputting JSON
The above magic is necessary to tell Ansible to mix in some common code and also know how to push modules out. The common code contains some nice wrappers around working with hash data structures and emitting JSON results, and possibly a few more useful things. Regular Ansible has this same concept for reusing Python code - this is just the windows equivalent.
The above magic is necessary to tell Ansible to mix in some common code and also know how to push modules out. The common code contains some nice wrappers around working with hash data structures and emitting JSON results, and possibly a few more useful things. Regular Ansible has this same concept for reusing Python code - this is just the Windows equivalent.
What modules you see in ``windows/`` are just a start. Additional modules may be submitted as pull requests to github.
@ -434,7 +434,7 @@ What modules you see in ``windows/`` are just a start. Additional modules may b
Windows Facts
`````````````
Just as with Linux/Unix, facts can be gathered for windows hosts, which will return things such as the operating system version. To see what variables are available about a windows host, run the following::
Just as with Linux/Unix, facts can be gathered for Windows hosts, which will return things such as the operating system version. To see what variables are available about a Windows host, run the following::
ansible winhost.example.com -m setup

View file

@ -1,51 +1,50 @@
Module Support
--------------
Module Maintenance & Support
----------------------------
.. toctree:: :maxdepth: 1
Ansible has many modules, but not all of them are maintained by the core project committers. Each module should have associated metadata that indicates which of the following categories they fall into. This should be visible in each module's documentation.
Documentation updates for each module can also be edited directly in the module and by submitting a pull request to the module source code; just look for the "DOCUMENTATION" block in the source tree.
If you believe you have found a bug in a module and are already running the latest stable or development version of Ansible, first look in the `issue tracker at github.com/ansible/ansible <https://github.com/ansible/ansible/issues>`_ to see if a bug has already been filed. If not, we would be grateful if you would file one.
Should you have a question rather than a bug report, inquiries are welcome on the `ansible-project google group <https://groups.google.com/forum/#!forum/ansible-project>`_ or on Ansible's "#ansible" channel, located on irc.freenode.net.
For development-oriented topics, use the `ansible-devel google group <https://groups.google.com/forum/#!forum/ansible-devel>`_ or Ansible's ``#ansible`` and ``#ansible-devel`` channels, located on irc.freenode.net. You should also read :doc:`community`, :doc:`dev_guide/testing` and :doc:`dev_guide/developing_modules`.
The modules are hosted on GitHub in a subdirectory of the `ansible <https://github.com/ansible/ansible/tree/devel/lib/ansible/modules>`_ repo.
To help identify maintainers and understand how the included modules are officially supported, each module now has associated metadata that provides additional clarity for maintenance and support.
Core
````
These are :doc:`modules maintained by the Ansible Core Team<core_maintained>`
and will always ship with Ansible itself.
:doc:`Core modules are maintained by the Ansible Engineering Team<core_maintained>`.
These modules are integral to the basic foundations of the Ansible distribution.
Network
```````
These are :doc:`modules maintained by the Ansible Network Team<network_maintained>` in a relationship
similar to how the Ansible Core Team maintains the Core modules.
:doc:`Network modules are maintained by the Ansible Network Team<network_maintained>`. Please note there are :doc:`additional networking modules<list_of_network_modules>` that are categorized as Certified or Community not maintained by Ansible.
Certified
`````````
Some examples of :doc:`Certified Modules<partner_maintained>` are those submitted by other companies. Maintainers of these types of modules must watch for any issues reported or pull requests raised against the module.
The Ansible Core Team will review all modules becoming certified. Core committers will review proposed changes to existing Certified Modules once the community maintainers of the module have approved the changes. Core committers will also ensure that any issues that arise due to Ansible engine changes will be remediated.
Also, it is strongly recommended (but not presently required) for these types of modules to have unit tests.
These modules are currently shipped with Ansible, but might be shipped separately in the future.
Certified modules are part of a future planned program currently in development.
Community
`````````
These are :doc:`modules maintained by the Ansible Community<community_maintained>`. They **are not** supported by the Ansible Core Team or by companies/partners associated to the module.
:doc:`Community modules are submitted and maintained by the Ansible community<community_maintained>`. These modules are not maintained by Ansible, and are included as a convenience.
They are still fully usable, but the response rate to issues is purely up to the community. Best effort support will be provided but is not covered under any support contracts.
Issue Reporting
```````````````
These modules are currently shipped with Ansible, but will most likely be shipped separately in the future.
If you believe you have found a bug in a module and are already running the latest stable or development version of Ansible, first look at the `issue tracker in the Ansible repo <https://github.com/ansible/ansible/issues>`_ to see if an issue has already been filed. If not, please file one.
Should you have a question rather than a bug report, inquiries are welcome on the `ansible-project Google group <https://groups.google.com/forum/#%21forum/ansible-project>`_ or on Ansible's "#ansible" channel, located on irc.freenode.net.
For development-oriented topics, use the `ansible-devel Google group <https://groups.google.com/forum/#%21forum/ansible-devel>`_ or Ansible's #ansible and #ansible-devel channels, located on irc.freenode.net. You should also read :doc:`Community Information & Contributing <community>`, :doc:`Testing Ansible <dev_guide/testing>`, and :doc:`Developing Modules <dev_guide/developing_modules>`.
The modules are hosted on GitHub in a subdirectory of the `Ansible <https://github.com/ansible/ansible/tree/devel/lib/ansible/modules>`_ repo.
NOTE: If you have a Red Hat Ansible Engine product subscription, please follow the standard issue reporting process via the Red Hat Customer Portal.
Support
```````
For more information on how included Ansible modules are supported by Red Hat,
please refer to the following `knowledgebase article <https://access.redhat.com/articles/3166901>`_ as well as other resources on the `Red Hat Customer Portal. <https://access.redhat.com/>`_
.. seealso::

View file

@ -32,7 +32,7 @@ Errors generally fall into one of the following categories:
* Can occur when trying to pull a large amount of data
* May actually be masking a authentication issue
:Playbook issues:
* Use of ``delegate_to``, instead of ``ProxyCommand``
* Use of ``delegate_to``, instead of ``ProxyCommand``. See :ref:`network proxy guide <network_delegate_to_vs_ProxyCommand>` for more information.
* Not using ``connection: local``
@ -51,7 +51,9 @@ Enabling Networking logging and how to read the logfile
Ansible 2.3 features improved logging to help diagnose and troubleshoot issues regarding Ansible Networking modules.
Because logging is very verbose it is disabled by default. It can be enabled via the :envvar:`ANSIBLE_LOG_PATH` and :envvar:`ANISBLE_DEBUG` options::
Because logging is very verbose it is disabled by default. It can be enabled via the :envvar:`ANSIBLE_LOG_PATH` and :envvar:`ANSIBLE_DEBUG` options on the ansible-controller, that is the machine running ansible-playbook.
Before running ``ansible-playbook`` run the following commands to enable logging::
# Specify the location for the log file
export ANSIBLE_LOG_PATH=~/ansible.log
@ -61,10 +63,12 @@ Because logging is very verbose it is disabled by default. It can be enabled via
# Run with 4*v for connection level verbosity
ansible-playbook -vvvv ...
After Ansible has finished running you can inspect the log file:
After Ansible has finished running you can inspect the log file which has been created on the ansible-controller:
.. code::
less $ANSIBLE_LOG_PATH
2017-03-30 13:19:52,740 p=28990 u=fred | creating new control socket for host veos01:22 as user admin
2017-03-30 13:19:52,741 p=28990 u=fred | control socket path is /home/fred/.ansible/pc/ca5960d27a
2017-03-30 13:19:52,741 p=28990 u=fred | current working directory is /home/fred/ansible/test/integration
@ -410,10 +414,10 @@ For example:
Suggestions to resolve:
Increase value of presistent connection idle timeout.
Note: This value should be greater than SSH timeout ie. timeout value under defaults
section in configuration file and less than the value of the persistent
connection idle timeout (connect_timeout)
Increase the value of the persistent connection idle timeout.
Note: This value should be greater than the SSH timeout value (the timeout value under the defaults
section in the configuration file) and less than the value of the persistent
connection idle timeout (connect_timeout).
.. code-block:: yaml
@ -493,7 +497,7 @@ Add ``authorize: yes`` to the task. For example:
If the user requires a password to go into privileged mode, this can be specified with ``auth_pass``; if ``auth_pass`` isn't set, the environment variable :envvar:`ANSIBLE_NET_AUTHORIZE` will be used instead.
Add `authorize: yes` to the task. For example:
Add ``authorize: yes`` to the task. For example:
.. code-block:: yaml
@ -506,40 +510,41 @@ Add `authorize: yes` to the task. For example:
register: result
.. delete_to not honoured
----------------------
Proxy Issues
============
FIXME Do we get an error message
.. _network_delegate_to_vs_ProxyCommand:
FIXME Link to howto
delegate_to vs ProxyCommand
---------------------------
The new connection framework for Network Modules in Ansible 2.3 that uses ``cli`` transport
no longer supports the use of the ``delegate_to`` directive.
In order to use a bastion or intermediate jump host to connect to network devices over ``cli``
transport, network modules now support the use of ``ProxyCommand``.
To use ``ProxyCommand``, configure the proxy settings in the Ansible inventory
file to specify the proxy host.
.. code-block:: ini
[nxos]
nxos01
nxos02
[nxos:vars]
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -q bastion01"'
With the configuration above, simply build and run the playbook as normal with
no additional changes necessary. The network module will now connect to the
network device by first connecting to the host specified in
``ansible_ssh_common_args``, which is ``bastion01`` in the above example.
fixmes
======
.. note:: Using ``ProxyCommand`` with passwords via variables
Error: "number of connection attempts exceeded, unable to connect to control socket"
------------------------------------------------------------------------------------
By design, SSH doesn't support providing passwords via environment variables.
This is done to prevent secrets from leaking out, for example in ``ps`` output.
**Platforms:** Any
This occurs when Ansible wasn't able to connect to the remote device and obtain a shell with the timeout.
This information is available when :ref:`DEFAULT_LOG_PATH` is set see (FIXMELINKTOSECTION):
.. code-block:: yaml
less $ANSIBLE_LOG_PATH
2017-03-10 15:32:06,173 p=19677 u=fred | connect retry timeout expired, unable to connect to control socket
2017-03-10 15:32:06,174 p=19677 u=fred | persistent_connect_retry_timeout is 15 secs
2017-03-10 15:32:06,222 p=19669 u=fred | fatal: [veos01]: FAILED! => {
Suggestions to resolve:
Do stuff For example:
.. code-block:: yaml
Example stuff
We recommend using SSH Keys, and if needed an ssh-agent, rather than passwords, where ever possible.

View file

@ -94,7 +94,7 @@ of tasks running concurrently, you can do it this way::
- 4
- 5
durations: "{{ item }}"
include: execute_batch.yml
include_tasks: execute_batch.yml
with_items:
- "{{ sleep_durations | batch(2) | list }}"

View file

@ -216,15 +216,15 @@ variables from the file "group_vars/ec2_tag_class_webserver" automatically.
Top Level Playbooks Are Separated By Role
`````````````````````````````````````````
In site.yml, we include a playbook that defines our entire infrastructure. Note this is SUPER short, because it's just including
some other playbooks. Remember, playbooks are nothing more than lists of plays::
In site.yml, we import a playbook that defines our entire infrastructure. This is a very short example, because it's just importing
some other playbooks::
---
# file: site.yml
- include: webservers.yml
- include: dbservers.yml
- import_playbook: webservers.yml
- import_playbook: dbservers.yml
In a file like webservers.yml (also at the top level), we simply map the configuration of the webservers group to the roles performed by the webservers group. Also notice this is incredibly short. For example::
In a file like webservers.yml (also at the top level), we map the configuration of the webservers group to the roles performed by the webservers group::
---
# file: webservers.yml

View file

@ -154,13 +154,13 @@ there will be accessible to future tasks::
.. _when_roles_and_includes:
Applying 'when' to roles and includes
`````````````````````````````````````
Applying 'when' to roles, imports, and includes
```````````````````````````````````````````````
Note that if you have several tasks that all share the same conditional statement, you can affix the conditional
to a task include statement as below. All the tasks get evaluated, but the conditional is applied to each and every task::
- include: tasks/sometasks.yml
- import_tasks: tasks/sometasks.yml
when: "'reticulating splines' in output"
.. note:: In versions prior to 2.0 this worked with task includes but not playbook includes. 2.0 allows it to work with both.
@ -174,6 +174,24 @@ Or with a role::
You will note a lot of 'skipped' output by default in Ansible when using this approach on systems that don't match the criteria.
Read up on the 'group_by' module in the :doc:`modules` docs for a more streamlined way to accomplish the same thing.
When used with `include_*` tasks instead of imports, the conditional is applied _only_ to the include task itself and not any other
tasks within the included file(s). A common situation where this distinction is important is as follows::
# include a file to define a variable when it is not already defined
# main.yml
- include_tasks: other_tasks.yml
when: x is not defined
# other_tasks.yml
- set_fact:
x: foo
- debug:
var: x
In the above example, if ``import_tasks`` had been used instead both included tasks would have also been skipped. With ``include_tasks``
instead, the tasks are executed as expected because the conditional is not applied to them.
.. _conditional_imports:
Conditional Imports

View file

@ -155,26 +155,26 @@ To get a random item from a list::
"{{ ['a','b','c']|random }}"
# => 'c'
To get a random number from 0 to supplied end::
To get a random number between 0 and a specified number::
"{{ 59 |random}} * * * * root /script/from/cron"
"{{ 60 |random}} * * * * root /script/from/cron"
# => '21 * * * * root /script/from/cron'
Get a random number from 0 to 100 but in steps of 10::
{{ 100 |random(step=10) }}
{{ 101 |random(step=10) }}
# => 70
Get a random number from 1 to 100 but in steps of 10::
{{ 100 |random(1, 10) }}
{{ 101 |random(1, 10) }}
# => 31
{{ 100 |random(start=1, step=10) }}
{{ 101 |random(start=1, step=10) }}
# => 51
As of Ansible version 2.3, it's also possible to initialize the random number generator from a seed. This way, you can create random-but-idempotent numbers::
"{{ 59 |random(seed=inventory_hostname) }} * * * * root /script/from/cron"
"{{ 60 |random(seed=inventory_hostname) }} * * * * root /script/from/cron"
Shuffle Filter
@ -695,11 +695,11 @@ To add quotes for shell usage::
To use one value on true and another on false (new in version 1.9)::
{{ (name == "John") | ternary('Mr','Ms') }}
{{ (name == "John") | ternary('Mr','Ms') }}
To concatenate a list into a string::
{{ list | join(" ") }}
{{ list | join(" ") }}
To get the last name of a file path, like 'foo.txt' out of '/etc/asdf/foo.txt'::
@ -735,7 +735,7 @@ To expand a path containing a tilde (`~`) character (new in version 1.5)::
To get the real path of a link (new in version 1.8)::
{{ path | realpath }}
{{ path | realpath }}
To get the relative path of a link, from a start point (new in version 1.7)::

View file

@ -345,7 +345,7 @@ a variable called ``vhost`` in the ``vars`` section, you could do this::
Those same variables are usable in templates, which we'll get to later.
Now in a very basic playbook all the tasks will be listed directly in that play, though it will usually
make more sense to break up tasks using the ``include:`` directive. We'll show that a bit later.
make more sense to break up tasks as described in :doc:`playbooks_reuse`.
.. _action_shorthand:
@ -458,7 +458,7 @@ Let's run a playbook using a parallelism level of 10::
ansible-playbook playbook.yml -f 10
.. _ansible-pull:
.. _playbook_ansible-pull:
Ansible-Pull
````````````

View file

@ -458,7 +458,7 @@ Please check https://api.mongodb.org/python/current/api/pymongo/collection.html?
Since there are too many parameters for this lookup method, below is a sample playbook which shows its usage and a nice way to feed the parameters:
.. code-block:: YAML+Jinja
.. code-block:: yaml
---
- hosts: all

View file

@ -743,7 +743,7 @@ Ansible by default sets the loop variable `item` for each loop, which causes the
As of Ansible 2.1, the `loop_control` option can be used to specify the name of the variable to be used for the loop::
# main.yml
- include: inner.yml
- include_tasks: inner.yml
with_items:
- 1
- 2
@ -807,7 +807,7 @@ Because `loop_control` is not available in Ansible 2.0, when using an include wi
for `item`::
# main.yml
- include: inner.yml
- include_tasks: inner.yml
with_items:
- 1
- 2

View file

@ -27,8 +27,9 @@ Here is a most basic example::
- name: "favcolor"
prompt: "what is your favorite color?"
.. note::
Prompts for individual ``vars_prompt`` variables will be skipped for any variable that is already defined through the command line ``--extra-vars`` option, or when running from a non-interactive session (such as cron or Ansible Tower). See :ref:`_passing_variables_on_the_command_line` in the /Variables/ chapter.
Prompts for individual ``vars_prompt`` variables will be skipped for any variable that is already defined through the command line ``--extra-vars`` option, or when running from a non-interactive session (such as cron or Ansible Tower). See :ref:`passing_variables_on_the_command_line` in the /Variables/ chapter.
If you have a variable that changes infrequently, it might make sense to
provide a default value that can be overridden. This can be accomplished using
@ -77,13 +78,13 @@ You can use any crypt scheme supported by 'Passlib':
- *sun_md5_crypt* - Sun MD5 Crypt
- *sha256_crypt* - SHA-256 Crypt
- *sha512_crypt* - SHA-512 Crypt
- *apr_md5_crypt* - Apaches MD5-Crypt variant
- *phpass* - PHPass Portable Hash
- *apr_md5_crypt* - Apache's MD5-Crypt variant
- *phpass* - PHPass' Portable Hash
- *pbkdf2_digest* - Generic PBKDF2 Hashes
- *cta_pbkdf2_sha1* - Cryptaculars PBKDF2 hash
- *dlitz_pbkdf2_sha1* - Dwayne Litzenbergers PBKDF2 hash
- *cta_pbkdf2_sha1* - Cryptacular's PBKDF2 hash
- *dlitz_pbkdf2_sha1* - Dwayne Litzenberger's PBKDF2 hash
- *scram* - SCRAM Hash
- *bsd_nthash* - FreeBSDs MCF-compatible nthash encoding
- *bsd_nthash* - FreeBSD's MCF-compatible nthash encoding
However, the only parameters accepted are 'salt' or 'salt_size'. You can use your own salt using
'salt', or have one generated automatically using 'salt_size'. If nothing is specified, a salt

View file

@ -9,10 +9,12 @@ Creating Reusable Playbooks
While it is possible to write a playbook in one very large file (and you might start out learning playbooks this way), eventually you'll want to reuse files and start to organize things. In Ansible, there are three ways to do this: includes, imports, and roles.
Includes and imports allow users to break up large playbooks into smaller files, which can be used across multiple parent playbooks or even multiple times within the same Playbook.
Includes and imports (added in 2.4) allow users to break up large playbooks into smaller files, which can be used across multiple parent playbooks or even multiple times within the same Playbook.
Roles allow more than just tasks to be packaged together and can include variables, handlers, or even modules and other plugins. Unlike includes and imports, roles can also be uploaded and shared via Ansible Galaxy.
.. _dynamic_vs_static:
Dynamic vs. Static
``````````````````
@ -50,8 +52,8 @@ The primary advantage of using ``include*`` statements is looping. When a loop i
Using ``include*`` does have some limitations when compared to ``import*`` statements:
* Tags which only exist inside a dynamic include will not show up in --list-tags output.
* Tasks which only exist inside a dynamic include will not show up in --list-tasks output.
* Tags which only exist inside a dynamic include will not show up in ``--list-tags`` output.
* Tasks which only exist inside a dynamic include will not show up in ``--list-tasks`` output.
* You cannot use ``notify`` to trigger a handler name which comes from inside a dynamic include (see note below).
* You cannot use ``--start-at-task`` to begin execution at a task inside a dynamic include.

View file

@ -13,17 +13,25 @@ As noted in :doc:`playbooks_reuse`, include and import statements are very simil
Please refer to :doc:`playbooks_reuse` for documentation concerning the trade-offs one may encounter when using each type.
Also be aware that this behaviour changed in 2.4; prior to that Ansible version only ``include`` was available, and it behaved differently depending on context.
.. versionadded:: 2.4
Importing Playbooks
```````````````````
It is possible to include playbooks inside a master playbook. For example::
---
import_playbook: webservers.yml
import_playbook: databases.yml
- import_playbook: webservers.yml
- import_playbook: databases.yml
Each playbook listed will be run in the order they are listed.
The plays and tasks in each playbook listed will be run in the order they are listed, just as if they had been defined here directly.
Prior to 2.4 only ``include`` was available and worked for both playbooks and tasks as both import and include.
.. versionadded:: 2.4
Including and Importing Task Files
``````````````````````````````````
@ -61,7 +69,7 @@ Variables can also be passed to include files using an alternative syntax, which
- "{{ lookup('file', 'keys/one.pub') }}"
- "{{ lookup('file', 'keys/two.pub') }}"
Using either syntax, variables passed in can then be used in the included files. These variables will only be available to tasks within the included file. See :doc:`variable_precedence` for more details on variable inheritance and precedence.
Using either syntax, variables passed in can then be used in the included files. These variables will only be available to tasks within the included file. See :ref:`variable_precedence` for more details on variable inheritance and precedence.
Task include statements can be used at arbitrary depth.

View file

@ -33,8 +33,8 @@ Roles expect files to be in certain directory names. Roles must include at least
- ``tasks`` - contains the main list of tasks to be executed by the role.
- ``handlers`` - contains handlers, which may be used by this role or even anywhere outside this role.
- ``defaults`` - default variables for the role (see :doc:`Variables` for more information).
- ``vars`` - other variables for the role (see :doc:`Variables` for more information).
- ``defaults`` - default variables for the role (see :doc:`playbooks_variables` for more information).
- ``vars`` - other variables for the role (see :doc:`playbooks_variables` for more information).
- ``files`` - contains files which can be deployed via this role.
- ``templates`` - contains templates which can be deployed via this role.
- ``meta`` - defines some meta data for this role. See below for more details.
@ -42,7 +42,8 @@ Roles expect files to be in certain directory names. Roles must include at least
Other YAML files may be included in certain directories. For example, it is common practice to have platform-specific tasks included from the ``tasks/main.yml`` file::
# roles/example/tasks/main.yml
- import_tasks: redhat.yml
- name: added in 2.4, previouslly you used 'include'
import_tasks: redhat.yml
when: ansible_os_platform|lower == 'redhat'
- import_tasks: debian.yml
when: ansible_os_platform|lower == 'debian'
@ -57,7 +58,7 @@ Other YAML files may be included in certain directories. For example, it is comm
name: "apache2"
state: present
Roles may also include modules and other plugin types. For more information, please refer to the :doc:`Embedding Modules and Plugins In Roles` section below.
Roles may also include modules and other plugin types. For more information, please refer to the :ref:`embedding_modules_and_plugins_in_roles` section below.
Using Roles
```````````
@ -113,9 +114,9 @@ As of Ansible 2.4, you can now use roles inline with any other tasks using ``imp
When roles are defined in the classic manner, they are treated as static imports and processed during playbook parsing.
.. note::
The ``include_role`` option was introduced in Ansible 2.3. The usage has changed slightly as of Ansible 2.4 to match the include (dynamic) vs. import (static) usage. See :doc:`Dynamic vs. Static` for more details.
The ``include_role`` option was introduced in Ansible 2.3. The usage has changed slightly as of Ansible 2.4 to match the include (dynamic) vs. import (static) usage. See :ref:`dynamic_vs_static` for more details.
The name used for the role can be a simple name (see :doc:`Role Search Path` below), or it can be a fully qualified path::
The name used for the role can be a simple name (see :ref:`role_search_path` below), or it can be a fully qualified path::
---
@ -197,7 +198,7 @@ To make roles run more than once, there are two options:
1. Pass different parameters in each role definition.
2. Add ``allow_duplicates: true`` to the ``meta/main.yml`` file for the role.
Example 1 - passing different paramters::
Example 1 - passing different parameters::
---
- hosts: webservers
@ -290,6 +291,8 @@ Note that we did not have to use ``allow_duplicates: true`` for ``wheel``, becau
.. note::
Variable inheritance and scope are detailed in the :doc:`playbooks_variables`.
.. _embedding_modules_and_plugins_in_roles:
Embedding Modules and Plugins In Roles
``````````````````````````````````````
@ -332,6 +335,8 @@ The same mechanism can be used to embed and distribute plugins in a role, using
They can then be used in a template or a jinja template in any role called after 'my_custom_filter'
.. _role_search_path:
Role Search Path
````````````````

View file

@ -80,9 +80,14 @@ You may also apply tags to roles::
roles:
- { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }
And include statements::
And import/include statements::
- include: foo.yml
- import_tasks: foo.yml
tags: [web,foo]
or::
- include_tasks: foo.yml
tags: [web,foo]
All of these apply the specified tags to EACH task inside the play, included

View file

@ -836,13 +836,16 @@ In 2.x, we have made the order of precedence more specific (with the last listed
* role defaults [1]_
* inventory file or script group vars [2]_
* inventory group_vars/all
* playbook group_vars/all
* inventory group_vars/*
* playbook group_vars/*
* inventory group_vars/all [3]_
* playbook group_vars/all [3]_
* inventory group_vars/* [3]_
* playbook group_vars/* [3]_
* inventory file or script host vars [2]_
* inventory host_vars/*
* playbook host_vars/*
* host facts / cached set_facts [4]_
* inventory host_vars/* [3]_
* playbook host_vars/* [3]_
* host facts
* play vars
* play vars_prompt
@ -862,6 +865,9 @@ Basically, anything that goes into "role defaults" (the defaults folder inside t
.. [1] Tasks in each role will see their own role's defaults. Tasks defined outside of a role will see the last role's defaults.
.. [2] Variables defined in inventory file or provided by dynamic inventory.
.. [3] Includes vars added by 'vars plugins' as well as host_vars and group_vars which are added by the default vars plugin shipped with Ansible.
.. [4] When created with set_facts's cacheable option, variables will have the high precedence in the play,
but will be the same as a host facts precedence when they come from the cache.
.. note:: Within any section, redefining a var will overwrite the previous instance.
If multiple groups have the same variable, the last one loaded wins.

View file

@ -3,9 +3,9 @@ Using Vault in playbooks
.. contents:: Topics
New in Ansible 1.5, "Vault" is a feature of ansible that allows keeping sensitive data such as passwords or keys in encrypted files, rather than as plaintext in your playbooks or roles. These vault files can then be distributed or placed in source control.
Added in Ansible 1.5, "Vault" is a feature of ansible that allows keeping sensitive data such as passwords or keys in encrypted files, rather than as plaintext in your playbooks or roles. These vault files can then be distributed or placed in source control.
To enable this feature, a command line tool, `ansible-vault` is used to edit files, and a command line flag `--ask-vault-pass` or `--vault-password-file` is used. Alternately, you may specify the location of a password file or command Ansible to always prompt for the password in your ansible.cfg file. These options require no command line flag usage.
To enable this feature, a command line tool, :ref:`ansible-vault` is used to edit files, and a command line flag :option:`--ask-vault-pass <ansible-vault --ask-vault-pass>` or :option:`--vault-password-file <ansible-vault --vault-password-file>` is used. You can also modify your ``ansible.cfg`` file to specify the location of a password file or configure Ansible to always prompt for the password. These options require no command line flag usage.
For best practices advice, refer to :ref:`best_practices_for_variables_and_vaults`.
@ -35,7 +35,7 @@ If you are using a script instead of a flat file, ensure that it is marked as ex
This is something you may wish to do if using Ansible from a continuous integration system like Jenkins.
(The `--vault-password-file` option can also be used with the :ref:`ansible-pull` command if you wish, though this would require distributing the keys to your nodes, so understand the implications -- vault is more intended for push mode).
The :option:`--vault-password-file <ansible-pull --vault-password-file>` option can also be used with the :ref:`ansible-pull` command if you wish, though this would require distributing the keys to your nodes, so understand the implications -- vault is more intended for push mode.
.. _single_encrypted_variable:
@ -55,7 +55,7 @@ As of version 2.3, Ansible can now use a vaulted variable that lives in an other
34623731376664623134383463316265643436343438623266623965636363326136
other_plain_text: othervalue
To create a vaulted variable, use the :ref:`ansible-vault encrypt_string` command. See :ref:`encrypt_string` for details.
To create a vaulted variable, use the :ref:`ansible-vault encrypt_string <ansible_vault_encrypt_string>` command. See :ref:`encrypt_string` for details.
This vaulted variable will be decrypted with the supplied vault secret and used as a normal variable. The ``ansible-vault`` command line supports stdin and stdout for encrypting data on the fly, which can be used from your favorite editor to create these vaulted variables; you just have to be sure to add the ``!vault`` tag so both Ansible and YAML are aware of the need to decrypt. The ``|`` is also required, as vault encryption results in a multi-line string.
@ -66,6 +66,6 @@ Using encrypt_string
````````````````````
This command will output a string in the above format ready to be included in a YAML file.
The string to encrypt can be provided via stdin, command line args, or via an interactive prompt.
The string to encrypt can be provided via stdin, command line arguments, or via an interactive prompt.
See :ref:`encrypt_string_for_use_in_yaml`.

View file

@ -109,7 +109,7 @@ While all items listed here will show a deprecation warning message, they still
* Bare variables in ``with_`` loops should instead use the ``"{ {var }}"`` syntax, which helps eliminate ambiguity.
* The ansible-galaxy text format requirements file. Users should use the YAML format for requirements instead.
* Undefined variables within a ``with_`` loops list currently do not interrupt the loop, but they do issue a warning; in the future, they will issue an error.
* Undefined variables within a ``with_`` loop's list currently do not interrupt the loop, but they do issue a warning; in the future, they will issue an error.
* Using dictionary variables to set all task parameters is unsafe and will be removed in a future version. For example::
- hosts: localhost
@ -129,8 +129,8 @@ While all items listed here will show a deprecation warning message, they still
* Host patterns should use a comma (,) or colon (:) instead of a semicolon (;) to separate hosts/groups in the pattern.
* Ranges specified in host patterns should use the [x:y] syntax, instead of [x-y].
* Playbooks using privilege escalation should always use “become*” options rather than the old su*/sudo* options.
* The “short form” for vars_prompt is no longer supported.
* Playbooks using privilege escalation should always use "become*" options rather than the old su*/sudo* options.
* The "short form" for vars_prompt is no longer supported.
For example::
vars_prompt:
@ -138,28 +138,28 @@ While all items listed here will show a deprecation warning message, they still
* Specifying variables at the top level of a task include statement is no longer supported. For example::
- include: foo.yml
- include_tasks: foo.yml
a: 1
Should now be::
- include: foo.yml
- include_tasks: foo.yml
vars:
a: 1
* Setting any_errors_fatal on a task is no longer supported. This should be set at the play level only.
* Bare variables in the `environment` dictionary (for plays/tasks/etc.) are no longer supported. Variables specified there should use the full variable syntax: {{foo}}.
* Bare variables in the `environment` dictionary (for plays/tasks/etc.) are no longer supported. Variables specified there should use the full variable syntax: '{{foo}}'.
* Tags (or any directive) should no longer be specified with other parameters in a task include. Instead, they should be specified as an option on the task.
For example::
- include: foo.yml tags=a,b,c
- include_tasks: foo.yml tags=a,b,c
Should be::
- include: foo.yml
- include_tasks: foo.yml
tags: [a, b, c]
* The first_available_file option on tasks has been deprecated. Users should use the with_first_found option or lookup (first_found, …) plugin.
* The first_available_file option on tasks has been deprecated. Users should use the with_first_found option or lookup ('first_found', …) plugin.
Other caveats
@ -171,7 +171,7 @@ Here are some corner cases encountered when updating. These are mostly caused by
with_items: myvar_{{rest_of_name}}
This worked 'by accident' as the errors were retemplated and ended up resolving the variable, it was never intended as valid syntax and now properly returns an error, use the following instead.::
This worked 'by accident' as the errors were retemplated and ended up resolving the variable, it was never intended as valid syntax and now properly returns an error, use the following instead::
hostvars[inventory_hostname]['myvar_' + rest_of_name]
@ -287,7 +287,7 @@ Since the ansible-2.0 plugin system is more advanced, it is easier to adapt your
You may find the following tips useful:
* Check whether the ansible-2.0 class(es) are available and if they are missing (ansible-1.9.x) mimic them with the needed methods (e.g. ``__init__``)
* Check whether the ansible-2.0 class(es) are available and if they are missing (ansible-1.9.x) mimic them with the needed methods (e.g. ``__init__``).
* When ansible-2.0 python modules are imported, and they fail (ansible-1.9.x), catch the ``ImportError`` exception and perform the equivalent imports for ansible-1.9.x. With possible translations (e.g. importing specific methods).
@ -297,7 +297,7 @@ You may find the following tips useful:
* When doing plugin development, it is very useful to have the ``warning()`` method during development, but it is also important to emit warnings for deadends (cases that you expect should never be triggered) or corner cases (e.g. cases where you expect misconfigurations).
* It helps to look at other plugins in ansible-1.9.x and ansible-2.0 to understand how the API works and what modules, classes and methods are available.
* It helps to look at other plugins in ansible-1.9.x and ansible-2.0 to understand how the API works and what modules, classes, and methods are available.
Lookup plugins

View file

@ -219,28 +219,6 @@ to connect to network devices, network modules now support the use of
``ProxyCommand``.
To use ``ProxyCommand`` configure the proxy settings in the Ansible inventory
file to specify the proxy host.
.. code-block:: ini
[nxos]
nxos01
nxos02
[nxos:vars]
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -q bastion01"'
With the configuration above, simply build and run the playbook as normal with
no additional changes necessary. The network module will now connect to the
network device by first connecting to the host specified in
``ansible_ssh_common_args`` which is ``bastion01`` in the above example.
.. notes: Using ``ProxyCommand`` with passwords via variables
It is a feature that SSH doesn't support providing passwords via environment variables.
This is done to prevent secrets from leaking out, for example in ``ps`` output.
We recommend using SSH Keys, and if needed and ssh-agent, rather than passwords, where ever possible.
file to specify the proxy host via ``ansible_ssh_common_args``.
For details on how to do this see the :ref:`network proxy guide <network_delegate_to_vs_ProxyCommand>`.

View file

@ -0,0 +1,224 @@
.. _porting_2.4_guide:
*************************
Ansible 2.4 Porting Guide
*************************
This section discusses the behavioral changes between Ansible 2.3 and Ansible 2.4.
It is intended to assist in updating your playbooks, plugins and other parts of your Ansible infrastructure so they will work with this version of Ansible.
We suggest you read this page along with `Ansible Changelog <https://github.com/ansible/ansible/blob/stable-2.4/CHANGELOG.md#2.4>`_ to understand what updates you may need to make.
This document is part of a collection on porting. The complete list of porting guides can be found at :ref:`porting guides <porting_guides>`.
.. contents:: Topics
Python version
==============
Ansible will not support Python 2.4 or 2.5 on the target hosts anymore. Going forward, Python 2.6+ will be required on targets, as already is the case on the controller.
Inventory
=========
Inventory has been refactored to be implemented via plugins and now allows for multiple sources. This change is mostly transparent to users.
One exception is the ``inventory_dir``, which is now a host variable; previously it could only have one value so it was set globally.
This means you can no longer use it early in plays to determine ``hosts:`` or similar keywords.
This also changes the behaviour of ``add_hosts`` and the implicit localhost;
because they no longer automatically inherit the global value, they default to ``None``. See the module documentation for more information.
The ``inventory_file`` remains unchanged, as it was always host specific.
A bug was fixed with the inventory path/directory, which was defaulting to the current working directory. This caused ``group_vars`` and ``host_vars`` to be picked up from the current working directory instead of just adjacent to the playbook or inventory directory when a host list (comma separated host names) was provided as inventory.
Initial playbook relative group_vars and host_vars
--------------------------------------------------
In Ansible versions prior to 2.4, the inventory system would maintain the context of the initial playbook that was executed. This allowed successively included playbooks from other directories to inherit group_vars and host_vars placed relative to the top level playbook file.
Due to some behavioral inconsistencies, this functionality will not be included in the new
inventory system starting with Ansible version 2.4.
Similar functionality can still be achieved by using vars_files, include_vars, or group_vars and host_vars placed relative to the inventory file.
Deprecated
==========
Specifying Inventory sources
-----------------------------
Use of ``--inventory-file`` on the command line is now deprecated. Use ``--inventory`` or ``-i``.
The associated ini configuration key, ``hostfile``, and environment variable, :envvar:`ANSIBLE_HOSTS`,
are also deprecated. Replace them with the configuration key ``inventory`` and environment variable :envvar:`ANSIBLE_INVENTORY`.
Use of multiple tags
--------------------
Specifying ``--tags`` (or ``--skip-tags``) multiple times on the command line currently leads to the last one overriding all the previous ones. This behavior is deprecated. In the future, if you specify --tags multiple times the tags will be merged together. From now on, using ``--tags`` multiple times on one command line will emit a deprecation warning. Setting the ``merge_multiple_cli_tags`` option to True in the ``ansible.cfg`` file will enable the new behavior.
In 2.4, the default has change to merge the tags. You can enable the old overwriting behavior via the config option.
In 2.5, multiple ``--tags`` options will be merged with no way to go back to the old behavior.
Other caveats
-------------
No major changes in this version.
Modules
=======
Major changes in popular modules are detailed here
* The :ref:`win_shell <win_shell>` and :ref:`win_command <win_command>` modules now properly preserve quoted arguments in the command-line. Tasks that attempted to work around the issue by adding extra quotes/escaping may need to be reworked to remove the superfluous escaping. See `Issue 23019 <https://github.com/ansible/ansible/issues/23019>`_ for additional detail.
Modules removed
---------------
The following modules no longer exist:
* None
Deprecation notices
-------------------
The following modules will be removed in Ansible 2.8. Please update update your playbooks accordingly.
* :ref:`azure <azure>`, use :ref:`azure_rm_virtualmachine <azure_rm_virtualmachine>`, which uses the new Resource Manager SDK.
* :ref:`win_msi <win_msi>`, use :ref:`win_package <win_package>` instead
Noteworthy module changes
-------------------------
* The :ref:`win_get_url <win_get_url>` module has the dictionary ``win_get_url`` in its results deprecated, its content is now also available directly in the resulting output, like other modules. This dictionary will be removed in Ansible 2.8.
* The :ref:`win_unzip <win_unzip>` module no longer includes the dictionary ``win_unzip`` in its results; the contents are now included directly in the resulting output, like other modules.
* The :ref:`win_package <win_package>` module return values ``exit_code`` and ``restart_required`` have been deprecated in favour of ``rc`` and ``reboot_required`` respectively. The deprecated return values will be removed in Ansible 2.6.
Plugins
=======
A new way to configure and document plugins has been introduced. This does not require changes to existing setups but developers should start adapting to the new infrastructure now. More details will be available in the developer documentation for each plugin type.
Vars plugin changes
-------------------
There have been many changes to the implementation of vars plugins, but both users and developers should not need to change anything to keep current setups working. Developers should consider changing their plugins take advantage of new features.
The most notable difference to users is that vars plugins now get invoked on demand instead of at inventory build time. This should make them more efficient for large inventories, especially when using a subset of the hosts.
.. note::
- This also creates a difference with group/host_vars when using them adjacent to playbooks. Before, the 'first' playbook loaded determined the variables; now the 'current' playbook does. We are looking to fix this soon, since 'all playbooks' in the path should be considered for variable loading.
- In 2.4.1 we added a toggle to allow you to control this behaviour, 'top' will be the pre 2.4, 'bottom' will use the current playbook hosting the task and 'all' will use them all from top to bottom.
Inventory plugins
-----------------
Developers should start migrating from hardcoded inventory with dynamic inventory scripts to the new Inventory Plugins. The scripts will still work via the ``script`` inventory plugin but Ansible development efforts will now concentrate on writing plugins rather than enhancing existing scripts.
Both users and developers should look into the new plugins because they are intended to alleviate the need for many of the hacks and workarounds found in the dynamic inventory scripts.
Callback plugins
----------------
Users:
* Callbacks are now using the new configuration system. Users should not need to change anything as the old system still works,
but you might see a deprecation notice if any callbacks used are not inheriting from the built in classes. Developers need to update them as stated below.
Developers:
* If your callback does not inherit from ``CallbackBase`` (directly or indirectly via another callback), it will still work, but issue a deprecation notice.
To avoid this and ensure it works in the future change it to inherit from ``callbackBase`` so it has the new options handling methods and properties.
You can also implement the new options handling methods and properties but that won't automatically inherit changes added in the future. You can look at ``CallbackBase`` itself and/or ``AnsiblePlugin`` for details.
* Any callbacks inheriting from other callbacks might need to also be updated to contain the same documented options
as the parent or the options won't be available. This is noted in the developer guide.
Template lookup plugin: Escaping Strings
----------------------------------------
Prior to Ansible 2.4, backslashes in strings passed to the template lookup plugin would be escaped
automatically. In 2.4, users are responsible for escaping backslashes themselves. This change
brings the template lookup plugin inline with the template module so that the same backslash
escaping rules apply to both.
If you have a template lookup like this::
- debug:
msg: '{{ lookup("template", "template.j2") }}'
**OLD** In Ansible 2.3 (and earlier) :file:`template.j2` would look like this:
.. code-block:: jinja
{{ "name surname" | regex_replace("^[^\s]+\s+(.*)", "\1") }}
**NEW** In Ansible 2.4 it should be changed to look like this:
.. code-block:: jinja
{{ "name surname" | regex_replace("^[^\\s]+\\s+(.*)", "\\1") }}
Tests
=====
Tests succeeded/failed
-----------------------
Prior to Ansible version 2.4, a task return code of ``rc`` would override a return code of ``failed``. In version 2.4, both ``rc`` and ``failed`` are used to calculate the state of the task. Because of this, test plugins ``succeeded``/``failed``` have also been changed. This means that overriding a task failure with ``failed_when: no`` will result in ``succeeded``/``failed`` returning ``True``/``False``. For example:
- command: /bin/false
register: result
failed_when: no
- debug:
msg: 'This is printed on 2.3'
when: result|failed
- debug:
msg: 'This is printed on 2.4'
when: result|succeeded
- debug:
msg: 'This is always printed'
when: result.rc != 0
As we can see from the example above, in Ansible 2.3 ``succeeded``/``failed`` only checked the value of ``rc``.
Networking
==========
There have been a number of changes to how Networking Modules operate.
Playbooks should still use ``connection: local``.
Persistent Connection
---------------------
The configuration variables ``connection_retries`` and ``connect_interval`` which were added in Ansible 2.3 are now deprecated. For Ansible 2.4 and later use ``connection_retry_timeout``.
To control timeouts use ``command_timeout`` rather than the previous top level ``timeout`` variable under ``[default]``
See :ref:`Ansible Network debug guide <network_debug_troubleshooting>` for more information.
Configuration
=============
The configuration system has had some major changes. Users should be unaffected except for the following:
* All relative paths defined are relative to the `ansible.cfg` file itself. Previously they varied by setting. The new behavior should be more predictable.
* A new macro ``{{CWD}}`` is available for paths, which will make paths relative to the 'current working directory',
this is unsafe but some users really want to rely on this behaviour.
Developers that were working directly with the previous API should revisit their usage as some methods (for example, ``get_config``) were kept for backwards compatibility but will warn users that the function has been deprecated.
The new configuration has been designed to minimize the need for code changes in core for new plugins. The plugins just need to document their settings and the configuration system will use the documentation to provide what they need. This is still a work in progress; currently only 'callback' and 'connection' plugins support this. More details will be added to the specific plugin developer guides.

View file

@ -4,7 +4,7 @@ Release and maintenance
.. contents:: Topics
:local:
.. _schedule:
.. _release_cycle:
Release cycle
`````````````
@ -13,15 +13,18 @@ Ansible is developed and released on a flexible 4 months release cycle.
This cycle can be extended in order to allow for larger changes to be properly
implemented and tested before a new release is made available.
Ansible supports the two most recent major stable releases.
For more information, read about the
`development and stable version maintenance workflow`_.
Ansible has a graduated support structure that extends to three major releases.
For more information, read about the `development and stable version maintenance workflow`_ or see
the chart in :ref:`schedule` for the degrees to which current releases are supported.
.. note:: Support for three major releases began with Ansible-2.4. Ansible-2.3 and older versions
are only supported for two releases.
If you are using a release of Ansible that is no longer supported, we strongly
encourage you to upgrade as soon as possible in order to benefit from the
latest features and security fixes.
Older unsupported versions of Ansible can contain unfixed security
Older, unsupported versions of Ansible can contain unfixed security
vulnerabilities (*CVE*).
You can refer to the `porting guide`_ for tips on updating your Ansible
@ -29,28 +32,33 @@ playbooks to run on newer versions.
.. _porting guide: https://docs.ansible.com/ansible/porting_guide_2.0.html
.. _release_schedule:
Release status
``````````````
+-----------------+----------------------------+----------------------------------------+
| Ansible release | Latest version | Status |
+=================+============================+========================================+
| devel | `2.4`_ (unreleased, trunk) | In development |
+-----------------+----------------------------+----------------------------------------+
| 2.3 | `2.3.2`_ (2017-08-08) | Supported (bug **and** security fixes) |
+-----------------+----------------------------+----------------------------------------+
| 2.2   | `2.2.3`_ (2017-05-09) | Supported (**only** security fixes) |
+-----------------+----------------------------+----------------------------------------+
| 2.1 | `2.1.6`_ (2017-06-01) | Unsupported (end of life) |
+-----------------+----------------------------+----------------------------------------+
| 2.0 | `2.0.2`_ (2016-04-19) | Unsupported (end of life) |
+-----------------+----------------------------+----------------------------------------+
| 1.9 | `1.9.6`_ (2016-04-15) | Unsupported (end of life) |
+-----------------+----------------------------+----------------------------------------+
| <1.9 | n/a | Unsupported (end of life) |
+-----------------+----------------------------+----------------------------------------+
=============== ========================== =================================================
Ansible Release Latest Version Status
=============== ========================== =================================================
devel `2.6` (unreleased, trunk) In development
2.5 `2.5.5`_ (2018-06-14) Supported (security **and** general bug fixes)
2.4 `2.4.6`_ (2018-07-05) Supported (security **and** critical bug fixes)
2.3 `2.3.2`_ (2017-08-08) Unsupported (end of life)
2.2 `2.2.3`_ (2017-05-09) Unsupported (end of life)
2.1 `2.1.6`_ (2017-06-01) Unsupported (end of life)
2.0 `2.0.2`_ (2016-04-19) Unsupported (end of life)
1.9 `1.9.6`_ (2016-04-15) Unsupported (end of life)
<1.9 n/a Unsupported (end of life)
=============== ========================== =================================================
.. _2.4: https://github.com/ansible/ansible/blob/devel/CHANGELOG.md
.. note:: Starting with Ansible-2.4, support lasts for 3 releases. Thus Ansible-2.4 will receive
security and general bug fixes when it is first released, security and critical bug fixes when
2.5 is released, and **only** security fixes once 2.6 is released.
.. Comment: devel used to point here but we're currently revamping our changelog process and have no
link to a static changelog for devel _2.6: https://github.com/ansible/ansible/blob/devel/CHANGELOG.md
.. _2.5.5: https://github.com/ansible/ansible/blob/stable-2.5/changelogs/CHANGELOG-v2.5.rst
.. _2.4.6: https://github.com/ansible/ansible/blob/stable-2.4/CHANGELOG.md
.. _2.3.2: https://github.com/ansible/ansible/blob/stable-2.3/CHANGELOG.md
.. _2.2.3: https://github.com/ansible/ansible/blob/stable-2.2/CHANGELOG.md
.. _2.1.6: https://github.com/ansible/ansible/blob/stable-2.1/CHANGELOG.md
@ -60,18 +68,23 @@ Release status
.. _support_life:
.. _methods:
Development and stable version maintenance workflow
```````````````````````````````````````````````````
The Ansible community develops and maintains Ansible on GitHub_.
New modules, plugins, features and bugfixes will always be integrated in what
will become the next major version of Ansible.
This work is tracked on the ``devel`` git branch.
New modules, plugins, features, and bugfixes will always be integrated in what will become the next
major version of Ansible. This work is tracked on the ``devel`` git branch.
Ansible provides bugfixes and security improvements for the most recent major
release while the previous major release will only receive security patches.
This work is tracked on the ``stable-<version>`` git branches.
Ansible provides bugfixes and security improvements for the most recent major release. The previous
major release will only receive fixes for security issues and critical bugs. Ansible only applies
security fixes to releases which are two releases old. This work is tracked on the
``stable-<version>`` git branches.
.. note:: Support for three major releases began with Ansible-2.4. Ansible-2.3 and older versions
are only supported for two releases with the first stage including both security and general bug
fixes while the second stage includes security and critical bug fixes.
The fixes that land in supported stable branches will eventually be released
as a new version when necessary.
@ -85,6 +98,7 @@ releases of Ansible, there can sometimes be exceptions for critical issues.
.. _GitHub: https://github.com/ansible/ansible
.. _changelog: https://github.com/ansible/ansible/blob/devel/CHANGELOG.md
Release candidates
~~~~~~~~~~~~~~~~~~
@ -108,7 +122,7 @@ More release candidates can be tagged as required, so long as there are
bugs that the Ansible core maintainers consider should be fixed before the
final release.
.. _freezing:
.. _release_freezing:
Feature freeze
~~~~~~~~~~~~~~

View file

@ -95,11 +95,11 @@ Expand module diff support (already in progress in devel)
Other
-----
Things being kicking down the road that we said wed do
Things being kicking down the road that we said we'd do
- NOT remerging core with ansible/ansible this release cycle
Community
---------
- Define the process/ETA for reviewing PRs from community
- Define the process/ETA for reviewing PR's from community
- Publish better docs and how-tos for submitting code/features/fixes

View file

@ -19,7 +19,7 @@ Extras split from Core
----------------------
Lead by Jason M and Jimi-c (Targeting 2.2, could move into 2.3).
Targeted towards the 2.2 release or shortly after, we are planning on splitting Extras out of the “Ansible Core” project.  That means that modules that are shipped with Ansible by default are **only** the modules in ansibl-modules-core.  Ansible extras will become a separate project, managed by the community standard.  Over the next few months were going to have a lot of work to do on getting all of the modules in the right places for this to work.
Targeted towards the 2.2 release or shortly after, we are planning on splitting Extras out of the "Ansible Core" project.  That means that modules that are shipped with Ansible by default are **only** the modules in ansibl-modules-core.  Ansible extras will become a separate project, managed by the community standard.  Over the next few months we're going to have a lot of work to do on getting all of the modules in the right places for this to work.
- Create proposal (Jason or Jimi)
- Review modules for correct location (extras v core)
@ -40,7 +40,7 @@ AWS
---
Lead by Ryan Brown
- Pagination for all AWS modules (generic pagination exists, but isnt used everywhere) (bumped to 2.3)
- Pagination for all AWS modules (generic pagination exists, but isn't used everywhere) (bumped to 2.3)
- Refactoring ec2.py to be more digestible (bumped to 2.3)
- Fix inconsistencies with different authentication methods (STS, environment creds, ~/.aws/credentials) (done)
- AWS Lambda modules (lambda_execute done, others pending)
@ -85,7 +85,7 @@ Lead by Matt D
- Feature parity
- PS module API (mirror Python module API where appropriate). Note: We dont necessarily like the current python module API (AnsibleModule is a huge class with many unrelated utility functions.  Maybe we should redesign both at the same time?) (bumped to 2.3+ due to "moving target" uncertainty)
- PS module API (mirror Python module API where appropriate). Note: We don't necessarily like the current python module API (AnsibleModule is a huge class with many unrelated utility functions.  Maybe we should redesign both at the same time?) (bumped to 2.3+ due to "moving target" uncertainty)
- Environment keyword support (done)
- win_shell/win_command (done)
- Async support (done)
@ -117,7 +117,7 @@ Lead by Nate C, Peter S
Role revamp
-----------
- Implement role revamp proposal to give users more control on role/task execution (Brian)
- Implement 'role revamp' proposal to give users more control on role/task execution (Brian)
- **https://github.com/ansible/proposals/blob/master/roles_revamp.md**
@ -125,13 +125,13 @@ Vault
-----
Lead by Jtanner, Adrian
- *Extend transparent vault file usage to other action plugins other than 'copy'(https://github.com/ansible/ansible/issues/7298)*
- *Extend 'transparent vault file usage' to other action plugins other than 'copy'(https://github.com/ansible/ansible/issues/7298)*
**done:** https://github.com/ansible/ansible/pull/16957
- Add per variable vault support (!vault YAML directive, existing PR already) https://github.com/ansible/ansible/issues/13287 https://github.com/ansible/ansible/issues/14721
- Add 'per variable' vault support (!vault YAML directive, existing PR already) https://github.com/ansible/ansible/issues/13287 https://github.com/ansible/ansible/issues/14721
- Add vault/unvault filters https://github.com/ansible/ansible/issues/12087 (deferred to 2.3)
- Add vault support to lookups (likely deferred to 2.3 or until lookup plugins are revamped)
- Allow for multiple vault secrets https://github.com/ansible/ansible/issues/13243
- Config option to turn unvaulting failures into warnings https://github.com/ansible/ansible/issues/13244
- Config option to turn 'unvaulting' failures into warnings https://github.com/ansible/ansible/issues/13244
Python3
-------
@ -139,7 +139,7 @@ Lead by Toshio
A note here from Jason M: Getting to complete, tested Python 3 is both
a critical task and one that has so much work and so many moving parts
that we dont expect this to be complete by the 2.2 release.  Toshio will
that we don't expect this to be complete by the 2.2 release.  Toshio will
lead this overall effort.
- Motivation:
@ -173,7 +173,7 @@ lead this overall effort.
- Update: copy of the six library (v1.4.1 for python2.4 compat) and unicode helpers are here (ansible.module_utils._text.{to_bytes,to_text,to_native})
- A few basic modules ported to python3
- Stat module best example module since its essential.
- Stat module best example module since it's essential.
- Update:
- A handful of modules like stat have been line-by-line ported. They should work reliably with few python3-specific bugs. All but three integration tests pass which means that most essential modules are working to some extent on Python3.
@ -186,7 +186,7 @@ lead this overall effort.
- lib/ansible/* and all modules now compile under Python-3.5
- Side work to do:
- Figure out best ways to run unit-tests on modules.  Start unit-testing modules.  This is going to become important so we dont regress python3 or python2.4 support in modules  (Going to largely punt on this for 2.2.  Matt Clay is working on building us a testing foundation for the first half of 2.2 development so well re-evaluate towards the middle of the dev cycle).
- Figure out best ways to run unit-tests on modules.  Start unit-testing modules.  This is going to become important so we don't regress python3 or python2.4 support in modules  (Going to largely punt on this for 2.2.  Matt Clay is working on building us a testing foundation for the first half of 2.2 development so we'll re-evaluate towards the middle of the dev cycle).
- More unit tests of module_utils
- More integration tests. Currently integration tests are the best way to test ansible modules so we have to rely on those.
@ -202,7 +202,7 @@ Infrastructure Buildout and Changes
-----------------------------------
Lead by Matt Clay
Another note from Jason M: A lot of this work is to ease the burden of CI, CI performance, increase our testing coverage and all of that sort of thing.  Its not necessarily feature work, but its \*\*critical\*\* to growing our product and our ability to get community changes in more securely and quickly.
Another note from Jason M: A lot of this work is to ease the burden of CI, CI performance, increase our testing coverage and all of that sort of thing.  It's not necessarily feature work, but it's \*\*critical\*\* to growing our product and our ability to get community changes in more securely and quickly.
- **CI Performance**
Reduce time spent waiting on CI for PRs. Combination of optimizing existing Travis setup and offloading work to other services. Will be impacted by available budget.

View file

@ -46,7 +46,7 @@ Lead by nitzmahone
- Become support **(done/experimental)**
- Integrated kerberos ticket management (via ansible_user/ansible_password) **(done)**
- Switch PS input encoding to BOM-less UTF8 **(done)**
- Server 2016 support/testing (now RTMd) **(partial)**
- Server 2016 support/testing (now RTM'd) **(partial)**
- Modularize Windows module_utils (allow N files) **(partial)**
- Declarative argspec for PS / .NET **(bumped to 2.4)**
- Kerberos encryption (via notting, pywinrm/requests_kerberos/pykerberos) **(in progress, available in pywinrm post 2.3 release)**
@ -98,8 +98,8 @@ Python3
- If users report bugs on python3, these should be fixed and will prioritize our work on porting other modules.
- Still have to solve the python3-only and python2-only modules. Thinking of doing this via metadata. Will mean we have to use metadata at the module_common level. Will also mean we dont support py2-only or py3-only old style python modules.
- Note: Most of the currently tested ansible features now run. But theres still a lot of code thats untested.
- Still have to solve the python3-only and python2-only modules. Thinking of doing this via metadata. Will mean we have to use metadata at the module_common level. Will also mean we don't support py2-only or py3-only old style python modules.
- Note: Most of the currently tested ansible features now run. But there's still a lot of code that's untested.
Testing and CI
--------------
@ -145,7 +145,7 @@ Amazon
Lead by ryansb
- Improve ec2.py integration tests **(partial, more to do in 2.4)**
- ELB version 2 **(pushed - needs_revision [PR](https://github.com/ansible/ansible/pull/19491))**
- ELB version 2 **(pushed - needs_revision)** `PR <https://github.com/ansible/ansible/pull/19491>`_
- CloudFormation YAML, cross-stack reference, and roles support **(done)**
- ECS module refactor **(done)**
- AWS module unit testing w/ placebo (boto3 only) **(pushed 2.4)**
@ -157,7 +157,7 @@ Plugin Loader
ansible-ssh
-----------
- Add a ansible-ssh convenience and debugging tool (will slip to 2.4)
- Add a 'ansible-ssh' convenience and debugging tool (will slip to 2.4)
- Tool to invoke an interactive ssh to a host with the same args/env/config that ansible would.
- There are at least three external versions

View file

@ -56,7 +56,7 @@ Inventory
Facts
-----
- Configurable list of fact modules for ``gather_facts`` **(done)**
- Configurable list of 'fact modules' for ``gather_facts`` **(done)**
- Fact gathering policy finer grained **(done)**
- Make ``setup.py``/``facts`` more pluggable **(done)**
- Improve testing of ``setup.py``/``facts.py`` **(done)**
@ -104,8 +104,8 @@ Globalize Callbacks
-------------------
**(pushed out to future release)**
- Make send_callback available to other code that cannot use it.
- Would allow for full formatting of output (see JSON callback)
- Fixes static include display problem
- Would allow for 'full formatting' of output (see JSON callback)
- Fixes static 'include' display problem
Plugins
-------
@ -128,13 +128,13 @@ Runtime Check on Modules for Blacklisting
Disambiguate Includes
---------------------
- Create import_x for static includes (import_task, import_play, import_role)
- Create import_x for 'static includes' (import_task, import_playbook, import_role)
- Any directives are applied to the imported tasks
- Any directives are applied to the 'imported' tasks
- Create include_x for dynamic includes (include_task, include_role)
- Create include_x for 'dynamic includes' (include_task, include_role)
- Any directives apply to the include itself
- Any directives apply to the 'include' itself
Windows
-------

View file

@ -5,7 +5,7 @@ Ansible Vault
New in Ansible 1.5, "Vault" is a feature of ansible that allows keeping sensitive data such as passwords or keys in encrypted files, rather than as plaintext in your playbooks or roles. These vault files can then be distributed or placed in source control.
To enable this feature, a command line tool, :ref:`ansible-vault` is used to edit files, and a command line flag `--ask-vault-pass` or `--vault-password-file` is used. Alternately, you may specify the location of a password file or command Ansible to always prompt for the password in your ansible.cfg file. These options require no command line flag usage.
To enable this feature, a command line tool - :ref:`ansible-vault` - is used to edit files, and a command line flag (:option:`--ask-vault-pass <ansible-playbook --ask-vault-pass>` or :option:`--vault-password-file <ansible-playbook --vault-password-file>`) is used. Alternately, you may specify the location of a password file or command Ansible to always prompt for the password in your ansible.cfg file. These options require no command line flag usage.
For best practices advice, refer to :ref:`best_practices_for_variables_and_vaults`.
@ -14,12 +14,12 @@ For best practices advice, refer to :ref:`best_practices_for_variables_and_vault
What Can Be Encrypted With Vault
````````````````````````````````
The vault feature can encrypt any structured data file used by Ansible. This can include "group_vars/" or "host_vars/" inventory variables, variables loaded by "include_vars" or "vars_files", or variable files passed on the ansible-playbook command line with "-e @file.yml" or "-e @file.json". Role variables and defaults are also included!
The vault feature can encrypt any structured data file used by Ansible. This can include "group_vars/" or "host_vars/" inventory variables, variables loaded by "include_vars" or "vars_files", or variable files passed on the ansible-playbook command line with ``-e @file.yml`` or ``-e @file.json``. Role variables and defaults are also included.
Ansible tasks, handlers, and so on are also data so these can be encrypted with vault as well. To hide the names of variables that you're using, you can encrypt the task files in their entirety. However, that might be a little too much and could annoy your coworkers :)
Ansible tasks, handlers, and so on are also data so these can be encrypted with vault as well. To hide the names of variables that you're using, you can encrypt the task files in their entirety.
The vault feature can also encrypt arbitrary files, even binary files. If a vault-encrypted file is
given as the :ref:`src <src>` argument to the :ref:`copy <copy>`, :ref:`template <template>`,
given as the ``src`` argument to the :ref:`copy <copy>`, :ref:`template <template>`,
:ref:`unarchive <unarchive>`, :ref:`script <script>` or :ref:`assemble <assemble>` modules, the file will be placed at the destination on the target host decrypted (assuming a valid vault password is supplied when running the play).
As of version 2.3, Ansible also supports encrypting single values inside a YAML file, using the `!vault` tag to let YAML and Ansible know it uses special processing. This feature is covered in more details below.
@ -48,7 +48,7 @@ The default cipher is AES (which is shared-secret based).
Editing Encrypted Files
```````````````````````
To edit an encrypted file in place, use the :ref:`ansible-vault edit` command.
To edit an encrypted file in place, use the :ref:`ansible-vault edit <ansible_vault_edit>` command.
This command will decrypt the file to a temporary file and allow you to edit
the file, saving it back when done and removing the temporary file:
@ -78,7 +78,7 @@ Encrypting Unencrypted Files
````````````````````````````
If you have existing files that you wish to encrypt, use
the :ref:`ansible-vault encrypt` command. This command can operate on multiple files at once:
the :ref:`ansible-vault encrypt <ansible_vault_encrypt>` command. This command can operate on multiple files at once:
.. code-block:: bash
@ -91,8 +91,8 @@ Decrypting Encrypted Files
``````````````````````````
If you have existing files that you no longer want to keep encrypted, you can permanently decrypt
them by running the :ref:`ansible-vault decrypt` command. This command will save them unencrypted
to the disk, so be sure you do not want :ref:`ansible-vault edit` instead:
them by running the :ref:`ansible-vault decrypt <ansible_vault_decrypt>` command. This command will save them unencrypted
to the disk, so be sure you do not want :ref:`ansible-vault edit <ansible_vault_edit>` instead:
.. code-block:: bash
@ -106,7 +106,7 @@ Viewing Encrypted Files
*Available since Ansible 1.8*
If you want to view the contents of an encrypted file without editing it, you can use the :ref:`ansible-vault view` command:
If you want to view the contents of an encrypted file without editing it, you can use the :ref:`ansible-vault view <ansible_vault_view>` command:
.. code-block:: bash
@ -118,10 +118,11 @@ If you want to view the contents of an encrypted file without editing it, you ca
Use encrypt_string to create encrypted variables to embed in yaml
`````````````````````````````````````````````````````````````````
The :ref:`ansible-vault encrypt_string` command will encrypt and format a provided string into a format
The :ref:`ansible-vault encrypt_string <ansible_vault_encrypt_string>` command will encrypt and format a provided string into a format
that can be included in :ref:`ansible-playbook` YAML files.
To encrypt a string provided as a cli arg:
.. code-block:: bash
ansible-vault encrypt_string --vault-id a_password_file 'foobar' --name 'the_secret'
@ -224,7 +225,7 @@ Providing Vault Passwords
`````````````````````````
Since Ansible 2.4, the recommended way to provide a vault password from the cli is
to use the :option:`--vault-id` cli option.
to use the :option:`--vault-id <ansible-playbook --vault-id>` cli option.
For example, to use a password store in the text file :file:`/path/to/my/vault-password-file`:
@ -244,7 +245,7 @@ To get the password from a vault password executable script :file:`my-vault-pass
ansible-playbook --vault-id my-vault-password.py
The value for :option:`--vault-id` can specify the type of vault id (prompt, a file path, etc)
The value for :option:`--vault-id <ansible-playbook --vault-id>` can specify the type of vault id (prompt, a file path, etc)
and a label for the vault id ('dev', 'prod', 'cloud', etc)
For example, to use a password file :file:`dev-password` for the vault-id 'dev':
@ -261,33 +262,26 @@ To prompt for the 'dev' vault id:
*Prior to Ansible 2.4*
To be prompted for a vault password, use the :option:`--ask-vault-pass` cli option:
To be prompted for a vault password, use the :option:`--ask-vault-pass <ansible-playbook --vault-id>` cli option:
.. code-block:: bash
ansible-playbook --ask-vault-pass site.yml
To specify a vault password in a text file 'dev-password', use the :option:`--vault-password-file` option:
To specify a vault password in a text file 'dev-password', use the :option:`--vault-password-file <ansible-playbook --vault-password-file>` option:
.. code-block:: bash
ansible-playbook --vault-password-file dev-password site.yml
There is a config option (:ref:`DEFAULT_VAULT_PASSWORD_FILE`) to specify a vault password file to use
without requiring the :option:`--vault-password-file` cli option.
without requiring the :option:`--vault-password-file <ansible-playbook --vault-password-file>` cli option.
via config
:ref:`ANSIBLE_VAULT_PASSWORD_FILE`
:ref:`ANSIBLE_VAULT_IDENTITY_LIST`
via env
TODO
Multiple vault passwords
^^^^^^^^^^^^^^^^^^^^^^^^
Since Ansible 2.4 and later support using multiple vault passwords, :option:`--vault-id` can
Since Ansible 2.4 and later support using multiple vault passwords, :option:`--vault-id <ansible-playbook --vault-id>` can
be provided multiple times.
If multiple vault passwords are provided, by default Ansible will attempt to decrypt vault content
@ -302,7 +296,7 @@ For example, to use a 'dev' password read from a file and to be prompted for the
In the above case, the 'dev' password will be tried first, then the 'prod' password for cases
where Ansible doesn't know which vault id is used to encrypt something.
If the vault content was encrypted using a :option:`--vault-id` option, then the label of the
If the vault content was encrypted using a :option:`--vault-id <ansible-vault --vault-id>` option, then the label of the
vault id is stored with the vault content. When Ansible knows the right vault-id, it will try
the matching vault id's secret first before trying the rest of the vault-ids.
@ -317,17 +311,17 @@ use. For example, instead of requiring the cli option on every use, the (:ref:`D
ansible-playbook --vault-id dev@dev-password --vault-id prod@prompt site.yml
The :option:`--vault-id` can be used in lieu of the :option:`--vault-password-file` or :option:`--ask-vault-pass` options,
The :option:`--vault-id <ansible-playbook --vault-id>` can be used in lieu of the :option:`--vault-password-file <ansible-playbook --vault-password-file>` or :option:`--ask-vault-pass <ansible-playbook --ask-vault-pass>` options,
or it can be used in combination with them.
When using :ref:`ansible-vault` command that encrypt content (:ref:`ansible-vault encrypt`, :ref:`ansible-vault encrypt_string`, etc)
When using :ref:`ansible-vault` commands that encrypt content (:ref:`ansible-vault encrypt <ansible_vault_encrypt>`, :ref:`ansible-vault encrypt_string <ansible_vault_encrypt_string>`, etc)
only one vault-id can be used.
.. note::
Prior to Ansible 2.4, only one vault password could be used in each Ansible run. The
:option:`--vault-id` option is not support prior to Ansible 2.4.
:option:`--vault-id <ansible-playbook --vault-id>` option is not support prior to Ansible 2.4.
.. _speeding_up_vault:

View file

@ -1,3 +1,3 @@
.. note::
Ansible 2.0 has deprecated the “ssh” from ``ansible_ssh_user``, ``ansible_ssh_host``, and ``ansible_ssh_port`` to become ``ansible_user``, ``ansible_host``, and ``ansible_port``. If you are using a version of Ansible prior to 2.0, you should continue using the older style variables (``ansible_ssh_*``). These shorter variables are ignored, without warning, in older versions of Ansible.
Ansible 2.0 has deprecated the "ssh" from ``ansible_ssh_user``, ``ansible_ssh_host``, and ``ansible_ssh_port`` to become ``ansible_user``, ``ansible_host``, and ``ansible_port``. If you are using a version of Ansible prior to 2.0, you should continue using the older style variables (``ansible_ssh_*``). These shorter variables are ignored, without warning, in older versions of Ansible.

139
docs/templates/cli_rst.j2 vendored Normal file
View file

@ -0,0 +1,139 @@
{% set name = cli_name -%}
{% set name_slug = cli_name -%}
.. _{{name}}:
{% set name_len = name|length + 0-%}
{{ '=' * name_len }}
{{name}}
{{ '=' * name_len }}
:strong:`{{short_desc|default('')}}`
.. contents::
:local:
:depth: 2
.. program:: {{cli_name}}
Synopsis
========
.. code-block:: bash
{{ usage|replace('%prog', cli_name) }}
Description
===========
{{ long_desc|default('', True) }}
{% if options %}
Common Options
==============
{% for option in options|sort(attribute='options') %}
.. option:: {% for switch in option['options'] %}{{switch}}{% if option['arg'] %} <{{option['arg']}}>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}
{{ option['desc'] }}
{% endfor %}
{% endif %}
{% if arguments %}
ARGUMENTS
=========
.. program:: {{cli_name}}
{% for arg in arguments %}
.. option:: {{ arg }}
{{ (arguments[arg]|default(' '))}}
{% endfor %}
{% endif %}
{% if actions %}
Actions
=======
{% for action in actions %}
.. program:: {{cli_name}} {{action}}
.. _{{cli_name|replace('-','_')}}_{{action}}:
{{ action}}
{{ '-' * action|length}}
{{ (actions[action]['desc']|default(' '))}}
{% if actions[action]['options'] %}
{% for option in actions[action]['options']|sort %}
.. option:: {% for switch in option['options'] if switch in actions[action]['option_names'] %}{{switch}} {% if option['arg'] %} <{{option['arg']}}>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}
{{ (option['desc']) }}
{% endfor %}
{% endif %}
{% endfor %}
.. program:: {{cli_name}}
{% endif %}
Environment
===========
The following environment variables may be specified.
{% if inventory %}
:envvar:`ANSIBLE_INVENTORY` -- Override the default ansible inventory file
{% endif %}
{% if library %}
:envvar:`ANSIBLE_LIBRARY` -- Override the default ansible module library path
{% endif %}
:envvar:`ANSIBLE_CONFIG` -- Override the default ansible config file
Many more are available for most options in ansible.cfg
Files
=====
{% if inventory %}
:file:`/etc/ansible/hosts` -- Default inventory file
{% endif %}
:file:`/etc/ansible/ansible.cfg` -- Config file, used if present
:file:`~/.ansible.cfg` -- User config file, overrides the default config if present
Author
======
Ansible was originally written by Michael DeHaan.
See the `AUTHORS` file for a complete list of contributors.
Copyright
=========
Copyright © 2017 Red Hat, Inc | Ansible.
Ansible is released under the terms of the GPLv3 License.
See also
========
{% for other in cli_bin_name_list|sort %}:manpage:`{{other}}(1)`, {% endfor %}

View file

@ -6,6 +6,72 @@
{{name}}
{{ '=' * name_len }}
Ansible supports a few ways of providing configuration variables, mainly through environment variables, command line switches and an ini file named ``ansible.cfg``.
Starting at Ansible 2.4 the ``ansible-config`` utility allows users to see all the configuration settings available, their defaults, how to set them and
where their current value comes from. See :doc:ansible-config for more information.
.. _ansible_configuration_settings_locations:
The configuration file
======================
Changes can be made and used in a configuration file which will be searched for in the following order:
* ``ANSIBLE_CONFIG`` (environment variable if set)
* ``ansible.cfg`` (in the current directory)
* ``~/.ansible.cfg`` (in the home directory)
* ``/etc/ansible/ansible.cfg``
Ansible will process the above list and use the first file found, all others are ignored.
.. note::
The configuration file is one variant of an INI format.
Both the hash sign (``#``) and semicolon (``;``) are allowed as
comment markers when the comment starts the line.
However, if the comment is inline with regular values,
only the semicolon is allowed to introduce the comment.
For instance::
# some basic default values...
inventory = /etc/ansible/hosts ; This points to the file that lists your hosts
.. _cfg_in_world_writable_dir:
Avoiding security risks with ``ansible.cfg`` in the current directory
---------------------------------------------------------------------
If Ansible were to load :file:ansible.cfg from a world-writable current working
directory, it would create a serious security risk. Another user could place
their own config file there, designed to make Ansible run malicious code both
locally and remotely, possibly with elevated privileges. For this reason,
Ansible will not automatically load a config file from the current working
directory if the directory is world-writable.
If you depend on using Ansible with a config file in the current working
directory, the best way to avoid this problem is to restrict access to your
Ansible directories to particular user(s) and/or group(s). If your Ansible
directories live on a filesystem which has to emulate Unix permissions, like
Vagrant or Windows Subsystem for Linux (WSL), you may, at first, not know how
you can fix this as ``chmod``, ``chown``, and ``chgrp`` might not work there.
In most of those cases, the correct fix is to modify the mount options of the
filesystem so the files and directories are readable and writable by the users
and groups running Ansible but closed to others. For more details on the
correct settings, see:
* for Vagrant, Jeremy Kendall's `blog post <http://jeremykendall.net/2013/08/09/vagrant-synced-folders-permissions/>`_ covers synced folder permissions.
* for WSL, the `WSL docs <https://docs.microsoft.com/en-us/windows/wsl/wsl-config#set-wsl-launch-settings>`_
and this `Microsoft blog post <https://blogs.msdn.microsoft.com/commandline/2018/01/12/chmod-chown-wsl-improvements/>`_ cover mount options.
If you absolutely depend on having the config live in a world-writable current
working directory, you can explicitly specify the config file via the
:envvar:`ANSIBLE_CONFIG` environment variable. Please take
appropriate steps to mitigate the security concerns above before doing so.
Common Options
==============

View file

@ -9,7 +9,7 @@
{% if category['_modules'] %}
{% for module in category['_modules'] | sort %}
@{ module }@{% if module_info[module]['deprecated'] %} **(D)**{% endif%} - @{ module_info[module]['doc']['short_description'] }@ <@{ module }@_module>
@{ module }@{% if module_info[module]['deprecated'] %} **(D)**{% endif%} -- @{ module_info[module]['doc']['short_description'] }@ <@{ module }@_module>
{% endfor %}
{% endif %}
@ -20,7 +20,7 @@
.. toctree:: :maxdepth: 1
{% for module in info['_modules'] | sort %}
@{ module }@{% if module_info[module]['deprecated'] %} **(D)**{% endif%} - @{ module_info[module]['doc']['short_description'] }@ <@{ module }@_module>
@{ module }@{% if module_info[module]['deprecated'] %} **(D)**{% endif%} -- @{ module_info[module]['doc']['short_description'] }@ <@{ module }@_module>
{% endfor %}
{% endfor %}

42
docs/templates/man.j2 vendored
View file

@ -20,8 +20,17 @@ SYNOPSIS
DESCRIPTION
-----------
*{{name}}* {{ long_desc|default('', True)|wordwrap }}
{{ long_desc|default('', True)|wordwrap }}
{% if options %}
COMMON OPTIONS
--------------
{% for option in options|sort(attribute='options') %}
{% for switch in option['options'] %}*{{switch}}*{% if option['arg'] %} '{{option['arg']}}'{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}::
{{ option['desc'] }}
{% endfor %}
{% endif %}
{% if arguments %}
ARGUMENTS
@ -38,22 +47,19 @@ ARGUMENTS
{% if actions %}
ACTIONS
-------
{% for action in actions %}
{{ action }}
*{{ action }}*::: {{ (actions[action]['desc']|default(' '))|wordwrap}}
{{ (actions[action]|default(' '))|wordwrap}}
{% if actions[action]['options'] %}
{% for option in actions[action]['options']|sort %}
{% for switch in option['options'] if switch in actions[action]['option_names'] %}*{{switch}}*{% if option['arg'] %} '{{option['arg']}}'{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}::
{{ (option['desc']) }}
{% endfor %}
{% endif %}
OPTIONS
-------
{% for option in options|sort(attribute='options') %}
{% for switch in option['options'] %}*{{switch}}* {% if option['arg'] %}'{{option['arg']}}'{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}::
{{ option['desc'] }}
{% endfor %}
{% endif %}
{% if inventory %}
INVENTORY
@ -70,17 +76,18 @@ ENVIRONMENT
The following environment variables may be specified.
{% if inventory %}
ANSIBLE_INVENTORY -- Override the default ansible inventory file
ANSIBLE_INVENTORY -- Override the default ansible inventory sources
{% endif %}
{% if library %}
ANSIBLE_LIBRARY -- Override the default ansible module library path
{% endif %}
ANSIBLE_CONFIG -- Override the default ansible config file
ANSIBLE_CONFIG -- Specify override location for the ansible config file
Many more are available for most options in ansible.cfg
For a full list check https://docs.ansible.com/. or use the `ansible-config` command.
FILES
-----
@ -93,6 +100,9 @@ FILES
~/.ansible.cfg -- User config file, overrides the default config if present
./ansible.cfg -- Local config file (in current working direcotry) assumed to be 'project specific' and overrides the rest if present.
As mentioned above, the ANSIBLE_CONFIG environment variable will override all others.
AUTHOR
------
@ -104,14 +114,14 @@ See the AUTHORS file for a complete list of contributors.
COPYRIGHT
---------
Copyright © 2017 Red Hat, Inc | Ansible.
Ansible is released under the terms of the GPLv3 License.
Copyright © 2018 Red Hat, Inc | Ansible.
Ansible is released under the terms of the GPLv3 license.
SEE ALSO
--------
{% for other in cli_list|sort %}{% if other != cli %}*ansible{% if other != 'adhoc' %}-{{other}}{% endif %}*(1){% if not loop.last %}, {% endif %}{% endif %}{% endfor %}
{% for other in cli_list|sort %}{% if other != cli %}*ansible{% if other != 'adhoc' %}-{{other}}{% endif %}*(1){% if not loop.last %}, {% endif %}{% endif %}{% endfor %}
Extensive documentation is available in the documentation site:
<http://docs.ansible.com>.

View file

@ -1,11 +1,16 @@
Directives Glossary
===================
Playbook Keywords
=================
Here we list the common playbook objects and their directives.
Note that not all directives affect the object itself and might just be there to be inherited by other contained objects.
Aliases for the directives are not reflected here, nor are mutable ones, for example `action` in task can be substituted by the name of any module plugin.
These are the keywords available on common playbook objects.
.. note:: Please note:
* Aliases for the directives are not reflected here, nor are mutable one. For example,
:term:`action` in task can be substituted by the name of any Ansible module.
* The keywords do not have ``version_added`` information at this time
* Some keywords set defaults for the objects inside of them rather than for the objects
themselves
Be aware that this reflects the 'current development branch' and that the keywords do not have 'version_added' information.
.. contents::
:local:
@ -15,8 +20,11 @@ Be aware that this reflects the 'current development branch' and that the keywor
{{ name }}
{{ '-' * name|length }}
.. glossary::
{% for attribute in oblist[name]|sort %}
- **{{ attribute }}:** {{ oblist[name][attribute] }}
{% endfor %}
{{ attribute }}
{{ oblist[name][attribute] |indent(8) }}
{% endfor %}
{% endfor %}

View file

@ -194,7 +194,7 @@ Common return values are documented here :doc:`common_return_values`, the follow
<th class="head">type</th>
<th class="head">sample</th>
</tr>
{% for entry in returndocs %}
{% for entry, unusedvalue in returndocs|dictsort %}
<tr>
<td>@{ entry }@</td>

View file

@ -297,10 +297,6 @@
# only update this setting if you know how this works, otherwise it can break module execution
#network_group_modules=['eos', 'nxos', 'ios', 'iosxr', 'junos', 'vyos']
# This keeps facts from polluting the main namespace as variables.
# Setting to True keeps them under the ansible_facts namespace, the default is False
#restrict_facts_namespace: True
# When enabled, this option allows lookups (via variables like {{lookup('foo')}} or when used as
# a loop with `with_foo`) to return data that is not marked "unsafe". This means the data may contain
# jinja2 templating language which will be run through the templating engine.
@ -315,7 +311,7 @@
#enable_plugins = host_list, virtualbox, yaml, constructed
# ignore these extensions when parsing a directory as inventory source
#ignore_extensions = '.pyc', '.pyo', '.swp', '.bak', '~', '.rpm', '.md', '.txt', '~', '.orig', '.ini', '.cfg', '.retry'
#ignore_extensions = .pyc, .pyo, .swp, .bak, ~, .rpm, .md, .txt, ~, .orig, .ini, .cfg, .retry
# ignore files matching these patterns when parsing a directory as inventory source
#ignore_patterns=

View file

@ -52,7 +52,8 @@ Param (
[switch]$SkipNetworkProfileCheck,
$CreateSelfSignedCert = $true,
[switch]$ForceNewSSLCert,
[switch]$EnableCredSSP
[switch]$EnableCredSSP,
[switch]$GlobalHttpFirewallAccess
)
Function Write-Log
@ -71,7 +72,7 @@ Function Write-VerboseLog
Function Write-HostLog
{
$Message = $args[0]
Write-Host $Message
Write-Output $Message
Write-Log $Message
}
@ -121,6 +122,60 @@ Function New-LegacySelfSignedCert
return $parsed_cert.Thumbprint
}
Function Enable-GlobalHttpFirewallAccess
{
Write-Verbose "Forcing global HTTP firewall access"
# this is a fairly naive implementation; could be more sophisticated about rule matching/collapsing
$fw = New-Object -ComObject HNetCfg.FWPolicy2
# try to find/enable the default rule first
$add_rule = $false
$matching_rules = $fw.Rules | ? { $_.Name -eq "Windows Remote Management (HTTP-In)" }
$rule = $null
If ($matching_rules) {
If ($matching_rules -isnot [Array]) {
Write-Verbose "Editing existing single HTTP firewall rule"
$rule = $matching_rules
}
Else {
# try to find one with the All or Public profile first
Write-Verbose "Found multiple existing HTTP firewall rules..."
$rule = $matching_rules | % { $_.Profiles -band 4 }[0]
If (-not $rule -or $rule -is [Array]) {
Write-Verbose "Editing an arbitrary single HTTP firewall rule (multiple existed)"
# oh well, just pick the first one
$rule = $matching_rules[0]
}
}
}
If (-not $rule) {
Write-Verbose "Creating a new HTTP firewall rule"
$rule = New-Object -ComObject HNetCfg.FWRule
$rule.Name = "Windows Remote Management (HTTP-In)"
$rule.Description = "Inbound rule for Windows Remote Management via WS-Management. [TCP 5985]"
$add_rule = $true
}
$rule.Profiles = 0x7FFFFFFF
$rule.Protocol = 6
$rule.LocalPorts = 5985
$rule.RemotePorts = "*"
$rule.LocalAddresses = "*"
$rule.RemoteAddresses = "*"
$rule.Enabled = $true
$rule.Direction = 1
$rule.Action = 1
$rule.Grouping = "Windows Remote Management"
If ($add_rule) {
$fw.Rules.Add($rule)
}
Write-Verbose "HTTP firewall rule $($rule.Name) updated"
}
# Setup error handling.
Trap
{
@ -139,8 +194,8 @@ $adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
# Check to see if we are currently running "as Administrator"
if (-Not $myWindowsPrincipal.IsInRole($adminRole))
{
Write-Host "ERROR: You need elevated Administrator privileges in order to run this script."
Write-Host " Start Windows PowerShell by using the Run as Administrator option."
Write-Output "ERROR: You need elevated Administrator privileges in order to run this script."
Write-Output " Start Windows PowerShell by using the Run as Administrator option."
Exit 2
}
@ -277,6 +332,10 @@ If ($EnableCredSSP)
}
}
If ($GlobalHttpFirewallAccess) {
Enable-GlobalHttpFirewallAccess
}
# Configure firewall to allow WinRM HTTPS connections.
$fwtest1 = netsh advfirewall firewall show rule name="Allow WinRM HTTPS"
$fwtest2 = netsh advfirewall firewall show rule name="Allow WinRM HTTPS" profile=any

View file

@ -3,7 +3,7 @@
from collections import namedtuple
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.inventory import Inventory
from ansible.inventory.manager import InventoryManager
from ansible.parsing.dataloader import DataLoader
from ansible.playbook.play import Play
from ansible.plugins.callback import CallbackBase
@ -33,21 +33,21 @@ def main():
host_list = ['localhost', 'www.example.com', 'www.google.com']
Options = namedtuple('Options', ['connection', 'module_path', 'forks', 'remote_user',
'private_key_file', 'ssh_common_args', 'ssh_extra_args', 'sftp_extra_args',
'scp_extra_args', 'become', 'become_method', 'become_user', 'verbosity', 'check'])
'scp_extra_args', 'become', 'become_method', 'become_user', 'verbosity', 'check',
'diff'])
# initialize needed objects
variable_manager = VariableManager()
loader = DataLoader()
options = Options(connection='smart', module_path='/usr/share/ansible', forks=100,
remote_user=None, private_key_file=None, ssh_common_args=None, ssh_extra_args=None,
sftp_extra_args=None, scp_extra_args=None, become=None, become_method=None,
become_user=None, verbosity=None, check=False)
become_user=None, verbosity=None, check=False, diff=False)
passwords = dict()
# create inventory and pass to var manager
inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list=host_list)
variable_manager.set_inventory(inventory)
inventory = InventoryManager(loader=loader, sources=','.join(host_list))
variable_manager = VariableManager(loader=loader, inventory=inventory)
# create play with tasks
play_source = dict(

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