Commit Graph

500 Commits (3ec469f90424d8ede69e754568a40d8a0779dd0d)

Author SHA1 Message Date
Dario Zanzico 89bcd3ff1e clarify port.mode paramter requiremets, fail if unmet (#47938)
* clarify port.mode paramter requiremets, fail if unmet

* changelog fragment

* shorten too long line

* remove unnecessary indentation

* test version on docker_version for better maintainability

* normalize imports

* changelog fragment: minor_changes -> bugfixes

* rollback e96a7e57dfefd566fa47cf465a759637affd4795

* typo

Co-Authored-By: dariko <dariko@users.noreply.github.com>
6 years ago
Felix Fontein feb60b947c Docker volume fix labels (#48536)
* Add integration test for labels (which fails).

* Changing labels from list to dict.

* Add changelog.
6 years ago
Eric Matysek 880762e07e Fix consistency issue in grafana_dashboard module. (#47459)
* Move check for 'dashboard' key to before the create/update if statement.
* Add changelog fragment for PR #47459
6 years ago
Brian Coca b047591dee fix tagged implicit gathering (#48294)
* fix tagged implicit gathering

 - None is not tHe default anymore, its an empty list

* Update changelogs/fragments/fix_taggged_gather.yml

Co-Authored-By: bcoca <bcoca@users.noreply.github.com>
6 years ago
René Moser 9050c7abeb
vultr_server_facts: add tests and changelog for firewall group fix in #48342 (#48411) 6 years ago
Christopher Gadd f75a84e382 make password locking in user module idempotent (#43671)
* Simplify logic and add FreeBSD & NetBSD

* Remove incorrect flag for lock and unlock on FreeBSD

* Add tests and changelog


Co-authored-by: Chris Gadd <gaddman@email.com>
6 years ago
Simon Dodsley d7975462da Update and correct iSCSI facts collection (#44644)
Co-authored-by: Simon Dodsley <simon@purestorage.com>
6 years ago
Strahinja Kustudic b89b688d52 Fix pip idempotence in check mode
PIP package names must be case insensitive, and must consider hyphens
and underscores to be equivalent
(https://www.python.org/dev/peps/pep-0426/#name), because of this the
module didn't work correctly in check mode. For example if the passed
package name had a different case or an underscore instead of a hyphen
(or the other way around) compared to the installed package, check mode
reported as changed, even though packages were installed. Now the module
ignores case and hyphens/underscores in package names, so check mode
works correctly.
6 years ago
James Cassell c13fa503a1 os_server_facts: support all_projects (#44800)
* os_server_facts: support all_projects

* os_server_facts: openstacksdk expects True or False, not None
6 years ago
Jack Haden-Enneking 15e77ebfe8 ipaddr filter - return a network address when given an address with /32 subnet (#47539)
* fix #17872

* add changelog fragment and enable unit test
6 years ago
Jimmy McCrory d2969884b4 Add run_once as a valid TaskInclude keyword (#48068)
* Add run_once as a valid TaskInclude keyword

* Add changelog fragment

* Add integration test that documents run_once behavior
6 years ago
Stefan Siegel ae7b9ea8cd Always use /proc/sys/kernel/random/boot_id to confirm reboot on Linux (#47017)
* Always use /proc/sys/kernel/random/boot_id to confirm reboot on Linux

/proc/sys/kernel/random/boot_id is available since kernel 2.3.16 and
should be safe to rely on.

The previously used method by checking the system boot time using who -b
turned out to be unreliable: Some systems lacking an RTC report the Unix
epoch as boot time, but the code trying to detect that did't always
work.

Closes #46562

* Change DEFAULT_BOOT_TIME_COMMAND

- change to usinsg /proc by default
- add BOOT_TIME_COMMANDS for BSD, Solaris, and macOS
6 years ago
Daniel Shepherd e212861443 add changelog fragment for changes merged in #47695 (#48305) 6 years ago
Sam Doran 1e3b704ff1
Prevent duplicate entries in rhsm_repository module (#48107)
* Complie regular expressions for better performance

* Skip on empty lines

This fixes a bug where the previous repo would be inserted in the result twice since an empty line did not match any of the conditions that would exit the loop iteration.
6 years ago
Martin Krizek 41dfc5162f user: fix removing the expiry time when it's 0 (#47115)
* user: fix removing the expiry time when it's 0

* Improve tests and add changelog

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
6 years ago
Matt Martz f728f2bff0
Add a new "contains" jinja2 test (#45798)
* Add contains jinja2 test

* backticks
6 years ago
Matt Martz 0d068f1e3a
Support list of dicts with omit. Fixes #45907 (#45923) 6 years ago
Michael Cassaniti a2f3f16930 win_updates: Add post search category matching to support product matching (#45708)
* win_update: Add post search category matching to support product matching

* win_updates: Return categories of each update

* win_updates: Documentation fix-up

* win_updates: Adjusted documentation to reflect regex vs sub-string match of post-cat strings

* win_updates: Sped up post-category checking

* win_updates: Updated documentation to suggest querying post-category strings

* win_updates: Simplified saving and checking post-categories

* fixed some issues and added filtered categories to return value

* win_updates: Moved all category matching to occur after initial search

* win_updates: Adjustments to satisfy PowerShell lint checks

* win_updates: Dropped category validation from action plugin

* win_updates: Documentation updates

* win_updates: Fixed plugin unit tests
6 years ago
Jordan Borean 501acae5ab
Added basic equivalent to PowerShell modules (#44705)
* Added basic equivalent to PowerShell modules

* changes based on latest review

* Added tests

* ignore sanity test due to how tests are set up

* Changes to work with PSCore

* Added documentation and change updated more modules

* Add some speed optimisations to AddType

* fix some issues in the doc changes

* doc changes
6 years ago
Adam Miller 091fb1dc3f yum also parse obsolete package output (#45365)
* yum also parse obsolete package output

This is a rebase of the patch originally proposed in
https://github.com/ansible/ansible/pull/40001 by machacekondra

Fixes #39978

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

* properly parse the obsoletes, provide a new output entry, add changelog

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

* make pep8 happy

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

* remove q debugging output

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Brian Coca 4ec2423a04
make fact gathering obey play tags (#44717)
fixes #44251
6 years ago
Matt Martz 9949629e5a
Add toml inventory plugin (#41593)
* First pass at a toml inventory

* Make EXAMPLES yaml

* Remove unnecessary comment

* Small formatting changes

* Add ansible-inventory option to list as TOML

* TOML inventory improvements, to allow a more simple inventory, specifically related to children

* changelog

* Simplify logic

* Dedupe _expand_hostpattern, making it available to all inventory plugins

* Don't make the TOML inventory dependent on the YAML inventory

* Quote IP address values

* Add more TOML examples

* Further cleanups

* Enable the toml inventory to run by default

* Create toml specific dumper

* 2.8

* Clean up imports

* No toml pygments lexer

* Don't raise an exception early when toml isn't present, and move toml to the end, since it requires an external dep

* Require toml>=0.10.0

* Further clean up of empty data

* Don't require toml>=0.10.0, but prefer it, add code for fallback in older versions

* Ensure we actually pass an encoder to toml.dumps

* Simplify recursive data converter

* Appease tests, since we haven't limited controller testing to 2.7+

* Update docstring for convert_yaml_objects_to_native

* remove outdated catching of AttributeError

* We don't need to catch ImportError when import ansible.plugins.inventory.toml

* Add note about what self.dump_funcs.update is doing

* Address some things

* A little extra comment

* Fix toml availability check

* Don't create an intermediate list

* Require toml file extension

* Add metadata

* Remove TOML docs from intro_inventory to prevent people from getting the wrong idea

* It's in defaults, remove note

* core supported, indicate very clearly that this is preview status
6 years ago
Dave Bendit d7686e1bc0 [docker_network] Add handling for Python booleans in driver_options (#48105)
Fixes #26708
6 years ago
Mariusz Mazur a5c8e952e8 k8s_facts: fix handling of unknown resource types (#47857) 6 years ago
Jordan Borean 8a9d7b3695
win_uri: stop output from mixing with module result (#48140) 6 years ago
Sam Doran 066af3b6ca
User module - allow bang and exclamation in password field without warning (#46498)
* Allow bang and exclamation without warning

Allow the password field to be ! or * without warning when using this feature to create accounts that are locked.

Add documentation  and tests to cover this.

* Use set() rather than braces for Python 2.6
6 years ago
Adam Miller 1c777976c5 Correct yum and dnf autoremove behavior (#47902)
* Correct yum and dnf autoremove behavior

Sanity check args passed to autoremove

Fixes #47184

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

* fix docs

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Matt Martz cb5626cc09
Fix return statement where we short circuit _get_delegated_vars (#48102) 6 years ago
Dag Wieers df6b0b0e9e aci_aptiplp: Support missing policy_group (#48000)
* aci_aptiplp: Support missing policy_group

* Adapt integration tests to fix

* Add changelog fragment

* Fix

Co-Authored-By: dagwieers <dag@wieers.com>
6 years ago
Dag Wieers d1f6ff646a aci_iplpg: Support missing aep (#48001)
* aci_iplpg: Support missing aep
6 years ago
Dag Wieers 591b074e43
aci_switch_leaf_selector: Support missing policy_group (#47992)
* aci_switch_leaf_selector: Support empty policy_group

* Reorganize code

* Adapt integration tests to fix
6 years ago
Abigail Howe e8920a8357 fix boolean logic for overwrite parameter (#47916)
* fix boolean logic for overwrite parameter

* added changelog fragment
6 years ago
Felix Fontein af2b477950 docker_container: fix container removal when auto_remove is used (#48061)
* Fix container removal when auto_remove is used.
6 years ago
Felix Fontein 35809e99bc docker_container: fix ipc_mode and pid_mode idempotency (#47997)
* Fix ipc_mode and pid_mode idempotency when container names are used.

* Add changelog.

* Update pid_mode documentation.
6 years ago
Felix Fontein 3cca4185be docker_container: simplify minimal required version per option handling (#47711)
* Store parsed docker-py / docker API versions in client.

* Began refactoring 'minimal required version' for docker_container options.

* Removing some fake defaults.

* Added changelog.

* Improve tests (check older docker versions).

* Fix comparison. The breaking point is not docker-py 2.0.0, but 1.10.0.

(Verified by testing with these versions.)

* Move docker-py/API version detection to setup_docker.

* Add YAML document starter.

* docker_network requirement for docker-py was bumped to 1.10.0 in #47492.
6 years ago
René Moser 788247583b
vultr: fix for API returned unexpected empty list (#48036)
* vultr: fix for API returned unexpected empty list

* add changelog
6 years ago
Abhijeet Kasurde 487f2f25ce
VMware: Handle exception for no snapshot while cloning (#47924)
Handle exception when there is no snapshot available in virtual machine or template while cloning using vmware_guest.

Fixes: #47920

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Stephan Müller 00bab2d24d [docker_network] add ipv6 support (#47492)
* [docker_network] add ipv6 support

* docker_network: review ipam_options

* docker_network: fix requirements

* docker_network: fix deprecation notice

* docker_network: add minimum docker version change

* docker_network: remove trailing whitespace

* docker_network: revert rename of network_four #discussion_r228707101

* docker_network: refactor IPAM config comparison #discussion_r228707255, #discussion_r228707280

* docker_network: correct spelling of IPv4 and IPv6 #discussion_r228707114, #discussion_r228707138

* docker_network: manually remove networks #discussion_r228709051

* docker_network: refactor enable_ipv6 condition #discussion_r228707317

* docker_network: add mutually_exclusive #discussion_r228707185

* docker_network: fix iprange #discussion_r228709072

* docker_network: add auxiliary addresses in examples and tests

* docker_network: link to docker docs #discussion_r228707018

* docker_network: remove list default #discussion_r228707060, #discussion_r228709091

* docker_network: introduce params syntax for create_network() #discussion_r228709031

* docker_network: beautify code

* docker_network: resolve change requests

* docker_network: add yaml header

* docker_networking: fix get_ip_version

* docker_network: extend CIDR test

* docker_network: use backported unittest2 for python 2.6

* docker_network: migrate unittest to pytest
6 years ago
Akshay Gaikwad 80ca779aa7 Support for device read write limit parameters (#47814)
* Support for device read write limit parameters

* Add following options in docker_container module
  - device_read_bps
  - device_write_bps
  - device_read_iops
  - device_write_iops

Fixes #36831

* test for device_read_iops
* combined test for device_write_bps and device_write_iops
6 years ago
Pilou cfe7c9606c s3_bucket: don't assume anything other than *.amazonaws.com is Walrus (#46745)
For example, 'https://s3.nl-ams.scw.cloud' isn't Walrus.
When Walrus is used, 's3_url' should be a hostname.
6 years ago
Pilou d14f9dc685 s3_bucket: handle not implemented operations (#46746)
Don't fail when policy, requestPayment, tagging or versioning API is not
implemented by the endpoint and if related parameters policy, requester_pays,
tags or versioning are None.
6 years ago
Felix Fontein 65768b996d docker_container: fix paused and add some tests (#47900)
* cleanup is already tested.

* Add test for paused.

* Add recreate and restart tests.

* timeout is a common docker option

* Implement paused and fix paused test.

* Add changelog.

* Improve paused test.
6 years ago
René Moser 242bd512d0
cs_ip_address: fix vpc and network mutually exclusive (#47846)
* cs_ip_address: fix vpc and network mutually exclusive

* add changelog

* streamline docs
6 years ago
Brian Coca d590f10d32 remove redundant md5 hashing 6 years ago
Toshio Kuratomi 9906daa83c Fix password lookup for FIPS
Fixes #47297
6 years ago
James Cassell 8eacaf6a77 command modules: optional stdin_add_newline (#45170)
* stdin_add_newline: allow newline suppression on command modules

* command/shell: test for stdin_add_newline

* changelog for stdin_add_newline
6 years ago
Matt Martz 40e5d2c951 Do not filter out exception, warnings, deprecations on failure when using debug (#47588)
* Do not filter out exception, warnings, deprecations on failure when using debug. Fixes #47576

* Add changelog fragment
6 years ago
Matt Martz fd662c0a63
New v2_runner_on_start callback added (#47684)
* New v2_runner_on_start callback added to indicate the start of execution for a host in a specific task

* Add changelog fragment

* Minor docstring clarification
6 years ago
Martin Krizek 4b8f2c99d2
yum: fix 'package == version' syntax (#47744) 6 years ago
Abhijeet Kasurde b32b4111b2
plugin_filter: check for type error (#46664)
* Parsing plugin filter may raise TypeError, gracefully handle this exception
and let user know about the syntax error in plugin filter file.

* Test for plugin_filtering

Fixes: #46658

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Etienne Perot e217ba6e19 docker_image: Fix up 'changed' event in force mode (#33754)
* docker_image: Fix up 'changed' event in force mode

This is the same as https://github.com/ansible/ansible/pull/19235 except it applies to all image-building modes (building the image locally, loading the image from an archive, or pulling the image), rather than only when pulling the image.

* Use 'dummy' rather than '_' as unused variable name.

* Add changelog fragment for pull request #33754
6 years ago
René Moser 58238375b4 apt: warn users on auto-install dep (#47704)
* apt: warn users on auto-install dep

* add changelog
6 years ago
Ondra Machacek 36b0aed03a ovirt_host_network: Fix type conversion (#47617)
Signed-off-by: Ondra Machacek <omachace@redhat.com>
6 years ago
Dario Zanzico 2162d7d4de Docker swarm service integration tests (#45674)
* integration test for docker_swarm_service

* ensure stack de-initialization

* Set default value for 'configs' parameter to None

Docker-py uses None as a default value for configs.
Using the same default here allows to create services on older docker
setups (docker_api<1.30).

* Set default value for 'update_order' parameter to None

Docker-py uses None as a default value for update_order.
Using the same default here allows to create services on older docker
setups (docker_api<1.29)

* Set default value for 'publish.mode' parameter to None

Docker-py uses None as a default value for publish_mode.
Using the same default here allows to create services on older docker
setups (docker_api<1.32)

* Allow tests to run on older version of docker.

* remove workarounds for old docker versions

* test correct swarm cleanup

* changelog fragment for docker_swarm_service defaults change
6 years ago
Felix Fontein 92d9569bc9 ACME: add support for POST-as-GET if GET fails with 405. (#44988)
* Add support for POST-as-GET if GET fails with 405.

* Bumping ACME test container version to 1.4. This includes letsencrypt/pebble#162 and letsencrypt/pebble#168.

* Also use POST-as-GET for account data retrival.

This is not yet supported by any ACME server (see letsencrypt/pebble#171),
so we fall back to a regular empty update if a 'malformedRequest' error is
returned.

* Using newest ACME test container image.

Includes letsencrypt/pebble#171 and letsencrypt/pebble#172, which make Pebble behave closer to the current specs.

* Remove workaround for old Pebble version.

* Add changelog entry.

* First try POST-as-GET, then fall back to unauthenticated GET.
6 years ago
Felix Fontein b9706e2ff5 docker_container: improve race condition behavior for detach:no, auto_remove:yes behavior (#47712)
* Don't die when get_container is called for container which is terminating during get_container call.

If it terminates between client.containers() and client.inspect_container(),
the module will fail with an error such as
    Error inspecting container: 404 Client Error: Not Found ("No such container: xxx")

* Add changelog.
6 years ago
Abhijeet Kasurde a87a62ba8a
VMware: restore timeout in set_vm_power_state operation (#47723)
'state_change_timeout' parameter was removed, this introduced
regression.

Fixes: #47722

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Matt Martz 3633e21780
Add missing self._supports_async to uri action plugin (#47677)
* Add missing self._supports_async to uri action plugin. Fixes #47660

* Additional changes needed to support async

* Missed a call to execute_module
6 years ago
curry9999 4906be1009 An error occurs if cluster_id is not specified (#47500)
* 	modified:   google/gcp_compute_backend_bucket.py
	modified:   google/gcp_compute_backend_service.py
	modified:   google/gcp_compute_forwarding_rule.py
	modified:   google/gcp_compute_global_forwarding_rule.py
	modified:   google/gcp_compute_image.py
	modified:   google/gcp_compute_instance.py
	modified:   google/gcp_compute_instance_group.py
	modified:   google/gcp_compute_instance_group_manager.py
	modified:   google/gcp_compute_instance_template.py
	modified:   google/gcp_compute_route.py
	modified:   google/gcp_compute_subnetwork.py
	modified:   google/gcp_compute_target_http_proxy.py
	modified:   google/gcp_compute_target_https_proxy.py
	modified:   google/gcp_compute_target_ssl_proxy.py
	modified:   google/gcp_compute_target_tcp_proxy.py
	modified:   google/gcp_compute_url_map.py
	modified:   google/gcp_container_node_pool.py
	modified:   google/gcp_dns_resource_record_set.py
	modified:   google/gcp_pubsub_subscription.py
	modified:   google/gcp_storage_bucket_access_control.py

* 	modified:   lib/ansible/modules/cloud/amazon/aws_ses_identity.py
	modified:   lib/ansible/modules/cloud/amazon/route53_facts.py
	modified:   lib/ansible/modules/cloud/cloudscale/cloudscale_server.py
	modified:   lib/ansible/modules/network/aos/_aos_logical_device.py
	modified:   lib/ansible/modules/network/aos/_aos_rack_type.py
	modified:   lib/ansible/modules/network/aos/_aos_template.py
	modified:   lib/ansible/modules/network/cumulus/nclu.py
	modified:   lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_launch.py
	modified:   lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_wait.py

* An error occurs if cluster_id is not specified

* An error occurs if cluster_id is not specified
6 years ago
Nathaniel Case 6a866a5e10
ios check_rc: Default to sending text of exception, not the whole exception (#47300)
* Default to sending text of exception, not the whole exception
6 years ago
Akshay Gaikwad 20b95adf2b Add Support of healthcheck in docker_container module (#46772)
* Add Support of healthcheck in docker_container module

Fixes #33622
Now container can be started with healthcheck enabled

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Extend docker_container healthcheck (#1)

* Allowing to disable healthcheck.

* Added test for healthcheck.

* Make sure correct types are used.

* Healthcheck needs to be explicitly disabled with test: ['NONE'].

* pep8 fixes

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Fix bug if healthcheck interval is 1 day or more

`timedelta` object has days too and seconds are up to one day.
Therefore use `total_seconds()` to convert time into seconds.

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Add test for healthcheck when healthcheck is not specified

This is to avoid the situation when healthcheck is not specified and
treat this as healthcheck is changed or removed.

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Convert string syntax for healthcheck test to CMD-SHELL

Also add another test case to check idempotency when healthcheck test
is specified as string

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Playbook fails if minimun docker version is not satisfy for healthcheck

This is to make more consistent with other non-supported options.

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>
6 years ago
Dag Wieers 691ff4b9e6 WinRM/PSRP: Ensure shell returns UTF-8 output (#47404)
* WinRM/PSRP: Ensure shell returns UTF-8 output

This PR makes UTF-8 output work in PSRP shells.

* Add win_command and win_shell integration tests

* Fix tests

* more test fixes
6 years ago
Jordan Borean f28b7c7ab1
psrp - fix unicode handling in Python 2 (#47461)
* psrp - fix unicode handling in Python 2

* skip psrp become test when on Server 2008
6 years ago
Adam Miller 079705f8da
dnf properly gpg check local packages based on param (#47455)
* dnf properly gpg check local packages based on param

Fixes #43624

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Adam Miller 0e3e646189
don't restrict disable_excludes choices incorrectly (#47453)
* don't restrict disable_excludes choices incorrectly

Fixes #47085

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Matt Martz f6ecdf0b87
Handle sets differently than lists in wrap_var. Fixes #47372 (#47510) 6 years ago
Matt Martz d5e4f37ca0
Ensure we don't overwrite roles from include/import_role when loading the play (#47512)
* Ensure we don't overwrite roles from include/import_role when loading the play. Fixes #47454

* Add changelog fragment
6 years ago
Will Thames 3a7b4d269c Add changelog for k8s_facts fix 6 years ago
Felix Fontein a11073df9a docker_image: allow to delete image by ID (#47393)
* Allow to delete docker image by ID.

* Added changelog.
6 years ago
Felix Fontein 4ffe3b14d4 docker_container: warn if ipvX_address is used for networks but not supported by docker-py (#47395)
* Only add parameters which are actually used.

* Fail if ipvX_address is used when not supported.

* Added changelog.
6 years ago
Felix Fontein 3afdb28209 docker_container: fix interaction of detach:no with auto_remove:yes (#47396)
* Behave better if auto_remove and output_logs are combined. Warn if output cannot be retrieved because of auto_remove.

* Add tests.

* Added changelog.
6 years ago
Dave Bendit 29b4b36501 Adding "internal" option to "docker_network" module (#35370)
Fixes #27065
6 years ago
Felix Fontein 8ef994fbc5 Fix option change detection / force support for docker_volume. (#47390) 6 years ago
Toshio Kuratomi ccabc2bff5 Revert "[stable-2.7] Handle sets differently than lists in wrap_var. Fixes #47372."
This reverts commit 0e933f76ba.

The tests for this were broken on centos6 because jinja2 does not have
a map filter on that platform.  Tests need to be rewritten
6 years ago
Toshio Kuratomi 210a43ebeb Fix changelog entry for user module CVE fix 6 years ago
Jordan Borean d46d92eed5
Revert "WinRM/PSRP: Fix UTF-8 issue (#46998)" (#47447)
This reverts commit 1bb674034f.
6 years ago
Martin Krizek a0aa53d1a1 user: do not pass ssh_key_passphrase on cmdline
CVE-2018-16837

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
6 years ago
Matt Martz c58de75f38 Handle sets differently than lists in wrap_var. Fixes #47372 6 years ago
Pablo 6497049f2a Fix exception when including tasks from handlers (#47307)
Set _notified_handlers for the task's _uuid that is run as a handler

Fix #47287
6 years ago
Jonathan Oddy 7ba09adee1 Fix AWS EC2 inventory plugin caching of groups (#46961)
* Fix AWS EC2 inventory plugin caching of groups

* Added changelog fragment for aws_ec2 caching fix

* Store the AWS query results

The underlying inventory object contains inventory from other sources,
so caching it as ours would be wrong.
It seems easiest and safest to just cache the boto query results
instead.

* Remove unused functions
6 years ago
Dag Wieers 1bb674034f WinRM/PSRP: Fix UTF-8 issue (#46998)
* WinRM/PSRP: Fix UTF-8 issue

* added changelog fragment
6 years ago
Dag Wieers 6f9c6071e5 psexec: Handle socket errors (Connection timeout) (#47201)
* psexec: Handle socket errors (Connection timeout)

This ensures we get a nicer error message from psexec.

* Add changelog fragment
6 years ago
Daniel Shepherd c67ab296bb pamd: add delete=False to NamedTemporaryFile() (#47281)
* add delete=False to NamedTemporaryFile and remove print statement from module

* add changelog fragment
6 years ago
Pluggi f13091d142 Add runtime option to docker_container module (#47247)
* Add runtime option to docker_container module

Signed-off-by: Antoine Bardoux <abardoux@nvidia.com>

* Add changelog fragment

Signed-off-by: Antoine Bardoux <abardoux@nvidia.com>

* Add idempotency test for docker_container.runtime

Signed-off-by: Antoine Bardoux <abardoux@nvidia.com>
6 years ago
Jordan Borean 013c44484a psexec: better error on import failure (#47327) 6 years ago
Martin Krizek 541255a2d8
Do not strip new lines in native jinja (#46751)
* Do not strip new lines in native jinja

* Add changelog/fragment
6 years ago
Toshio Kuratomi 4d9504e775 Remove runtime usage of pkg_resources.
This should provide a startup time speed boost at the expense of making
it harder to get ansible to use newer versions of packages than are
provided by the platform.
6 years ago
Matt Martz 77d32b8f57
Don't use the task for a cache, return a special cache var (#47243)
* Don't use task to cache loop results, use hostvars. Fixes #47207

* Avoid a race condition, supply _ansible_loop_cache through get_vars directly

* Add tests

* Add changelog fragment

* Remove unnecessary copy

* Remove unnecessary host from _get_delegated_vars signature
6 years ago
Martin Krizek 096717edc5 ansible-galaxy: fix searching with unicode 6 years ago
Dag Wieers 06eabc9783 reboot: Add timeout in error to help troubleshooting (#47216)
* reboot: Add timeout in error to help troubleshooting

So we've been hit by 'Timed out waiting for boot_time check' and it was
unclear what timeout was used for the boot_time check. By adding the
timeout value it is easier to understand the used value, and verify if a
change to the timeout is reflected in the output.

* Add changelog fragment
6 years ago
Toshio Kuratomi bcd6dbcd65 Remove get_exception from the remainder of the modules 6 years ago
Jordan Borean 6666b070a9
openss: fix various test and Python 3 issues (#47188) 6 years ago
Sloane Hertel b808e1bc5c [s3_bucket] Cast tag keys and values to text to match the values returned (#46405)
* Cast tag keys and values to text to match the values returned

* changelog
6 years ago
Brian Coca fce9673ac1 Adoc fixes (#47137)
* removed hardcoded loader/plugins list
* updated a few errors to keep orig object
* fix httpapi/cliconf listing
* ansible-doc fixes
* show undocumented as UNDOCUMENTEd
* added missing undoc
6 years ago
Toshio Kuratomi 61ae6424a3 An earlier optimization of ansible-doc -l caused failures. (#47012)
* An earlier optimization of ansible-doc -l caused failures.

The optimization quickly searches the plugin code for short_description
fields and then uses that in the -l output.  The searching was a bit too
naive and ended up pulling out malformed yaml.  This caused those
plugins to be omitted from the list of plugins of that type with
a warning that their documentation strings were wrong.

This change makes the documentation parser aware that the documentation
string could have a relative indent for all of its fields which makes it
robust in the face of this particular problem.

* Don't search for space after short_description:

Any whitespace would be valid.  In particular newline
6 years ago
Jordan Borean dd46f953f6
postgresql_user: fix test errors on newer Fedora versions (#47166) 6 years ago
Matt Martz 02f4d0a57f
Ensure that an empty literal list with loop skips the task (#47129) 6 years ago
Matt Hoffman acbecd5f23 adds redirect configurations and probes to azure_rm_appgateway (#46607) 6 years ago
Matt Martz c3d5779a41
Use the copied and merged task for calculating task vars in the free strategy. Fixes #47024 (#47060) 6 years ago
Dag Wieers 7cc78c5a04 Update changelog fragment 6 years ago
Dag Wieers a4948d3845 Add changelog snippet 6 years ago
Jonathan Oddy f2dccb90e8 Restore SIGPIPE handler to DFL on POpen
Python sets the SIGPIPE handler to SIG_IGN. On execv() signal handlers are
reset to their defaults, EXCEPT those that are SIG_IGN which are left ignored.
In Python 3 subprocess.popen explicitly resets the SIGPIPE handler to SIG_DFL,
but unfortunately in Python 2.7 it does not. This leads to subprocesses being
executed with SIGPIPE ignored. This is often a problem with bash scripts which
rely on SIGPIPE to terminate commands in a pipe, but can easily be a problem
with other applications.

This implements the Python 3 behaviour for Python 2.7 by using a preexec_fn.
6 years ago
Matt Martz a06a5ded61
Do not use mutable defaults in FieldAttribute, instead allow supplying a callable for defaults of mutable types. Fixes #46824 (#46833) 6 years ago
Brian Coca 9e0c2a658f
better information for user from inventory plugins (#46766)
* better information for user from inventory plugins

 - use foreman as example
6 years ago
Brian Coca 551de8b166 now clog matches code 6 years ago
Brian Coca 3453dace85
use to_text instead of str in async_status (#45990)
* use to_text instead of str in async_status

* used to_native instead as per feedback
6 years ago
Peter Oliver 40fb992a6f Locate prtdiag even when absent from /usr/bin (#44113)
* Locate prtdiag even when absent from /usr/bin

On Solaris 8 hosts, this prevents fact collection from aborting with:

    Argument 'args' to run_command must be list or string

* Lint fix.

* Style: pass /usr/platform/.../sbin as optional path to get_bin_path().
6 years ago
Shuang Wang cd1faca6e0 copy - support recursive copying with remote_src (#43998)
* Allow copy module to work with recursive and remote_src #14131
6 years ago
Thomas Picariello 62d131716b Do not try to encode metadata if it is None (#46739)
* Do not try to encode metadata if it is None

* Add changelog fragment

* Fix fragment missing EOF line
6 years ago
Daniel Jakots 753711cd12 Register missing parameter reboot_timeout (#46585) 6 years ago
Adam Miller c8ed5c29e9 allow update_cache as stand alone operation for yum/dnf (#46183)
* allow update_cache as stand alone operation for yum/dnf

Fixes #40068

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

* make sanity tests happy

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Felix Fontein a74774488d docker_container: add port range and IPv6 support for published_ports (#46596)
* Allow port ranges.

* Adding IPv6 support for published_ports.

* Die when hostname is passed instead of IP address.

* Added changelog.
6 years ago
Felix Fontein 77127d6768 docker_container: allow more mount modes for volumes (#46598)
* Being more strict about volume mount modes.
6 years ago
Felix Fontein c5ea3d058e docker_container: fix problem with published_ports idempotency (#46595)
* Fix comparisons for expected_ports (set vs dict).

* Added changelog.
6 years ago
Felix Fontein 8afe46dc02 docker_container: improve publish all ports functionality (#46594)
* Improve handling of published_ports: all.

* Add changelog.
6 years ago
Simon Liddicott f731e68bca Add chdir support to win_package (#46123)
* Add chdir support to win_package

* Add chdir support to uninstall too.

* Update docs to account for uninstall.

* Correct variable substitution for hashtable.

* added changelog fragment
6 years ago
flowerysong be05069c61 Port the sns module to boto3 (#45634)
* Port sns to boto3

* Exception handling for ARN lookup

* sns: Add integration tests
6 years ago
Felix Fontein a520ca3298 docker_container, docker_image_facts: allow to use image IDs (#46324)
* Allow to specify images by hash for docker_container and docker_image_facts.

* flake8

* More sanity checks.

* Added changelog.

* Added test.

* Make compatible with Python < 3.4.

* Remove out-commented imports.
6 years ago
Felix Fontein 895019c59b docker_container: fix behavior when image is not specified (#46322)
* Don't simply ignore container in present() if image is not specified.

* Use image from existing container for recreation if not specified.

* Added changelog.

* Improve comment.
6 years ago
Sam Doran bcfdc37be0 Add documentation on underlying tools in user module (#46455) 6 years ago
Sam Doran b74279d14c Use proper index value with insertbefore on a one line file (#46071)
Add tests and changelog
6 years ago
newtonne bd849e8fb4 Macports: Add upgrade parameter and replace update_ports with selfupdate (#45049)
* macports: Replace update_ports with selfupdate

- Macports discourages use of `port sync` and recommends using `port
selfupdate` instead.
- Keep `update_cache` and `update_ports` as aliases.
- No longer require the `name` parameter so that `selfupdate` can be
used in a task by itself.

* macports: Add upgrade parameter

- New upgrade parameter which can be used to upgrade all outdated ports.

* Add changelog fragment
6 years ago
Jordan Borean e972287c35 win_exec: refactor PS exec runner (#45334)
* win_exec: refactor PS exec runner

* more changes for PSCore compatibility

* made some changes based on the recent review

* split up module exec scripts for smaller payload

* removed C# module support to focus on just error msg improvement

* cleaned up c# test classifier code
6 years ago
David Baumann c97f2b4c01 Fix callout json plugin show global stats (#43123)
* fix callback Plugin json to support global stat set by set_stats module

* refactor to not break compatiblity, add trailing comma on output dict

* Remove sorted, as it not needed

* refactor, to sivels better code

* clean some code messup

* add changelog fragment

* added missing new line

* fix pep8 stuff
6 years ago
Remo Wenger 83e584577a docker_container: ambiguous parameter "stop_timeout" (#43874)
* docker_container: Honour stop_timeout when creating docker containers (#43814)

* Adjusting description to what actually happens.

See docker-py changelog for 2.7.0: 'APIClient.stop will
no longer override the stop_timeout value present in the
container’s configuration.'

* Add a test whether stop_timeout can be configured for the container.

* Added changelog.

* Integrate with comparisons (by default, ignore stop_timeout value for restarts; will be configurable with PR ansible/ansible#44789).

* Fix config change code and tests (#2)

* Improving wildcard test.
* Using correct config.
6 years ago
Daniel Jakots 2769a4e2cc Add support for OpenBSD (#46147) 6 years ago
Sam Doran 8b1ae30e2e
Use bytes rather than native string for result (#46281)
This prevents a stack trace in Python 3 when the result is an empty file since
the file is open in binary mode and a native string in Python 3 is str,
not bytes.
6 years ago
Sam Doran 77f73f6d2a
Use unicode instead of bytes (#46234)
The stdout and stderr values returned from self._low_level_execute() are text, not bytes. This results in an error in Python 3 since str and bytes cannot be concatenated.

Changing to unicode type allows this to work without error on Python 2 and Python 3.
6 years ago
Felix Fontein 84682464c7 docker_container: allow to configure comparison for existing containers (#44789)
* Added comparison configuration.

* Improving user feedback on specifying a wrong option.

* Avoid bare except.

* Added basic integration tests.

* Adding wildcard support.

* Warn if ignore_image=yes is overridden.

* Added changelog fragment.
6 years ago
Sloane Hertel 9efc3dc761
Fix ec2_group for EC2-Classic accounts (#46242)
* Fix ec2_group for EC2-Classic accounts

* changelog
6 years ago
Jordan Borean 23c94295dc
Revert "powershell - fix for ANSIBLE_KEEP_REMOTE_FILES on older Pythons (#45942)" (#46238)
This reverts commit ce515a626c.
6 years ago
Ryan S. Brown 05e3b5d632 [docs] Add changelog for ec2_asg launch template feature 6 years ago
Jordan Borean d6251e5b27
winrm: add further conditional to using pexect for kerb auth (#45952) 6 years ago
Matt Martz 172137c3ca
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
6 years ago
Matt Martz c0915e2f5a
Support nested JSON decoding in AnsibleJSONDecoder (#45924)
* Support nested JSON decoding in AnsibleJSONDecoder

* Add tests for vault portion of AnsibleJSONDecoder
6 years ago
Felix Fontein 7caf70db42 docker_container: fix various idempotency problems and non-working options (#45905)
* Sorting args.

* Doing comparisons of options with container parameters in a more context-sensitive way.

This prevents unnecessary restarts, or missing restarts (f.ex. if parameters are removed from ``cmd``).

* Make blkio_weight work.

* Fix cap_drop idempotency problem.

* Making groups idempotent if it contains integers.

* Make cpuset_mems work.

* Make dns_opts work.

* Fixing log_opts: docker expects string values, returns error for integer.

* Adding tests from felixfontein/ansible-docker_container-test#2.

* Make uts work.

* Adding changelog entry.

* Forgot option security_opts.

* Fixing typo.

* Explain strict set(dict) comparison a bit more.

* Improving idempotency tests.

* Making dns_servers a list, since the ordering is relevant.

* Making dns_search_domains a list, since the ordering is relevant.

* Improving dns_search_domains/dns_servers.

* Fixing entrypoint test.

* Making sure options are only supported for correct docker-py versions.
6 years ago
Matt Davis 3b52d968e6
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.
6 years ago
Brian Coca a47671aad1 allow openstack invetnory to work cacheless
fixes #45431
6 years ago
Jordan Borean 198423d6fb
powershell: do not quote join_path result to reflect ShellBase join_path (#45944) 6 years ago
Jordan Borean ce515a626c
powershell - fix for ANSIBLE_KEEP_REMOTE_FILES on older Pythons (#45942) 6 years ago
Matt Martz 95e77ac853
Ensure that the src file contents is converted to unicode in diff info (#45744)
* Ensure that the src file contents is converted to unicode in diff info. Fixes #45717

* Fix up and cleanup

* The diff functionality in the callback plugins should have the
  to_text() calls removed since we're now doing it in ActionBase
* catching of UnicodeError and warnings in the callback diff
  functionality from 61d01f549f haven't been
  needed since we switched to to_text so remove them.
* Add a note to ActionBase's diff function giving an example of when the
  diff function will be inaccurate and how to fix it

* Fix callback get_diff() tests

I believe the unittests of callback's get_diff() were wrong.  They were
sending in a list where strings were expected.  Because previous code
was transforming the lists into strings via their repr, the previous
tests did not fail but they would have formatted the test cases output
in an odd way if we had looked at it.
6 years ago
Adam Miller 2fe150a1ef fix dnf wildcard pkg removal - fixes #27744 and #36970 (#45357)
Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Jordan Borean 5c73d4f4bd
async: use async_dir for the async results file directory (#45461)
* win async: use async_dir for the async results file directory

* tried to unify POSIX and PowerShell async implementations of async_dir

* fix sanity issue
6 years ago
Felix Fontein bc69aeca7f 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.
6 years ago
Daniel Speichert d34cf93f1a Migrate from MySQLdb to PyMySQL (#40123)
* Migrate from MySQLdb to PyMySQL

* Deduplicate driver loading and failure message

* Explain requirements

* Apply requirements docs change to proxysql too

* Add changelog
6 years ago
Sloane Hertel 8d2df9be52 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
6 years ago
Matt Martz b6fcbfe813
Support transfering empty files to target host. Fixes #36725 (#45751) 6 years ago
Sloane Hertel d7ca3f2bd3 ec2_group: fix regression for targets that are a list containing strings and lists (#45594)
* Fix targets that may be a list containing strings and lists which worked prior to 2.6.

* Add ec2_group integration tests for lists of nested targets

* changelog

* Add diff mode support for lists of targets containing strings and lists.
6 years ago
Matt Martz 07b2698c03 Add new expand_shell argument for run_command, to disable expanding shellisms (#45620)
* Add new expand_shell argument for run_command, to disable expanding shellisms. Fixes #45418

* s/expand_shell/expand_user_and_vars/g
6 years ago
Matt Martz 829f48e3f5
Flip default for AGNOSTIC_BECOME_PROMPT (#45563)
* Flip default for AGNOSTIC_BECOME_PROMPT

* simplify AGNOSTIC_BECOME_PROMPT porting guide entry

* clarify AGNOSTIC_BECOME_PROMPT changelog entry

* fixes version typo

* uses alternate wording (rather than escaping *)
6 years ago
Brian Coca ddb3764039
avoid empty groups in json output (#45621)
they get confused as hosts by script plugin

fixes #45601
6 years ago
Matt Martz e68f895e61
Support empty files with piped transfer_method. Fixes #45426 (#45618) 6 years ago
Jordan Borean d81249994e
win_script: add support for become and centralise exec wrapper builder (#45582)
* win_script: add support for become and centralise exec wrapper builder

* satisfying the pep8 gods

* do not scan for module dependencies when running as a script
6 years ago
Matt Martz 5785de582f
Fix logic to not re-download existing files when force=no (#45495)
* Fix logic to not re-download existing files when force=no. Fixes #45491

* Reduce logic complexity
6 years ago
David Rodríguez 600c7ac108 Fix remote checksums when paths have leading dots (#45287)
* Fix remote checksums with paths have leading dots

* Fix result recorded from the wrong file

* Add changelog fragment
6 years ago
Jordan Borean 01398f61d5
Win deprecate 2.8 (#45473)
* Remove deprecated/expired functionality

* win:_msi: Remove the win_msi module

* removed some missed deprecated return options and added porting guide reference

Co-authored-by: dagwieers <dagwieers@users.noreply.github.com>
6 years ago
Jordan Borean ec6d82435f
win_scheduled_task: add deprecation warning for repetition format (#45468)
* win_scheduled_task: add deprecation warning for repetition format

* fixed up sanity issues
6 years ago
Jordan Borean 3371a779b6
win_group_membership - fix random issue with CI on 2012 R2 (#45462) 6 years ago
Jordan Borean c9c141fb6a
win_say - fix up syntax and test issues (#45450) 6 years ago
Matt Martz 0015d4cef3
2.8 Core Deprecation Removal (#45232)
* Remove deprecated ansible.vars.unsafe_proxy. Fixes #45040

* Remove deprecated validate_md5 alias from fetch module. Fixes #45039

* Remove deprecated private arg from import/include_role. Fixes #45038

* All include deprecations bumped to 2.12. Fixes #45037

* Add changelog for deprecated removals
6 years ago
Matt Martz 263b9fade8
Don't pass file_name to DataLoader.load in script inventory plugin (#45428)
* Don't pass file_name to DataLoader.load in script inventory plugin. Fixes #34164

* Add changelog fragment
6 years ago
Meecr0b 2f6b8591b1 tower_credential: expect ssh_key_data to be a string instead of path (#45158)
* expect ssh_key_data to be a string instead of path

ssh_key_data should be a string filled with the private key
the old behavior can be archived with a lookup

Fixes #45119

* clarifies ssh_key_data description, adds newline
6 years ago
Matt Martz 2ac647def8
Ensure loop with delegate_to can short circuit the same as without delegate_to. Fixes #45189 (#45231) 6 years ago
Adam Miller db34d3923a Improve dnf group output for clarity
Add note about group removal bug upstream dnf

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Sloane Hertel 038fd0d0f2 elb_target_group - prevent a KeyError exception (#45169)
Ensure ports to integers after allowing the key 'Targets' to be available in params
6 years ago
Protista 80bea8adaf Add definitive to valid_simple_controls in pamd module (#44601)
* Add definitive to valid_simple_controls in pamd module

* Add changelog fragment for issue 44278

* Adjusted module name to not include path or extension
6 years ago
Matt Martz f89d873698
Stub out modules scheduled for 2.8 removal (#44985)
* Remove modules scheduled for 2.8

* Add changelog and porting guide

* Skip docs test on removed modules

* Don't link to removed modules
6 years ago
Dag Wieers b64e666643
Add elapsed return value to select modules (#37969)
* Add elapsed return value to select modules

It can be quite useful to know exactly how much time has elapsed
downloading/waiting. This improves existing modules or updates
documentation.

* Ensure elapsed is always returned

* Added changelog fragment
6 years ago
Toshio Kuratomi af3bac1320 Also remove the .changes.yaml file 6 years ago
Toshio Kuratomi 2d6594b34f Reset changelogs for the 2.8.0 development cycle 6 years ago
Matt Martz 2a4e92aab7
ensure if we get a non-Task object in _get_delegated_vars, we return early (#44934) 6 years ago
Matt Martz a0d7d4b82f Change insertion order of apply block to not affect the include_X task itself (#44912) 6 years ago
Sam Doran 8cd8d17980
Add ability to unlock 1Password vault to lookup plugins (#44923)
* Add ability to use login to 1Password vault to 1Password lookups

* Adjust unit tests

* Add changelog
6 years ago
Matt Martz 9d89e15ff0
Ensure we only cache the loop when the task had a loop (#44901)
* Further restrict caching of loop when the task actually had a loop. Fixes #44874

* Extend tests for loop caching
6 years ago
Alex Stephen 3c6c7bae9d Allow home path expansion on GCP service account files (#44863)
* Allowing home path expansion on GCP service account files #42974

* wrong name for changelog
6 years ago
Dag Wieers bf9ed0263a Ensure action plugins accept only valid args (#44779)
* Ensure action plugins accept only valid args

This fixes #25424
This also fixes #44773

* Add missing parameters, use private _VALID_ARGS
6 years ago
Matt Martz 0221d1ad20
Introduce and use locale-naive rfc2822 date format function (#44868)
* Introduce and use locale-naive rfc2822 date format function. Fixes #44857

* Adjust test expected response
6 years ago
Jordan Borean 533656694e
win_disk_image: return all mount paths in return value (#44799) 6 years ago
Matt Martz d5ed818e7c
Make sure we skip handlers from includes in compile_roles_handlers. Fixes #44848 (#44852) 6 years ago
Matt Martz cd2f66f731
Don't allow import_tasks to transition to dynamic when file is missing. See #44822 (#44836) 6 years ago
Jordan Borean 9d91607754
win_psexec: fix arg handling when command contains multiple args (#44797) 6 years ago
Xyon 03261b3053 Add new session parameter to win_psexec (#44263)
* Add new session parameter to win_psexec

* Indicate which version the session option was added in

* Added changelog fragment and minor edit on doc entry
6 years ago
Dag Wieers 5e814d8d17 Fix support for JSON output when charset is set (#44762)
* Fix support for JSON output when charset is set

This fixes #41797

* Add specific exception to catch

* Add Changelog fragment
6 years ago
Dag Wieers f588b1cdf9 Fix issue when timeout and state=present (#43464)
* Fix issue when timeout and state=present

* added changelog fragment
6 years ago
Brian Coca 86037bc840
improved block docs (#43611)
* improved block docs

 - broke down examples per keyword
 - clarified which errors are handled
 - clarified forcing error in rescue
6 years ago
Toshio Kuratomi 6b40906bdb Add changelog for 2.7 6 years ago
Toshio Kuratomi b3a57fabbb Make links anonymous so that they don't trigger rstcheck
rstcheck flags duplicate link targets as errors
6 years ago
Adam Miller 397febd343 YUM4/DNF compatibility via yum action plugin (#44322)
* YUM4/DNF compatibility via yum action plugin

DNF does not natively support allow_downgrade as an option, instead
that is always the default (not configurable by the administrator)
so it had to be implemented

 - Fixed group actions in check mode to report correct changed state
 - Better error handling for depsolve and transaction errors in DNF
 - Fixed group action idempotent transactions
 - Add use_backend to yum module/action plugin
 - Fix dnf handling of autoremove (didn't used to work nor had a
   default value specified, now does work and matches default
   behavior of yum)
 - Enable installroot tests for yum4(dnf) integration testing, dnf
   backend now supports that
 - Switch from zip to bc for certain package install/remove test
   cases in yum integration tests. The dnf depsolver downgrades
   python when you uninstall zip which alters the test environment
   and we have no control over that.
 - Add changelog fragment
 - Return a pkg_mgr fact if it was not previously set.
6 years ago
Matthias Fuchs 7871027c9d Share the implementation of hashing for both vars_prompt and password_hash (#21215)
* Share the implementation of hashing for both vars_prompt and password_hash.
* vars_prompt with encrypt does not require passlib for the algorithms
  supported by crypt.
* Additional checks ensure that there is always a result.
  This works around issues in the crypt.crypt python function that returns
  None for algorithms it does not know.
  Some modules (like user module) interprets None as no password at all,
  which is misleading.
* The password_hash filter supports all parameters of passlib.
  This allows users to provide a rounds parameter, fixing #15326.
* password_hash is not restricted to the subset provided by crypt.crypt,
  fixing one half of #17266.
* Updated documentation fixes other half of #17266.
* password_hash does not hard-code the salt-length, which fixes bcrypt
  in connection with passlib.
  bcrypt requires a salt with length 22, which fixes #25347
* Salts are only generated by ansible when using crypt.crypt.
  Otherwise passlib generates them.
* Avoids deprecated functionality of passlib with newer library versions.
* When no rounds are specified for sha256/sha256_crypt and sha512/sha512_crypt
  always uses the default values used by crypt, i.e. 5000 rounds.
  Before when installed passlibs' defaults were used.
  passlib changes its defaults with newer library versions, leading to non
  idempotent behavior.

  NOTE: This will lead to the recalculation of existing hashes generated
        with passlib and without a rounds parameter.
        Yet henceforth the hashes will remain the same.
        No matter the installed passlib version.
        Making these hashes idempotent.

Fixes #15326
Fixes #17266
Fixes #25347 except bcrypt still uses 2a, instead of the suggested 2b.

* random_salt is solely handled by encrypt.py.
  There is no _random_salt function there anymore.
  Also the test moved to test_encrypt.py.
* Uses pytest.skip when passlib is not available, instead of a silent return.
* More checks are executed when passlib is not available.

* Moves tests that require passlib into their own test-function.

* Uses the six library to reraise the exception.

* Fixes integration test.

When no rounds are provided the defaults of crypt are used.
In that case the rounds are not part of the resulting MCF output.
6 years ago
Charles a7f35e232e Switch to LiteralPath instead of Path. Closes #44508 (#44509)
* Switch to LiteralPath instead of Path. Closes #44508

* add changelog fragment

* fix line endings and remove final empty line

* Minor text changes in changelog
6 years ago
Daniel-Sanchez-Fabregas af49627a08 Module win_domain_computer fix delete computer with child (#44500)
* Module win_domain_computer fix delete computer with child

* add changelog fragment
6 years ago
Sloane Hertel d3f5238c09
Fix dangerous elb_application_lb state (#44646)
* elb_application_lb: fix dangerous default of deleting an ELB if state is omitted by changing state to default to present to be more like other AWS modules
6 years ago
Shuang Wang b03feb6d40 Implement part of #27617 [expend checksum format to <algorithm>:(<checksum>|<url>)] (#43751)
* expend checksum format to <algorithm>:(<checksum>|<url>)

* continue to code at office

* ALPHA - expend checksum format to <algorithm>:(<checksum>|<url>)

* clean up tmpfile and comment

* try to add test code for 27617

* try to add test code for 27617

* try to add test code for 27617

* try to fix [Could not find or access 'testserver.py']

* fix test code [Could not find or access 'testserver.py']

* fix test code [add files dir]

* fix test code [files dir not exists]

* as [connection was closed before a valid response was received]

* [connection was closed before a valid response was received]

* [connection was closed before a valid response was received]

* add test item [sha1 and sha256]

* since [connection was closed before a valid response was received]

* fix [connection was closed before a valid response was received]

* fix test code typo

* add docs for #27617

* PR #43751 is minor change

* fix pep8 issue.

* fix test code style.

* fix unexpected quote
6 years ago
Toshio Kuratomi f46c943d3d 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.
6 years ago
Will Thames 60e3af42d5 sns_topic boto3 port (#39292)
* Port sns_topic to boto3 and add tests
6 years ago
Sloane Hertel 79ecb4c41f
Add diff mode for ec2_group (#44533)
* Add (preview) diff mode support ec2_group

* Add diff mode to some ec2_group integration tests

* Remove unnecessary arguments and add comment to the module notes

* Add changelog
6 years ago
Sloane Hertel b152515fcb RDS inventory plugin (#41919)
Comments out uses of rds_instance in the integration tests and replace with AWS CLI until rds_instance has been merged
6 years ago
Sam Doran 05fff27415
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.
6 years ago
jctanner 653d9c0f87 New keyword: ignore_unreachable (#43857) 6 years ago
guoqiao 6ef9c2d7b7 Fix mail module for python 3.7.0 (#44550) (#44552)
In python 3.7.0, changes in `ssl.py` breaks `smtplib.SMTP_SSL`, which
then breaks `mail` module in ansible.

Run this line in python shell:

    import smtplib;smtplib.SMTP_SSL().connect(host='smtp.gmail.com', port=465)

Before python 3.7.0, we will get:

    (220, b'smtp.gmail.com ESMTP j13-v6sm3086685pgq.56 - gsmtp')

In python 3.7.0, we get such error at `lib/python3.7/ssl.py` line 843, method `_create`:

    ValueError: server_hostname cannot be an empty string or start with a leading dot.

The ssl module is using host info on SMTP_SSL instance, which is not set.
The fix/workaround is simple, just pass host info to it:

    import smtplib;smtplib.SMTP_SSL(host='smtp.gmail.com').connect(host='smtp.gmail.com', port=465)

Fixes: #44550

Signed-off-by: Guo Qiao <guoqiao@gmail.com>
6 years ago