Commit graph

178 commits

Author SHA1 Message Date
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
Nilashish Chakraborty
1bcc192580 Fix ios_vlan and ios_l2_interface issues in 2.6 (#44250)
* Fixes ios_l2_interface and ios_vlan not working on certain interface types issue (#43819)

* Fixes #43654 and #43582

* Remove q statement

* Fix shippable errors

* Fix more shippable errors

* Fix unittest

(cherry picked from commit b14f256d41)

* Added Change Logs

* Fixed changelog entry

* Fixed changelog entry - 2
2018-08-21 08:27:33 -07:00
Matt Clay
8a6ebd1e8d New release v2.6.3 2018-08-16 17:47:36 -07:00
Étienne BERSAC
d5e278e471 Fix typos in 2.6 changelog (#44076)
* Fix markdownism in changelog

* Fix typo in vmware remove vm scenario changelog entry
2018-08-14 07:50:06 -07:00
Toshio Kuratomi
dabd81deba [stable-2.6] 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-13 15:26:52 -07:00
Yuwei Zhou
d49240a619 Azure module bugfix backport (#43808)
* Fix nsg cannot add rule with  purge_rules false (#43699)

(cherry picked from commit 88a738b0ba)

* Create azure_securitygroup_fix_adding_rule.yaml

* azure_rm_loadbalancer_facts.py: list() takes at least 2 arguments fix (#29046) (#29050)

(cherry picked from commit d1d08304f9)

* azure_rm_deployment: collect tags from existing Resource Group (#26104)

(cherry picked from commit 6741e98c04)

* add change log
2018-08-13 15:22:00 -07:00
Matt Martz
1b2c691980 [2.6] Fix invocation output. Fixes #43447 (#43542) (#43646)
* [2.6] Fix invocation output. Fixes #43447 (#43542)
(cherry picked from commit 4094b01)

Co-authored-by: Matt Martz <matt@sivel.net>

* Add changelog for #43542
2018-08-13 14:21:33 -07:00
Yanis Guenane
1b2d7571a7 Backport/2.6/40872 (#43396)
* Convert valid_date to bytes for conversion (#40872)

Fixes: #40523

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit b310b278be)

* 40872: Add fragment changelog
2018-08-13 13:35:49 -07:00
Jiri Tyr
7e835bf60a Fix for creation and removal of swap record in fstab (fixes #42706, #31437 and #30090) (#42837) 2018-08-13 13:34:26 -07:00
Brian Coca
c687b1b874 nicer error message on multiprocessing fail
fixes #43090

(cherry picked from commit 21fc6a0c38)
2018-08-13 13:31:16 -07:00
Shuang Wang
f33ec9fc0a fix issue [ get_url does not change mode when checksum matches ] (#43342)
* fix  #29614

* add change log for #43342

* Cleanup tests and add tests for this scenario


Co-authored-by: ptux
(cherry picked from commit 68683b4c73)
2018-08-13 13:30:09 -07:00
Aurélien Grimal
41b88cc279 Fix bug #32437 (#38166)
(cherry picked from commit 71952a0aad)
2018-08-13 13:27:39 -07:00
Abhijeet Kasurde
bc3db437e8 VMware: handle pnic in proxyswitch
Fixes: #42943

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

(cherry picked from commit f2640d3394)
2018-08-13 13:26:12 -07:00
Jordan Borean
53a96e36b9 win_domain modules: ensure Netlogon service is still running after promotion (#43703)
(cherry picked from commit 7b1cc11685)
2018-08-13 13:22:00 -07:00
Toshio Kuratomi
a0061e72fa [stable-2.6] Fix the local and ssh plugins for a cornercase retrying a syscall
The bundled selectors library which is used by the local and ssh
connection plugins had a bug which caused a traceback in a cornercase.
If selectors were in use and a syscall was interrupted, selectors would
attempt to restart the syscall after the interrupt was processed.  if
the attempt determined that the timeout for running the syscall had
already expired, the code attempted to raise OSError.  The raise was
using a Python3-ism and needed to be ported to work on Python2.

Fixes #41630
(cherry picked from commit e2e44f8)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2018-08-13 13:19:53 -07:00
Sam Doran
4cbf048996 Only template values in vars_prompt rather than all vars (#39304)
This allows the use of variables in vars_prompt fields but allows variables entered in the prompt to affect play vars rather than throwing an undefined error.

Add tests for vars_prompt

(cherry picked from commit 6d38167d49)
2018-08-13 13:18:30 -07:00
Sumit Jaiswal
3caa736403 Resolves bug where existing host_record was deleted when existing record name is used with different IP (#44088)
* Resolves bug where existing host_record was deleted when existing record name is used with different IP (#43235)

* resolves bug 42937

* resolves integration test failure

* resolves integration test failure

* resolves integration test failure

(cherry picked from commit fd4e774cec)

* changelogs
2018-08-13 13:17:17 -07:00
Deepak Agrawal
9794e5b610 openvswitch_db : Handle column value conversion and idempotency in no_key case (#43914)
* openvswitch_db : Handle column value conversion and idempotency in no_key case (#43869)

* change column value to string. handle idempotency in no key case

* fix unit test failures in baseline

(cherry picked from commit 8eaebf86b6)

* change column value to string. handle idempotency in no key case
2018-08-10 17:07:01 -07:00
Pilou
516ed4d7bc [stable-2.6] Fix 2 issues in sysvinit module (backport/2.6/42786) (#43831)
* Fix 2 issues in sysvinit module (#42786)

* Do not compare result to unset parameter in sysvinit module

* Fix misformed command in sysvinit module

* Small None-comparison style fix in sysvinit module

(cherry picked from commit f26272a492)

* Update changelog
2018-08-08 09:53:28 -07:00
John R Barker
fc21507a30 Update openstack inventory script to keep basic functionality Backport/2.6/43432 (#43465)
* Update openstack inventory script to keep basic functionality (#43432)

re-applies commit 6667ec4474 which
fixed the plugin to the script so that it will work with current
ansible-inventory.

Also redirect stdout before dumping the ouptput, because not doing
so will cause JSON parse errors in some cases.
(cherry picked from commit fa45c44026)

* fixed the plugin to the script so that it will work with current
2018-07-31 08:28:28 -07:00
Matt Clay
c997811f45 New release v2.6.2 2018-07-27 16:18:51 -07:00
Ganesh Nalawade
aee1d42fe7 Correcting conditionals looping (#43331) (#43346)
* Correcting conditionals looping (#43331)

Empty conditionals would not break out of the loop, causing every command to be run for the same number of times as retries is defined (10 by default)

(cherry picked from commit e215f842ba)

* Update changelog
2018-07-27 08:06:15 -07:00
Brian Coca
460183ce47 Error on empty group/host name (#42584)
* error on false host/group name

(cherry picked from commit 12a8363fae)
2018-07-27 08:03:14 -07:00
Artem Goncharov
0aa5d8ed45 fixes #42042
do not create group with region name if it is not given
Backport https://github.com/ansible/ansible/pull/42939

(cherry picked from commit d3f53b4b9f6167c359dae1069cb71eb10d00afc0)
2018-07-27 08:02:25 -07:00
Toshio Kuratomi
b0a4627975 [stable-2.6] ensure 'text' source assumptions (#42522) (#43341)
* [stable-2.6] ensure 'text' source assumptions (#42522)

* ensure 'text' source assumptions.
(cherry picked from commit 937e710485)

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>

* Remove piece of bugfix that depends on newer feature
2018-07-26 21:54:08 -07:00
Matt Clay
bc49055f28 Revert "[stable-2.6] ensure 'text' source assumptions (#42522)"
This reverts commit c0e7f890fb.
2018-07-26 20:15:12 -07:00
Trishna Guha
171c6fcf4d nxos_facts module and nxos cliconf fix stable-2.6 (#43180)
* Refactor nxos cliconf get_device_info and add requirements for JSON structured output support in nxos_facts module (#42089)

* nxos_facts requires JSON structured output support

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

* refactor get_device_info for legacy devices

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

* update additional logic

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

* fix regex cliconf nxos (#42288)

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

* get_device_info nxos zero or more whitespace regex (#43178)

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

* warning message improved (#42969)

(cherry picked from commit bea8e0200c)

* Add text output along with structured output in nxos_facts (#42886)

* nxos_facts to use default output instead of structured output

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

* fix shippable error

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

* nxos_facts refactor

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

* Add structured output back

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

* changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-07-26 17:48:16 -07:00
Sam Doran
2267ba2f05 Only report change when home directory is different on FreeBSD (#42865)
* Only report change when home directory is different

Add tests with home: parameter

Have to skip macOS for now since there is a bug when specifying the home directory path for an existing user that results in a module failure. That needs to be fixed in a separate PR.

(cherry picked from commit 0ca61e9d87)
2018-07-26 17:41:59 -07:00
Hossein Zolfi
e288c23a18 Fix example of nmap plugin (#42925)
(cherry picked from commit e756ef8265)
2018-07-26 17:41:05 -07:00