Commit Graph

1574 Commits (7ea1db89d39c4aeeff140425e7310f3e81f54059)

Author SHA1 Message Date
Sam Doran 92cd13a2cf
lineinfile - use correct index value when inserting at the end (#63696) 5 years ago
Sam Doran 29d4d318a5
lineinfile - properly insert line when line exists and backrefs are enabled (#63763)
Use a separate variable for the boolean test rather than having the same variable sometimes be a boolean and sometimes be a regular expression match object

Add integration tests to cover this scenario
5 years ago
Xu Yuandong e4b6dd1862 ce_config/bug/jingdong: a bug from jingdong. (#62872)
* update to fix "`quit` may make seesion closed."

* update to fix "`quit` may make seesion closed."

* 274:49: E272: multiple spaces before keyword

* add a changelog fragment.

* Update ce_config.py

using run_command for prompts.

* Update ce_config.py

* Update ce_config.py

typo error

* update to use get_prompt

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py
5 years ago
Bob Boldin 40975cd436 fix 61907 - auto_attach yes option not honored in ec2_transit_gateway (#61993)
* fix 61907 - auto_attach yes option not honored in ec2_transit_gateway

* add changelog fragment
5 years ago
phongle1205 331d51fb16 Attach an attached/detached volume from OpenStack VM’s should return similar information (#21558)
Currently, attach an attached volume from OpenStack VM’s returns only
argument data. It is better to return full data as attaching a detached
volume.

In my use case, I need the extra data to mount and format the volume.
5 years ago
Toshio Kuratomi cc1ff57c5b
AH servers include automation-hub as part of the server configuration. (#63700)
* AH servers include automation-hub as part of the server configuration.

So we don't need to add it here.

Fixes #63699

* Update unittests for the fix to galaxy wait_import_task
5 years ago
Gary Williams 3f0479279e VMware: Add a parameter wait_for_ip_address_timeout in vmware_guest (#63557)
* Added a parameter (wait_for_ip_address_timeout) to allow a longer timeout than the default.
* Removed the wait_for_vm_ip function in this module as one in module_utils is already being used elsewhere.
5 years ago
Sam Doran dcec3d000e syslogger - disable check mode (#63646) 5 years ago
Felix Fontein 4b1fdee119
docker_container: deprecate trust_image_content (#63420)
* Deprecate trust_image_content.

* Add changelog.

* Mention it has never been used; removed test stub.
5 years ago
Xu Yuandong 47c31c201b action/ce.py:clear configuration candidate when return to user-view. (#63513)
* clear configuration candidate when return to user-view.

* add a changelog fragment for the pr.

* Update 63513-ce_action_wait_prompt_trigger_time_out.yaml

* Update 63513-ce_action_wait_prompt_trigger_time_out.yaml
5 years ago
Andrey Klychkov d22dc5ab8b doc: postgresql_user: Add changelog fragment for 63565 (#63666) 5 years ago
Matt Clay 92b387aa27 Fix hcloud requirements.
Avoid installing hcloud on Python 3.9 since it is not supported.
5 years ago
Matt Clay 6be4741f72 Fix ansible-test env var mixing running commands. 5 years ago
Matt Clay 78eca0eb5d Fix SSL protocol references in mqtt module. 5 years ago
Matt Clay 437e9b7063 Fix ansible-test sanity requirements install.
This fixes ansible-test so it no longer tries to install sanity test dependencies on unsupported Python versions.
5 years ago
Sander Steffann faf8fc62cb Add inventory cache to the netbox plugin (#57644)
* Add cache to netbox inventory plugin

* add changelog fragment
5 years ago
Andrea Tartaglia 7da37e58de Added changelog fragment 5 years ago
Andrea Tartaglia b4bb3dee9a gitlab_user: Fix ssh key add and group membership add when there's other changes (#63621)
* Fixed syntax in sshkey/group add

* Added changelog

* pep8 fix
5 years ago
Andrey Klychkov 7dd46f7b2d postgresql_privs: add support a type parameter option for types (#63555)
* postgresql_privs: add support a type parameter option for types

* postgresql_privs: add support a type parameter option for types, add changelog fragment

* postgresql_privs: add support a type parameter option for types, add schema handling

* postgresql_privs: add support a type parameter option for types, fix typo

* postgresql_privs: add support a type parameter option for types, add comment
5 years ago
willtome f2ca4cce2b Add Constructed to Foreman inventory plugin (#62542)
* add constructed

* changelog
5 years ago
Felix Fontein ba686154b9
openssl_csr: deprecate version option (#63432)
* Deprecate openssl_csr's version.

* Add changelog.

* Change PR so that version will no longer accept values != 1 from 2.14 on.

* Make sure it is a string.
5 years ago
Felix Fontein d00d0c81b3
openssl_privatekey: add support for format option (#60388)
* Add support for format option.

* Improve private key format detection.

* Fix raw format handling.

* Improve error handling.

* Improve raw key handling.

* Add failed raw test.

* Improve raw key loading.

* Simplify tests.

* Add raw format tests.

* Fail if format != 'auto_ignore' is specified for pyopenssl backend.

* Fix quoting.

* Bump version.

* Allow to convert private keys between different formats.

* Improve description.
5 years ago
Sergey e3c7e35656 Add extra args and executable name to podman connection plugin (#63166)
* Add extra args and executable name to podman connection plugin

Like there is for docker plugin, add extra arguments for command
line of podman. Also add configurable executable and checking if
this executable exists on host. Fail module if executable is not
in PATH.

* Update changelogs/fragments/63166-add-extra-args-executalbe-podman-connection.yaml

Co-Authored-By: Felix Fontein <felix@fontein.de>
5 years ago
Toshio Kuratomi 4cad7e479c
Galaxy publish fix (#63580)
* Handle galaxy v2/v3 API diffs for artifact publish response

For publishing a collection artifact
(POST /v3/collections/artifacts/), the response
format is different between v2 and v3.

For v2 galaxy, the 'task' url returned is
a full url with scheme:

        {"task": "https://galaxy-dev.ansible.com/api/v2/collection-imports/35573/"}

For v3 galaxy, the task url is relative:

        {"task": "/api/automation-hub/v3/imports/collections/838d1308-a8f4-402c-95cb-7823f3806cd8/"}

So check which API we are using and update the task url approriately.

* Use full url for all wait_for_import messages

Update unit tests to parameterize the expected
responses and urls.

* update explanatory comment

* Rename n_url to full_url.

* Fix issue with overwrite of the complete path

* Fixes overwrite of the complete path in case there's extra path stored
  in self.api_sever
* Normalizes the input to the wait_import_task function so it receives
  the same value on both v2 and v3

Builds on #63523

* Update unittests for new call signature

* Add changelog for ansible-galaxy publish API fixes.
5 years ago
Matt Martz 82ee341fe0
Explicitly use multiprocessing fork start method (#63581)
* Explicitly use multiprocessing fork start method

* Remove unused import

* Remove unused import

* Fallback to just multiprocessing on py2
5 years ago
Matt Clay 7448084858 Update default-test-container to 1.10.1.
This brings in the final Python 3.8.0 release instead of a release candidate.
5 years ago
Andreas Olsson 98b025239a nsupdate: Don't try fixing non-existing TXT values (#63408)
The commit 4e895c1 aimed to ensure that TXT record values were sanely
quoted. Sadly it failed to take the scenario of non-existing values
into account. While record values are required for record creation
they are not required for record deletion.

This change rectifies that oversight, saving Ansible from
unsuccessfully trying to operate on NoneType objects.

Resolves #63364
5 years ago
Matt Clay d829a50a5b Fix use of deprecated function in xml module. 5 years ago
Matt Clay 32b57d57a0 Add constraint for pathspec.
This fixes installation of pathspec on Python 2.6.
5 years ago
Sam Doran 2b1e24fc49 package_facts - use AnsibleModule.warn() for warnings 5 years ago
Sam Doran e9d10f94b7
user - fix shadow file parsing on AIX (#62547)
Initialize variables in case the shadow file is not found.
Handle IndexErrors if something goes wrong with file parsing.
5 years ago
Matt Martz d8389d9f55
Ensure we preserve the /api appended URL (#63472) 5 years ago
Sam Doran e9d29b1fe4 Properly mask no_log values is sub parameters during failure (#63405)
* Get no_log parameters from subspec

* Add changelog and unit tests

* Handle list of dicts in suboptions

Add fancy error message (this will probably haunt me)

* Update unit tests to test for list of dicts in suboptions

* Add integration tests

* Validate parameters in dict and list

In case it comes in as a string

* Make changes based on feedback, fix tests

* Simplify validators since we only need to validate dicts

Add test for suboptions passed in as strings to ensure they get validated properly and turned into a dictionary.

ci_complete

* Add a few more integration tests
5 years ago
Matt Martz 4c2b137728
Deprecate hash_behaviour (#63300)
* Deprecate hash_behaviour

* Fix wording
5 years ago
Felix Fontein d753168e9d
docker_node_info: improve error handling (#63418)
* Improve error handling for get_service_inspect().

* Add changelog fragment.
5 years ago
Felix Fontein 61b3784131 docker_image: fix option parameter so that warnings are issued (#63345)
* Fix option parameter so that warnings are issued.

* Add changelog.
5 years ago
Roman 504d76e956 acl: fix module failure if there're spaces in a path (#63280)
* Make acl module to work with whitespaces in path

* Added a changelog fragment

* Add quotes to changelog fragment
5 years ago
Matt Martz 7f4befdea7
Wrap CLI Passwords with AnsibleUnsafeText, ensure unsafe context is not lost during encode/decode (#63351)
* Wrap .encode and .decode on AnsibleUnsafe objects

* runme.sh needs to be executable

* ci_complete

* Update changelog with CVE
5 years ago
Adam Miller aaef214a26 adapt to firewalld 0.7.0 for RHEL 8.1 Beta, Fedora 31+ (#63357)
Fixes #63254

Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago
James Cassell bfd32c9b00 clean "changed" only after it has been processed (#59958)
* clean "changed" after it has been processed

without this change, a loop of `debug` tasks with `changed_when`
causes the "changed" status to get lost before output

* runme.sh tests for debug loop status
5 years ago
Abhijeet Kasurde 35cc228b3b VMware: name is not required parameter for vmware_guest_custom_attributes
Fixes: #63222

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Matt Davis 6d52bdf4db
fix default collection resolution in adhoc (#63298)
* fix default collection resolution in adhoc

* if an adhoc command is run with a playbook-dir under a configured collection, default collection resolution is used to resolve unqualified module/action names

* Set ANSIBLE_PLAYBOOK_DIR in integration tests.

* Fix config conflict in ansible integration test.

* add adhoc default collection test

* text-ify warning string
5 years ago
Andrey Klychkov 3e87429365 mysql_replication: add support of resetmaster choice to mode parameter (#63321) 5 years ago
René Moser 64a66f566d
doc: mysql_info: add changelog and version_added for global_status (#63328) 5 years ago
Matt Davis 77de663879
config encode errors should not be fatal (#63311)
* fixes #63310
* subset of fixes from #58638
* added warning on error
5 years ago
Sam Doran 9d014778ad
cronvar - use correct binary name (#63279)
Fixes regression introduced by #62554
Add integration tests for cronvar
5 years ago
Andrey Klychkov 71bcce5db5 mysql_replication: add channel parameter (#63271)
* mysql_replication: add channel parameter

* mysql_replication: add channel parameter, add changelog
5 years ago
Andrey Klychkov 9f9afcb203 mysql_replication: add connection_name param for MariaDB multi source replication support (#63229)
* mysql_replication: add connection_name param for MariaDB multi source support

* mysql_replication: add connection_name param for MariaDB multi source support, add changelog
5 years ago
Matt Davis fd229dcbb5
add ANSIBLE_PLAYBOOK_DIR envvar support (#63220)
* add ANSIBLE_PLAYBOOK_DIR envvar support

* allows `ANSIBLE_PLAYBOOK_DIR` envvar as a fallback on CLI types that support `--playbook-dir`. This should have been implemented with #59464, but was missed due to an oversight.
* added basic integration test

* make first-class PLAYBOOK_DIR config entry

* update changelog
5 years ago
Andrey Klychkov 3b18337cac lineinfile - fix bug with insertbefore/insertafter and firstmatch (#63194) 5 years ago
Matt Clay 022335669c
Work around ssh-keygen issue in ansible-test. (#63211)
Newer versions of ssh-keygen create PEM keys that are not recognized by Paramiko.

Now ansible-test compensates for this by updating they keys it generates so Paramiko will recognize them.
5 years ago
Pavan Bidkar 314f9fbd5c Support latest version while upgrading VM hardware. (#62188)
Support for the `latest` version during an VM hardware upgrade.
5 years ago
Matt Clay 4c79f1ec4d Fix ansible-test integration temp dir location.
Previously the temporary directory used to run integration tests resided under the user's home directory. This prevented ansible-playbook from detecting the default collection when running tests.

Now the temporary directory is created within the collection to facilitate default collection detection.
5 years ago
Matt Clay 32979430d0 Add missing var for format string in ansible-test. 5 years ago
Abhijeet Kasurde deda9d4cc5 VMware: Add module defaults for VMware modules (#63197)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Nik Reiman 785ba62867 vmware: Only add configured network interfaces to facts (#28552)
This change effectively filters out any network interfaces which were
not explicitly configured for the guest. This fixes some unexpected behaviour where a machine with multiple IP addresses (for example, when Docker is installed, an internal IPv4 interface is added to
communicate with the container) would show one of the internal
addresses in the 'ipv4' field, but then no other information about the
corresponding hardware interface.
5 years ago
Andrey Klychkov e48202838c mysql_replication: add master_delay parameter (#63130) 5 years ago
sky-joker 7b7d266a39 VMware: add properties option to vmware_host_facts module (#62916)
* add properties option to vmware_host_facts
5 years ago
Adrian Likins 239d639fee Add support for automation-hub authentication to ansible-galaxy (#63031)
Adds support for token authentication in Automation Hub. Fixes: ansible/galaxy-dev#96
5 years ago
Felix Fontein 24b80848dc
openssl_dhparam: add cryptography backend (#62991)
* Separate OpenSSL-specific code from generic code.

* Make sure absent works without OpenSSL.

* Add cryptography backend.

* Add tests.

* Add changelog.

* Duplicate disclaimer.

* Add dependency on setup_openssl.

* Forgot to adjust something.

* Fix version tuple.
5 years ago
Felix Fontein 41eafc2051
docker_container: improve image finding / change detection (#62971)
* Improve image finding / change detection.

* Checked wrong object.

* Improve behavior. (Let docker daemon sort this out.)

* Add changelog.

* Add simple test.

* Fix image name.

* Use new docker_image params.

* Rewrite.
5 years ago
Matt Clay b91f452f4f Fix ansible-test virtualenv real python search.
ansible-test now properly searches for `pythonX.Y` instead of `python` when looking for the real python that created a `virtualenv`.
5 years ago
Andrey Klychkov ad5200a7c0 postgresql_lang: add owner parameter (#62999)
* postgresql_lang: add owner parameter

* postgresql_lang: add owner parameter, add changelog fragment
5 years ago
Andrey Klychkov ea86b2c2f7 mysql_replication: add master_use_gtid parameter (#62648)
* mysql_replication: add master_use_gtid parameter

* mysql_replication: add master_use_gtid parameter, improve tests
5 years ago
tchernomax 25ac7042b0 pacman: remove 'recurse' deprecated option (#61961)
* pacman: remove 'recurse' deprecated option

* pacman: remove recurse deprecated option

* pacman: remove recurse deprecated option
5 years ago
Matt Martz 594a0fa9ae Add new truthy and falsy jinja2 tests (#62602) 5 years ago
Adam Miller 8bcf11fee9 dnf - properly handle idempotent removal of wildcard globs (#63034)
Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago
Chris Houseknecht 911aa6aab9
Default collection install path to first path in COLLECTIONS_PATHS (#62870) 5 years ago
Andrey Klychkov 0706782e4e mysql_replication: add return value, remove extra argument from function (#63036) 5 years ago
Matt Clay 3f2380ccce Exclude tmp dir from ansible-test results copy.
This fixes test errors related to failures copying temporary test results files from a remote system back to the local system.

It also speeds up processing of test results and reduces network utilization by avoiding the temporary files.
5 years ago
Felix Fontein 62c0cae29a
docker_container: fix idempotency for network IP addresses (#62928)
* Specifying IP addresses needs API version 1.22 or newer.

* Simplify code.

* Use IPAMConfig.IPv*Address instead of IPAddress and GlobalIPv6Address.

* Add changelog.

* Fix syntax errors.

* Add integration test.

* Don't rely on netaddr.

* Normalize IPv6 addresses before comparison.

* Install netaddr, and use it.
5 years ago
Michael Scherer 75c4e9ec05 Fix _validate_csr_subject and _validate_csr_signature (#62790)
On python 3, if there is no explicit "return True", the
function call will be seen as "False", thus failling the module
5 years ago
Andreas Olsson 75dfe6c88a nsupdate: Use authoritative server for zone lookup (#62329)
Using a regular recursive resolver to lookup the zone name might not
work when the zone in question belong to a private/internal
domain. The authoritative server being used on the other hand will
definitely know about the zone(s) it's serving.

This approach is also consistent with the nsupdate module already
querying the specified authoritative server for TTL values.

The reason for the implementation having to loop until finding a
direct match is to account for different SOA responses triggered by
CNAMEs and DNAMEs. The previously used `dns.resolver.zone_for_name()`
function does the same.

Resolves #62052
5 years ago
bverschueren c3eceb3a0d support creating an image from a volume (#59574)
* support creating an image from a volume

* leave filename/volume optional

* enforce volume/filename mutual exclusivity

* bump version_added to 2.10 for volume option

* add changelog fragment
5 years ago
Matt Clay 831e1bf2e0 Fix ansible-test PYTHONPATH handling.
Running from an installed version of ansible-test now results in tests using a dedicated directory for PYTHONPATH instead of using the site-packages directory where ansible is installed.

This provides consistency with tests running from source, which already used a dedicated directory.

Resolves https://github.com/ansible/ansible/issues/62716
5 years ago
Sam Doran 2375fd0990 find - clarify description of 'contains' (#62445) 5 years ago
Varun Chopra 7dfd994a7e win_partition - Fix handling of maximum partition size (#58225)
* Fix handling of maximum partition size

* Added changelog fragment
5 years ago
Varun Chopra 3b409f2f50 win_format - Add allocation_unit_size (#56966)
* Fix allocation_unit_size

* Some final changes and added tests

* Cleanup...

* Fixes issues on 2012/R2

* Update tests for 2012/R2

* Suggested changes
5 years ago
Jordan Borean 322e225830
Fix issue when setting an empty pass to no_log param (#62804)
* Fix issue when setting an empty pass to no_log param

* Fix typo
5 years ago
Simon Dodsley 8a4c8ae20a Add checks for Cloud Block Store (#62068) 5 years ago
Jordan Borean d4ec9422a3
Add proper error when trying to run on older PS versions (#62634) 5 years ago
Pilou 278398555d package_facts: check 'vital' and 'automated' values ('pkg' manager) (#62766) 5 years ago
Xu Yuandong d6ef7c8530 module_utils-network-cloudengine: fix get_nc_next. (#62587)
* fix get_nc_next.

* add a changelog fragment.

* upadte for  changelgo fragment.

* merge two prs, one depens another.

* merge two prs, one depens another.

* update changelog.
5 years ago
Felix Fontein c6dcf78f53 ACME modules: make compatible to Buypass ACME v1 CA, and fix bug in ACME v1 account update (#61693) 5 years ago
Felix Fontein 2e5137078d
docker_login: fix Python 3 problem in #60381 (#62621)
* Fix Python 3 problem: run_command() returns native strings, not byte strings.

* Add changelog.
5 years ago
Mark Chappell 40660e7f6e iam_role : support managing max session duration and deleting the instance profile it creates (#62014)
* iam_role: Add support for managing MaxSessionDuration

* iam_role: Add support for deleting the IAM Instance Profiles we created

* iam_role: migrate all boto failures to fail_json_aws for consistency

* iam_role: test validity of path so we can throw a more understandable error

* iam_role: (integration tests) Split iam_role integration tests from sts_assume_role tests

- Make the iam_role tests more comprehensive
- Add tests for iam_role_info

* iam_role: (integration tests) Make some of our pauses optional

If the tests appear to be flakey we may need to enable standard_pauses
5 years ago
Sam Doran 987265a6ef
Account for empty strings when splitting the host pattern (#62442)
Improve tests
- add more unit test cases
- add specific integration test with more cases

Testing shows no major downside to calling .strip() twice in a comprehension vs. using a regular for loop and only calling .strip() once. Going with the comprehension for ease of maintenance and because comprehensions are optimized in CPython.
5 years ago
Evgeni Golov 8d0c193b25 allow before/after diff to be NoneType (#62582)
when creating or deleting an object (e.g. via an API), before/after can
be `None` (or at least represented as such by the used library). to
avoid modules havig to do

    diff={'before': before or '', 'after': after or ''}

let's just convert `None` to an empty string that can be diffed properly
5 years ago
Mario Lenz 0c66e7ef10 VMware: Remove mentions of enable_vsan from vmware_cluster_ha example (#62616)
* VMware: Remove mentions of enable_vsan from vmware_cluster_ha example
* Add changelog fragment
5 years ago
John Mahowald 4116d263c4 Add missing gcp modules to gcp module defaults group (#57779)
* Add missing gcp modules to gcp module defaults group

Fixes #56324

* Add changelog fragment for #57779
5 years ago
Sloane Hertel 4cc4c44dd0
Add a representer for AnsibleUnsafeBytes (#62598)
* Add a representer for AnsibleUnsafeBytes

* changelog

* Add unit tests

Remove native string test until we have time to evaluate how this the function should work
Add non-ASCII characters to test cases

* Compare to the string on Python 2

Add a comment in the test about this behavior
5 years ago
Will Thames a684bb9f5b Ensure k8s apply works with check mode (#60572)
* Ensure k8s apply works with check mode

Update the new predicted object with fields from the previous object
before applying in check mode

Don't log output of `file` with `state: absent` on huge virtualenvs!

Fixes #60510

* Use openshift client fix to improve apply for check mode

Use new apply_object method to get a better approximation
of the expected object in check mode.

Requires released upgrade to openshift

* Add changelog fragment for k8s apply check mode fix

* Update changelogs/fragments/60510-k8s-apply-check-mode.yml

Co-Authored-By: Felix Fontein <felix@fontein.de>
5 years ago
Matt Clay 1c64dba3c9 Fix plugin names for collection plugins. (#60317)
* Fix plugin names for collection plugins.

Add an integration test to verify plugin __name__ is correct for collection plugins.

* Fix collection loader PEP 302 compliance.

The `find_module` function now returns `None` if the module cannot be found. Previously it would return `self` for modules which did not exist.

Returning a loader from `find_module` which cannot find the module will result in import errors on Python 2.x when using implicit relative imports.

* add changelog

* sanity/units/merge fixes
5 years ago
Sam Doran b7897e3a8d cron - Only run get_bin_path() once (#62554) 5 years ago
Jordan Borean 064e443ea5
psexec - Fix kerb and interactive support (#62556) 5 years ago
Matt Davis d0c7b42e58
fix collection jinja2 cache issue (#62543)
* prevents premature lookup (and potential KeyError) of Jinja filter/test function cache that's not fully populated
5 years ago
Jordan Borean bad338aca6
win_exec_wrapper - Be more defensive when trying to get output errors (#62376)
* win_exec_wrapper - Be more defensive when trying to get output errors

* Fix up property search
5 years ago
Jean-Frédéric 951a80c8b0 cron - Use the default crontab executable in cron and cronvar modules (#59765)
In some remote environments, the `crontab` executable is
overloaded with a custom executable, which typically does
some pre/post processing before forwarding to crontab.

Instead of using the hardcoded `/usr/bin/crontab`, this uses
the `get_bin_path` utility to locate the default crontab executable.
5 years ago
Jordan Borean 2e1c6a7839 Add fix for specifying current dir in collections_paths (#62478) 5 years ago
Sloane Hertel 66e5427ffb
cloudformation_info - fix KeyError (#62290)
* cloudformation_info - fix KeyError

* changelog
5 years ago