Commit graph

206 commits

Author SHA1 Message Date
Michael Mayorov
5ee5e4a35c Fix referenced before assignment in sysvinit module
* removed redundant variable initialization

(cherry picked from commit 7538a63f70)
2018-09-25 14:58:30 -07:00
Jonathan
a23dfce2c9 Added default value for when CloudFrontOriginAccessIdentityList is (#44984)
missing.

(cherry picked from commit 93cd050250)
2018-09-25 14:55:15 -07:00
Matt Martz
c3e1269ecb [stable-2.6] Support transfering empty files to target host. Fixes #36725 (#45751)
(cherry picked from commit b6fcbfe)

Co-authored-by: Matt Martz <matt@sivel.net>
2018-09-25 14:51:07 -07:00
Matt Martz
e0e266d070 [stable-2.6] Ensure loop with delegate_to can short circuit the same as without delegate_to. Fixes #45189 (#45231).
(cherry picked from commit 2ac647def8)

Co-authored-by: Matt Martz <matt@sivel.net>
2018-09-25 14:49:52 -07:00
Matt Martz
28632756d6 [stable-2.6] Support empty files with piped transfer_method. Fixes #45426 (#45618)
(cherry picked from commit e68f895)

Co-authored-by: Matt Martz <matt@sivel.net>
2018-09-25 14:43:26 -07:00
Trishna Guha
643726860b [2.6] Add ambiguous command check as the error message is not persistent on nexus devices (#45342)
* Add ambiguous command check as the error message is not persistent on nexus devices (#45337)

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

* changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-09-25 14:41:21 -07:00
Trishna Guha
e459893601 [2.6] Fix python2.6 nothing to repeat nxos terminal plugin bug (#45282)
* fix python26 nxos terminal plugin bug (#45271)

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

* nxos terminal plugin changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-09-25 14:40:35 -07:00
Nilashish Chakraborty
66de502798 Backport 2.6: Return correct version on installed VyOS (#39115) (#45714)
* Return correct version on installed VyOS (#39115)

* Return correct version on installed VyOS

Previously existing regexp will shows only "VyOS" without numeric output of router version.
For example: from  "Version:      VyOS 1.1.6" only VyOS will be written in ansible_net_version variable
For more informative output numeric value should be returned as well

* Fixed unittests

(cherry picked from commit 235b11f681)

* Added changelog
2018-09-25 14:37:21 -07:00
Sloane Hertel
8d7c4140db ec2_group - fix VPC precedence for security group targets (#45787)
Update the dictionary with the preferred values last to get the right order of VPC precedence

Fixes #45782
(cherry picked from commit 8d2df9be52)
2018-09-25 14:35:53 -07:00
Trishna Guha
d1621ba67d [2.6] fix nxos_facts indefinite hang for text based output (#45847)
* fix nxos_facts indefinite hang for text based output (#45845)

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

* add changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-09-25 14:34:50 -07:00
Felix Fontein
1a14c50ab7 Fixing HTTPError case of fetch_url for Python 3 compatibility. (#45628)
* Fixing HTTPError case of fetch_url for Python 3 compatibility.

* Adding unit test.

* PEP8.

* Changelog.
2018-09-25 14:34:05 -07:00
Matt Davis
25f656413d fix premature exit when RG doesn't exist (#46013)
* fixes #45941
* corrects regression introduced by #26104; when the resource group doesn't exist, the module exits prematurely with an error instead of creating it.

(cherry picked from commit 3b52d968e6)
2018-09-25 14:19:31 -07:00
Matt Martz
268beeb9f9 [stable-2.6] Support nested JSON decoding in AnsibleJSONDecoder (#45924)
* Support nested JSON decoding in AnsibleJSONDecoder

* Add tests for vault portion of AnsibleJSONDecoder
(cherry picked from commit c0915e2)

Co-authored-by: Matt Martz <matt@sivel.net>
2018-09-25 14:15:44 -07:00
Matt Martz
47f3f4ebe3 [stable-2.6] Fix issues with PLUGIN_FILTERS_CFG config handling (#45994)
* Ensure that the value of PLUGIN_FILTERS_CFG is treated as type=path, and that we use the standard section of 'defaults' instead of 'default'

* deprecate the default section

* Don't add version_added for the corrected section
(cherry picked from commit 172137c)

Co-authored-by: Matt Martz <matt@sivel.net>
2018-09-25 14:14:34 -07:00
Jordan Borean
cd8208a4aa win_say - fix up syntax and test issues (#45450)
(cherry picked from commit c9c141fb6a)
2018-09-25 14:07:37 -07:00
Jordan Borean
948ef78c28 win_group_membership - fix random issue with CI on 2012 R2 (#45462)
(cherry picked from commit 3371a779b6)
2018-09-25 14:05:48 -07:00
Jordan Borean
67f3c27a3b powershell - fix for ANSIBLE_KEEP_REMOTE_FILES on older Pythons (#45942)
(cherry picked from commit ce515a626c)
2018-09-25 14:05:13 -07:00
Jordan Borean
0b39c66db7 powershell: do not quote join_path result to reflect ShellBase join_path (#45944)
(cherry picked from commit 198423d6fb)
2018-09-25 14:04:20 -07:00
Jordan Borean
1eae95d919 winrm: add further conditional to using pexect for kerb auth (#45952)
(cherry picked from commit d6251e5b27)
2018-09-25 13:57:44 -07:00
Matt Clay
04353f3a98 New release v2.6.4 2018-09-06 14:50:53 -07:00
Felix Fontein
55dbf27362 [2.6] docker_container: fix working_dir (#44522)
* docker_container: fix working_dir (#42857)

WorkingDir should be read from Config instead of HostConfig, check
https://docs.docker.com/engine/api/v1.37/#operation/ContainerInspect

* Adding changelog entry.
2018-09-04 21:21:36 -07:00
Ganesh Nalawade
04296f4230 Fix ignore diff lines issue for lines in ios, eos, nxos (#43889)
* Fix ignore diff lines issue in ios_config

*  Pass `diff_ignore_lines` while creating
   candidate and running configuration object

* Add fix for other platforms

* Fix ignore limes for block

* Update changelog
2018-09-04 15:59:37 -07:00
Trishna Guha
7b840f3fe5 Pick 2.6 nxos bugfixes (#44105)
* Add md5sum check in nxos_file_copy module (#43423)

* Add md5sum check in nxos_file_copy module

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

* address review comment

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

* nxos_vlan refactor to support non structured output (#43805)

* nxos_vlan refactor to support non structured output

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

* unittest fix

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

* minor fixes

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

* use check_rc

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

* address review comment

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

* remove additional return statement

* address Nate's review

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

* nxos_facts test lldp feature and fix nxapi check_rc (#44104)

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

* nxos bugfix 2.6 changelog

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

* nxos_interface port-channel idempotence fix for mode (#44248)

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

* changelog

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

* check_mode in nxos_static_route module (#44252)

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

* changelog nxos_static_route

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

* nxos_linkagg mode fix (#44294)

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

* changelog nxos_linkagg

* nxos_system idempotence fix (#44752)

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

* nxos_system changelog

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

* use retry_json nxos_banner (#44376)

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

* nxos_banner changelog

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

* fix Python 2.6 regex bug terminal plugin nxos, iosxr (#45135)

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

* terminal plugin changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-09-04 15:56:57 -07:00
Brian Coca
b0678e71a8 fix no log templating (#44506)
* fix tempating issues with no_log and loops (#44468)

* fix tempating issues with no_log and loops

 - task is no log if any item is
 - added test cases

fixes #43294

(cherry picked from commit bda074d34e)

* use play context to avoid bug when jinja2+py3
2018-09-04 15:48:21 -07:00
Monty Taylor
499ddeadd5 Backport package manager detection fixes to stable 2.6 (#44415)
* Fix pkg_mgr_name fact finding for Fedora (#40922)

* Properly handle default package manager vs apt

For distros where apt might be installed but is not the default
package manager for the distro, properly identify the default distro
package manager during fact finding and re-use fact finding from
DistributionFactCollector and instead of reimplementing small
portions of it in PkgMgrFactCollector

Add unit test to always check the apt + Fedora combination to test
the new code.

Fixes #34014

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

* remove q debugging output I accidentally left behind

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

* add os_family to the conditional so we're only hitting that code path when needed

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

* setup for a _check* pattern for general os_family group pkg_mgr checking

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

* use Mock.patch decorator for os.path.exists in TestPkgMgrFactsAptFedora

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

* fix fedora version dnf fact, default pkg_mgr detection per distro family (#43261)

* fix fedora version dnf fact, default pkg_mgr detection per distro family
* loop over possible dnf/yum paths in case there are multiple canonical sources later in life

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

* pkg_mgr: fixed apt_rpm detection (#43769)

Instead of checking the distribution name (which apparently is tricky to find out)
check if /usr/bin/apt-get is managed by RPM.

Fixes #43539

* Ensure that apt is always chosen on debian/ubuntu

One can install alternate packages managers on debuntu machines.
However, doing so doesn't mean you want to suddenly start using them.

Add in a check similar to the fedora yum/dnf check that sets apt as the
pkg_mgr if the ansible_os_family is Debian.
2018-09-04 15:46:28 -07:00
Sumit Jaiswal
752b471d03 To resolve nios_network issue where vendor-encapsulated-options can not have a use_option flag (#44259)
* To resolve nios_network issue where vendor-encapsulated-options can not have a use_option flag  (#43925)

* to resolve 43657

* fix shippable error

(cherry picked from commit 4e5dbb92dc)

* adding changelog
2018-09-04 15:43:06 -07:00
Robson Roberto Souza Peixoto
207974fc7c Add AzureRMStorageAccount StorageV2 kind backport (#44244)
* Add AzureRMStorageAccount StorageV2 kind (#44242)

close 38455

(cherry picked from commit 2796be1132)

* Add changelog to AzureRMStorageAccount StorageV2 kind
2018-09-04 15:42:06 -07:00
Sumit Jaiswal
300aefcad2 To resolve the issue of handling exception for Nios lookup gracefully (#44254)
* to resolve 43705 (#44078)


(cherry picked from commit 6a395d8e24)

* adding changelog for backport

* adding new line
2018-09-04 15:41:03 -07:00
Tom Matthews
b617a85e3e Strip trailing comments from /etc/default/passwd (#43931)
* strip additional comments from /etc/default/passwd

Strip trailling comments from /etc/default/passwd like
MINWEEKS=1 #MINWEEKS=2
MAXWEEKS=12  # MAXWEEKS=8
Which otherwise cause failures with "failed to read /etc/default/passwd: too many values to unpack"

* fix carriage return typo in commit

* yet another typo in commit

* Fix indent problem

* add changelog fragment for PR 43931

(cherry picked from commit 5c1e620504)
2018-09-04 14:51:43 -07:00
Alexander Gubin
2d6ba872ce module_utils_service: Fix glob path of rc.d
Some distribtuions like SUSE has the rc%.d directories under /etc/init.d

Quote of /etc/rc.d.README on SLES11.

"Some people expect the system startup scripts in /etc/rc.d/.
We use a slightly different structure for better LSB compliance."

(cherry picked from commit c7d0e3b1666ff96eb0397bdf8c3bd3d144bbd7b0)
2018-09-04 14:50:39 -07:00
Guilherme Steinmuller
0db6467a84 Fix enable_snat parameter (#44418) (#44448)
* Fix enable_snat parameter (#44418)

Fixes the issue #44285
(cherry picked from commit b7139782cf)

* Fix enable_snat parameter (#44418)

Fixes the issue #44285
(cherry picked from commit b7139782cf)

* Fix enable_snat parameter (#44418)

Fixes the issue #44285
(cherry picked from commit b7139782cf)
2018-09-04 14:49:22 -07:00
Felix Fontein
408ad387d2 [2.6] More consistent Docker unit parsing (#44521)
* More consistent Docker unit parsing (#16748)

* Docker: Convert units for kernel_memory

Other memory arguments already use human_to_bytes to convert the
units.  This change makes the behavior more consistent.

* Update Docker unit parsing documentation

This explains the units more precisely and makes the documentation
more consistent.

This fixes #16526.

* Add changelog entry.
2018-09-04 14:47:09 -07:00
Jordan Borean
b91f5b5871 basic.py: catch ValueError when trying to import hash algorithms (#44551)
* basic.py: catch more Exceptions when trying to import md5 hash algorithms

(cherry picked from commit e07352b9de)
2018-09-04 14:45:11 -07:00
Felix Fontein
fdc0711c1a [2.6] docker_container: allow arbitrary log_driver (#44563)
* docker_container: allow arbitrary log_driver (#33579)

Docker supports logging plugin (see https://docs.docker.com/engine/admin/logging/plugins)
so it no longer makes sense to limit the log_driver option to a set of
fixed choices.

* Changelog entry.
2018-09-04 14:44:09 -07:00
Sam Doran
5a26560cca Properly un expire account on creation (#44174)
When creating a new account, check to see if the expiration parameter is negative and pass in the appropriate parameter. Since the negative integer passed into expires is converted to time.struct_time which in turn gets converted to a formatted time string when passed to the underlying command, a -1 or large negative number would result in passing a date before 1970-01-01 to the underlying command.

This had the opposite effect of creating an account with no expiration account resulting in a newly created account that was already expired, or just throwing an error on certain systems.

(cherry picked from commit df335d91b0)
2018-09-04 14:42:26 -07:00
Sam Doran
fc88c13363 Pass path to GalaxyRole object (#43051)
This will list all roles in all paths in roles_path rather than just the first path in roles_path.

(cherry picked from commit 05fff27415)
2018-09-04 14:41:28 -07:00
Toshio Kuratomi
2ee3786d9d [stable-2.6] 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-09-04 14:40:04 -07:00
Daniel-Sanchez-Fabregas
9e34ba0a7e Fix win_domain_computer error when empty description (#44627)
* Fix win_domain_computer

 Fixes #43653

- Change descrtiption parameter default to null.
  When reading an empty description from AD, powershell returns a null.
- Convert after and before diff keys to ordered hashes.
  Unordered state descriptions make --diff report equal values as
  changes.

(cherry picked from commit f58365698599e92b9fc5fd7f643d2c10f1eeafab)

* Add changelog
2018-09-04 14:39:06 -07:00
Daniel-Sanchez-Fabregas
67e880dd82 Backport/2.6/44500 Module win_domain_computer fix delete computer with child (#44707)
* Module win_domain_computer fix delete computer with child

(cherry picked from commit bbecdbc042c6ab6cd158abd8302dca308cf39153)

* add changelog fragment

(cherry picked from commit b6af40a1cc7a0796cdbe96ebfc78b2ad501c0fdb)
2018-09-04 14:29:40 -07:00
Rafael
f7f6d47c7e Backport/2.6/44568 (#44728)
* fixes parameters via environment variables, issue #44163

(cherry picked from commit 2c84022b200e943af80c89b2214b6192ae3d4991)

* including test case using environment variables as per issue #44163

(cherry picked from commit eaaada25c72de7b03de2c3d63ae882107b277f24)

* including missing environment variable in shared documentation fragement, related to issue #44163

(cherry picked from commit e97d2e7ed151e2633d5cd149d4a7e3b0e3151d41)

* added changelog

* yml fix
2018-09-04 14:28:53 -07:00
Felix Fontein
ae62f4be32 [2.6] docker_container: fix check mode for container creation (#44760)
* docker_container: fix check mode for container creation (#42380)

* Create copy of HostConfig object before adding it to results.

* Create general sanitize function in docker_common. Using it for all return values of docker_container.

* Make Python 2.6 compatible.

* Added changelog.
2018-09-04 14:20:34 -07:00
Dag Wieers
f61d2b1c0c Backport of PR 43464
Fix issue when timeout and state=present (#43464)
2018-09-04 14:13:00 -07:00
Jordan Borean
c86794ace2 win_psexec: fix arg handling when command contains multiple args (#44797)
(cherry picked from commit 9d91607754)
2018-09-04 14:03:09 -07:00
Felix Fontein
0746765628 [2.6] Set Default values correctly for docker variables (#44817)
* Set Default values correctly for docker variables (#42641)

* Set Default values correctly

* Properly documenting environment variables in documentation fragment. (#44812)

* Added changelog.
2018-09-04 14:00:12 -07:00
Matt Martz
309f04b742 [stable-2.6] Don't allow import_tasks to transition to dynamic when file is missing. See #44822 (#44836)
(cherry picked from commit cd2f66f)

Co-authored-by: Matt Martz <matt@sivel.net>
2018-09-04 13:58:29 -07:00
Felix Fontein
893d26e915 [2.6] docker_container: improving idempotency (#44879)
* docker_container: improving idempotency (#44808)

* Only handle cpu_shares, volume_driver, auto_remove as in _host_config().

* Don't compare log_options (resp restart_retries) if log_driver (resp restart_policy) is not specified.

* Warn that log_options (resp restart_retries) is ignored if log_driver (resp restart_policy) is not specified.

* Added changelog.
2018-09-04 13:54:44 -07:00
Dag Wieers
35829fd3ed Fix support for JSON output when charset is set 2018-09-04 13:51:25 -07:00
Nilashish Chakraborty
0c367e77f0 Fix ios_user issue CP in 2.6 (#45175)
* Fix ios_user issues (#44904)

* Fix ios_user issues

* Modify regex and fix unittests

(cherry picked from commit 0f268e70a1)

* Added changelog
2018-09-04 13:36:57 -07:00
Adam
2b859d218d Backport/2.6/44902 (#44921)
* Update lightsail.py

(cherry picked from commit dc8307a063e38cb5fd5cb0431f0824b0906ef59e)

* correct example code for AWS lightsail

* Move changelog to correct location

* Update CHANGELOG-v2.6.rst
2018-08-30 14:40:16 -05:00
Nilashish Chakraborty
02ef320c24 Fix ios_l2_interface vlan bug CP in 2.6 (#44445)
* FIX ISSUE:#43878 when the vlans string have a final comma. (#43879)

(cherry picked from commit 401c45384e)

* Added changelog
2018-08-21 08:28:08 -07:00