Commit Graph

9201 Commits (4aae6f5341430594889c425b8b27ab05ef230f2e)

Author SHA1 Message Date
Felix Fontein 13db4b90a5 openssl_csr: fix tests (#63994)
* Make sure tests are validated with correct backend in mind.

* Fix tests.

(cherry picked from commit 35a412fab7)
5 years ago
Sloane Hertel 153f8341a5 Use templating in HostVarsVars __repr__ (#64282)
* Fix HostVarsVars templating

* Add some tests for HostVars and HostVarsVars templating

* changelog

(cherry picked from commit 371d7aae31)
5 years ago
Jordan Borean 93d9a091a3 [stable-2.9] Fix up role version pagination for Galaxy install (#64373)
* Fix up role version pagination for Galaxy install

* Fix sanity issue
(cherry picked from commit 7acae62fa8)

Co-authored-by: Jordan Borean <jborean93@gmail.com>
5 years ago
Felix Fontein 64665ffcc9 ansible-test: bumping ACME test container version (#64424)
* Bumping ACME test container version.

* Add changelog.

(cherry picked from commit f4ff45dcd4)
5 years ago
Martin Krizek c44cd68aa2 template lookup: fix regression when templating hostvars (#64070)
This fixes a regression that was caused by switching from copy() to
deepcopy() when 'saving' variables before templating. Since HostVars
did not implement the __deepcopy__() method, deepcopy returned incorrect
results when host vars were present in the variables.

Fixes #63940

(cherry picked from commit cd8ce16d48)
5 years ago
Matt Martz 26e8474f6d [stable-2.9] unsafe wrapping should only happen for with_ loops (#64401)
* unsafe wrapping should only happen for with_ lookups. Fixes #64379. Addresses #64169

* edit porting guide entry

* typo in changelog fragment

* typo

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* punctuation

Co-Authored-By: Sandra McCann <samccann@redhat.com>
(cherry picked from commit 254788b)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Jeff Geerling 209865502a Fixes #56832: Remove warning when falling back to apt-get if aptitude is missing. (#61782)
(cherry picked from commit a6ec6c3175)
5 years ago
Matt Martz 28c4a41d9b [stable-2.9] Set alter_sys=True instead of False to address backwards… (#64686)
* [stable-2.9] Set alter_sys=True instead of False to address backwards incompat (#64670)

* Set alter_sys=True instead of False to address backwards incompat

* ci_complete

* Add integration test

* ci_complete

* sanity

* ci_complete

* Changelog fragment

* Update import test and validate-modules to match.
(cherry picked from commit b93d92ef9a)

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

* Rebase and add alter_sys to validate-modules
5 years ago
Felix Fontein d35a3a74cc openssl_csr and openssl_certificate: fix support for Ed25519 and Ed448 private keys (#63984) (#64125)
* Move X25519, X448, Ed25519 and Ed448 feature tests to module_utils.

* Correctly sign with Ed25519 and Ed448 keys.

* Fix public key comparison. Ed25519 and Ed448 do not have public_numbers().

* Add tests.

* Add changelog.

* Give better errors for cryptography 2.6.x and 2.7.x.

* Test for new errors.

* Forgot one.

* Used wrong private key.

* Use private key password for CA key. Add more stuff to its certificate.

(cherry picked from commit fed267df03)
5 years ago
Bojan Vitnik 4055e5cfc6 XenServer: Update docs with recent changes in XenAPI python lib and branding (#63728) (#63815)
- xenserver module_util: XenAPI lib import error message handling is now
   ported to missing_required_lib(). Updated unit tests.
 - xenserver_guest, xenserver_guest_info, xenserver_guest_powerstate modules:
   docs are updated to reflect recent changes in availability of XenAPI lib
   on PyPI.
 - xenserver_guest, xenserver_guest_info, xenserver_guest_powerstate modules:
   docs are updated to reflect recent Citrix rebranding of XenServer. Broken
   URLs to external resources are fixed.
 - xenserver_guest, xenserver_guest_info, xenserver_guest_powerstate modules:
   more tested platforms are mentioned in docs.
(cherry picked from commit 7afba9420a)
5 years ago
Felix Fontein 1979b4bf76 docker_swarm_service: Allow source to be omitted for tmpfs mounts (#64637) (#64640)
* Allow source to be omitted for tmpfs mounts.

* Add changelog.

(cherry picked from commit 574bd32db2)
5 years ago
Sam Doran 68fcc7a50c [stable-2.9] copy - check for changes beyond first level of subdirectories (#58323) (#64111)
Add integration test for copy: deep recursive with remote_src=True
(cherry picked from commit b7e38dfa52)

Co-authored-by: Alexander Korsunsky <A.Korsunsky@gmail.com>
5 years ago
Robert Osowiecki 39aba6d304 lineinfile - don't run os.makedirs on empty dir path (#63921) (#64091)
* Fix #63919: don't run os.makedirs on empty dir path

* integration test for lineinfile create: yes without path (Sam Doran <sdoran@redhat.com>)

(cherry picked from commit 3c978a3225)
5 years ago
Roman b327e1e2c6 acl: fix module failure if there're spaces in a path (#63280) (#63811)
* Make acl module to work with whitespaces in path

* Added a changelog fragment

* Add quotes to changelog fragment

(cherry picked from commit 504d76e956)
5 years ago
Jordan Borean 0d993a6b78 Fix issue when setting an empty pass to no_log param (#62804) - 2.9 (#62814)
* 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

(cherry picked from commit 322e225830)

* Fix up actual get for older versions
5 years ago
Matt Clay 64c52e6021 [stable-2.9] Fix ansible-test collections sanity import test. (#64467)
* Fix ansible-test collections sanity import test.

Resolves https://github.com/ansible/ansible/issues/64466

* Fix get_source implementation also.

* Fix is_package function.
(cherry picked from commit adcf9458f1)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 276f4b21de [stable-2.9] Fix ansible-test sanity requirements install.
This fixes ansible-test so it no longer tries to install sanity test dependencies on unsupported Python versions.
(cherry picked from commit 437e9b7063)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 259c278bcd [stable-2.9] Add constraint for pathspec.
This fixes installation of pathspec on Python 2.6.
(cherry picked from commit 32b57d57a0)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 8b0249c0b0 [stable-2.9] Add missing var for format string in ansible-test.
(cherry picked from commit 32979430d0)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 7c5e08c059 [stable-2.9] Fix ansible-test env var mixing running commands.
(cherry picked from commit 6be4741f72)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay c271fd0df2 [stable-2.9] Fixes for validate-modules import handling. (#63932)
* Fix validate-modules support for collections.

- Relative imports now work correctly.
- The collection loader is now used.
- Modules are invoked as `__main__`.

* Remove obsolete validate-modules code ignores.

* Handle sys.exit in validate-modules.

* Add check for AnsibleModule initialization.

* Remove `missing-module-utils-import` check.

This check does not support relative imports or collections.

Instead of trying to overhaul the test, we can rely on the `ansible-module-not-initialized` test instead.

* Fix badly named error codes with `c#` in the name.

The `#` conflicts with comments in the sanity test ignore files.

* Add changelog entries.
(cherry picked from commit e9f8a34dce)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 22df4947e2 [stable-2.9] Switch from RHEL 8.0 & 8.1b to 8.1 in CI.
(cherry picked from commit 75646037dc)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Sam Doran 0046d0be47 [temporary-2.9.1-branch-releng-only] lineinfile - use correct index value when inserting at the end (#63696)
(cherry picked from commit 92cd13a2cf)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Sam Doran 96d304a894 [temporary-2.9.1-branch-releng-only] 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
(cherry picked from commit 29d4d318a5)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Felix Fontein 67c02e5dee [2.9] crypto modules: improve return value list documentation (#63409)
* crypto modules: improve return value list documentation (#62929)

* Improve return value documentation by allowing entry for return values.
* Add docs formatting, adjust styling.
* Fix sample return value. (Taken from https://tools.ietf.org/html/rfc7517#appendix-A.1.)
* Work around abuse of .

(cherry picked from commit 054285c34c)

* Add changelog.
5 years ago
James Cassell 3c0ed8c02a 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

(cherry picked from commit bfd32c9b00)
5 years ago
Andrey Klychkov cc244f4e03 lineinfile - fix bug with insertbefore/insertafter and firstmatch (#63194)
(cherry picked from commit 3b18337cac)
5 years ago
Felix Fontein 9e211c64ce 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.

(cherry picked from commit 41eafc2051)
5 years ago
Felix Fontein bdaa8baacb 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.

(cherry picked from commit 62c0cae29a)
5 years ago
Matt Clay e1b9bed57d [stable-2.9] Fix various import sanity test issues. (#63839)
* [stable-2.9] Fix various import sanity test issues.

- Relative imports are now properly recognized.
- Correct script invocation of Ansible modules is used.
- Warnings are now consistently reported as errors.
- Errors are now consistently reported with the file tested.

Resolves https://github.com/ansible/ansible/issues/62723
Resolves https://github.com/ansible/ansible/issues/61884
(cherry picked from commit 92ccdeac31)

Co-authored-by: Matt Clay <matt@mystile.com>

* Changelog entry for ansible-test sanity fixes.

(cherry picked from commit 0923ed56c7)
5 years ago
Toshio Kuratomi db5382341d [stable-2.9] 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
(cherry picked from commit cc1ff57)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
5 years ago
Matt Clay ab8f9969af [stable-2.9] Update default-test-container to 1.10.1.
This brings in the final Python 3.8.0 release instead of a release candidate.
(cherry picked from commit 7448084858)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Toshio Kuratomi 118825f4ae
[stable-2.9] Fix ansible-galaxy --version (#63636)
* [stable-2.9] Added changelog fragment
(cherry picked from commit 7da37e5)

Co-authored-by: Andrea Tartaglia <andrea@braingap.uk>

* Fixes --version in ansible-galaxy cli

(cherry picked from commit 202ad4f89a)
5 years ago
Toshio Kuratomi 741b6e65ef [stable-2.9] 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.
(cherry picked from commit 4cad7e4)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
5 years ago
Alicia Cozine b04d328b3a
Backport/2.9/docs2 (#63524)
* Update sros_config.py (#63132)

(cherry picked from commit b3deab4319)

* add note about collection links (#63346)

(cherry picked from commit bdd0fac606)

* Nosh module documentation update (#63303)
* detail the 'status' dictionary
* did not add individual descriptions, see nosh documentation for those
* sample: False not being rendered unless 'False' is quoted

(cherry picked from commit df283788e5)

* Move galaxy appendix info to a new Galaxy section (#63356)
* start galaxy docs restructure
* shared snippets in txt files
* moved all content to galaxy section

(cherry picked from commit ae265bc546)

* Enter should be Italics as it is a menu option (#63441)

(cherry picked from commit 7a8c909876)

* ini_file: remove incorrect documentation (#63394)

(cherry picked from commit ab249a469e)

* Changed with_items to loop in VMware example (#63022)

(cherry picked from commit 876a2d57be)

* ovirt update fetch_nested param doc (#63191)

(cherry picked from commit 0beab6bf69)

* Update 'delete' parameter description in synchronize module (#63450)

Co-Authored-By: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit da46800f1b)

* Update unarchive.py - Further clarify extra_opts (#58102)
Update the description in the options to help assist with what the module is looking for in the extra_opts.  #31873 alone is not enough since if you are not familiar with the option given in the example it may not be obvious that both elements are part of the same option instead of being two different options.

Co-Authored-By: Alicia Cozine <879121+acozine@users.noreply.github.com>
(cherry picked from commit e967060b9f)

* ovirt_vm add warning about next run configuration (#63458)

(cherry picked from commit 16e49fdd44)

* Fix doc - porting_guide_2.8 value example (#63493)

(cherry picked from commit e0f67b58ce)

* Fix warnings for ufw examples (#63505)

(cherry picked from commit e4eea0510c)
5 years ago
Felix Fontein bbc7c2d2ea [2.9] Fix return value documentation (#63529)
* Fix return value documentation (1/2) (#63477)
* Avoid validation errors for missing 'contains:'.

(cherry picked from commit 6bea1597cc)

* Fix return value documentation (2/2) (#63478)
* Avoid validation errors for missing 'contains:'.
* Convert JSON text to JSON dict.
* example -> sample.
* Fix YAML.

(cherry picked from commit 4bc298af83)
5 years ago
Sam Doran f610ed3a4e [stable-2.9] 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
(cherry picked from commit e9d29b1fe4)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Adam Miller d59de7123a adapt to firewalld 0.7.0 for RHEL 8.1 Beta, Fedora 31+
Fixes #63254

Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago
Matt Martz baeff7462d Wrap CLI passwords as AnsibleUnsafeText (#63352)
* isa string should rewrap as unsafe in get_validated_value

* _is_unsafe shouldn't be concerned with underlying types

* Start with passwords as text, instead of bytes

* Remove unused imports

* Add changelog fragment

* Update changelog with CVE
5 years ago
Matt Davis 5b6e8590cf 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

(cherry picked from commit 6d52bdf4db)
5 years ago
Adrian Likins ae3a79fa58 backport of galaxy trailing api fix (63238) to stable-2.9 (#63293)
* Stop appending '/api' to galaxy server url (#63238)

* Stop appending '/api' to configured galaxy server url

Since not all galaxy REST api server URLs live
at '/api', stop always appending it to the
'url' value loaded from config.

* Add note about manually migrated galaxy configs and /api

* Add '/api/' to galaxy url and guessing if galaxy API

* Fix most unit tests (update to expect /api/)

* Fix test_initialise_unknown unit test

Since we retry now with an added /api/, mock it as well.

* Update fallback default avail_ver to new format

(cherry picked from commit bad72693e4)

* Add changelog fragment galaxy_api_config

* Fix galaxy url use everywhere when url is set in config. (#63286)

In addition to trying the configured url (for ex, a migrated
'https://galaxy.ansible.com/') there is an attempt at that
URL with '/api' postpended.

If the extended URL works, update GalaxyAPI.api_server to
use the extended URL. Previously it only used it for finding
the API root info ('available_versions', etc)

(cherry picked from commit ed203c5902)
5 years ago
Jill R 37b4a5089e [2.9] Fix STS assume role error message when role does not exist (#63307)
* Fix STS assume role error message when role does not exist (#63249)

AWS appears to have changed this error message again.
Fixes https://app.shippable.com/github/ansible/ansible/runs/145643/115/tests

* [2.9] Fix STS assume role error message when role does not exist

* fix changelog sanity
5 years ago
Sam Doran e05938e05e [stable-2.9] cronvar - use correct binary name (#63279) (#63338)
* [stable-2.9] cronvar - use correct binary name (#63279)

Fixes regression introduced by #62554
Add integration tests for cronvar.
(cherry picked from commit 9d014778ad)

Co-authored-by: Sam Doran <sdoran@redhat.com>

* cron: add integration tests (#59830)

* cron: add integration tests

Use faketime in order to reduce waiting time. Using opensuse15
container:

    Tuesday 30 July 2019  23:03:19 +0000 (0:00:05.410)       0:01:28.291 **********
    ===============================================================================
    cron : install cron and faketime packages ------------------------------ 78.65s
    cron : wait 70 seconds max ---------------------------------------------- 5.41s
    Gathering Facts --------------------------------------------------------- 0.97s
    cron : enable cron service ---------------------------------------------- 0.72s
    cron : Use faketime with cron service ----------------------------------- 0.71s
    cron : command ---------------------------------------------------------- 0.41s
    cron : create directory for cron drop-in file --------------------------- 0.41s
    cron : add cron task ---------------------------------------------------- 0.40s
    cron : command ---------------------------------------------------------- 0.25s
    cron : command ---------------------------------------------------------- 0.25s
    cron : include_vars ----------------------------------------------------- 0.06s

* cron test, simplify: use Environment instead ExecStart

Thanks to mscherer for the suggestion.

* clean up comment: remove reference to outdated path

$OUTPUT_DIR is a plain path which doesn't reference any other
environment variables

* cron test: display elapsed time

* cron test: display some logs in case of failure

* cron test: handle FreeBSD

* cron tests: add checks

(cherry picked from commit 3c8abc0b82)
5 years ago
Matt Clay d0a4f0fdbe [stable-2.9] Add RHEL 8.1b to the Shippable test matrix.
(cherry picked from commit 811127d64d)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Davis 6e0eafa3a7 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

(cherry picked from commit fd229dcbb5)
5 years ago
Adrian Likins 6cdd8e5fc2 Add support for automation-hub authentication to ansible-galaxy (#63031)
Adds support for token authentication in Automation Hub. Fixes: ansible/galaxy-dev#96

(cherry picked from commit 239d639fee)
5 years ago
Matt Clay c4446a8f2e [stable-2.9] 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`.
(cherry picked from commit b91f452f4f)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay d69852c890 [stable-2.9] Install zip for unarchive test when using dnf.
(cherry picked from commit 86ae3cfa12)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay f004deaf91 [stable-2.9] 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.
(cherry picked from commit 022335669c)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 24e64d1ba1 [stable-2.9] 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.
(cherry picked from commit 4c79f1ec4d)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago