Commit graph

18168 commits

Author SHA1 Message Date
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
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
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
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
Brian Coca
09437909e6 remove hosts from removed when rescuing
fixes #31707

(cherry picked from commit 618627febd)
2017-10-26 07:32:33 -07:00
Brian Coca
01110d75ea fix html formatting
(cherry picked from commit c0fc797a06)
2017-10-26 07:32:32 -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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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