Commit Graph

9595 Commits (a4e9291f869deb405e4c7229b4e09c36fce64f2c)

Author SHA1 Message Date
Abhijeet Kasurde 4acad228f0
[bp-2.9] firewalld: Ensure idempotency (#74992)
Fixes: https://github.com/ansible-collections/ansible.posix/issues/179

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Brian Coca 8b17e5b922
fix unsafe preservation across newlines (#74960) (#74976)
CVE-2021-3583
  ensure we always have unsafe

Co-authored-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit 4c8c40fd3d)
5 years ago
Sam Doran 88eb0f1dfb
Skip task for CentOS 8 as well (#74913)
Something change in the packages that was failing on RHEL
a few weeks ago. Now it is failing in CentOS 8 as well
5 years ago
Rick Elrod 4f0e584ea4
[2.9] [tests] add websocket-client constraint, python 2 (#74750)
Change:
- websocket-client >= 1 requires python 3, so add constraint for python
  2.

Test Plan:
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>

* avoid a mysql_variables check on rhel 8

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Sam Doran 6fe7640fa5 [stable-2.9] Disable rabbitmq integration tests 5 years ago
Matt Clay c310830553
[stable-2.9] CI and compat fixes for Jinja2 >= 3.0 (#74666) (#74672)
* [stable-2.9] CI and compat fixes for Jinja2 >= 3.0 (#74666)

* Add constraint for MarkupSafe

MarkupSafe >= 2.0.0 requires Python >= 3.6.0. Add a constraint for older Python versions
and fix the `groupby_filter` test.

* Fix template_jinja2_latest test.

* patch filter decorators on newer Jinja2

* Jinja2 >= 3.0 renames several filter decorators used by Ansible itself, as well as by filters in collections. This patch ensures that the old names are usable within Ansible and by collections without warnings or errors.

* Ignore docs-build issues.

* Remove unnecessary ignore.

* Disable failing nuage_vspk test.

* Fix inventory_aws_conformance integration test.

(cherry picked from commit f99d024851)

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <mrd@redhat.com>.
Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Matt Clay d8d20a2ff9 [stable-2.9] Fix ansible-test AZP build lookup.
(cherry picked from commit 877e5b3dfe)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 6afac6878c [stable-2.9] Remove obsolete Shippable specific scripts.
Also remove some other unncessary code from CI scripts..
(cherry picked from commit be7de9844e)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Rick Elrod fb177b3878
shift a few CI groups [2.9] (#74553)
ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Sam Doran 9380d74c02
[stable-2.9] incidental_setup_rabbitmq test - Use official repo for rabbitmq-erlang (#74453)
Previously it was hosted on bintray, but that service is shutting down on May 1. Using the new
repository also required using a newer version of RabbitMQ..
(cherry picked from commit 62cba4a6ad)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Matt Clay 14036d154d [stable-2.9] Fix pypi-test-container port conflict.
(cherry picked from commit cb7f4f1971)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Rick Elrod d4a3d6cd0a
[ansible-test] Sync opensuse containers with 2.10 (#74436)
* [ansible-test] Sync opensuse containers with 2.10

Change:
- OpenSuSE 15.1 is now EOL
- Switch containers to use what 2.10 uses, which has 15.2.

Test Plan:
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>

* docker version

Signed-off-by: Rick Elrod <rick@elrod.me>

* needs p7zip-full, otherwise we only get 7zr

Signed-off-by: Rick Elrod <rick@elrod.me>

* Make sure py2 stays py2

Signed-off-by: Rick Elrod <rick@elrod.me>

* no wildcard?

Signed-off-by: Rick Elrod <rick@elrod.me>

* -x instead of --xml

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Martin Krizek e8c1c1d636
Actually run blocks/finalized_task test (#74291) (#74310)
(cherry picked from commit 7fecb7ccc3)
5 years ago
Matt Clay dfe3a4d345
[stable-2.9] Fix ansible-test docker container IP detection. (#74390)
(cherry picked from commit 14ff5e213c)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Sam Doran 4b23ac77e1 Disable failing hcloud_server test 5 years ago
Matt Clay 225709ca20
[stable-2.9] Switch to hashlib.sha256() for ansible-test (#72411) (#74170)
When FIPs mode is enable on centos-8, we are not able to load md5
functions.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
(cherry picked from commit a95213d2f5)

Co-authored-by: Paul Belanger <pabelanger@redhat.com>

Co-authored-by: Paul Belanger <pabelanger@redhat.com>
5 years ago
Gonéri Le Bouder f4ec55b2d8
[stable-2.9] validate_modules: fails with .id attribute not found (#73322) (#74179)
* validate_modules: fails with .id attribute not found

This patch addresses a problem in the `found_try_except_import` test.

This module tries to identify lines like:

`HAS_FOO = True`

In this case, the target (`HAS_FOO`) is of type `ast.Name` and has a
`id` attribute which provide the name.

In my case, I've a line that set a module attribute`. In this case, the
target (`module.var`) has the type `ast.Attribute` and no `id`
attribute. The code trigger an `AttributeError` exception.

This patch ensures we compare a `ast.Name`.

* Update test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/main.py

(cherry picked from commit 7cf80f50d1)
5 years ago
Sam Doran cc97479f9d
[stable-2.9] ansible-test - ensure trailing separator is added for connection unit test target (#74176) (#74182)
For connection units tests, if the `__init__.py` file is modified, the trailing separator was
not added, making the target invalid.
(cherry picked from commit 7b79b69369)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Matt Clay 3155c8c26c
[stable-2.9] Add PyPI proxy container for tests on Python 2.6.. (#74206)
(cherry picked from commit becf941673)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Sam Doran 0d668b6046
[stable-2.9] find - set proper default based on use_regex (#73961) (#73966)
When using "use_regex: yes" and setting an excludes: without
specifying a pattern: the existing code passes the file-glob '*' to
the regex matcher.  This results in an internal invalid-regex
exception being thrown.

This maintains the old semantics of a default match-all for pattern:
but switches the default to '.*' when use_regex is specified.

The code made sense as-is before excludes: was added (2.5).  In that
case, it made no sense to set use_regex but *not* set a pattern.
However, with excludes: it now makes sense to only want to exclude a
given regex but not specify a specific matching pattern.

Closes: #50067

* moved change to new location
added changelog

* Update lib/ansible/modules/find.py

Co-authored-by: Ian Wienand <iwienand@redhat.com>.
(cherry picked from commit 089d0a0508)

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

* Update fix_find_default.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
5 years ago
Matt Davis f8caa43dc7
add optional module_utils import support (#73832) (#73916)
Treat  core and collections module_utils imports nested within any Python block statement (eg, `try`, `if`) as optional. This allows Ansible modules to implement runtime fallback behavior for missing module_utils (eg from a newer version of ansible-core), where previously, the module payload builder would always fail when unable to locate a module_util (regardless of any runtime behavior the module may implement).

* sanity test fixes

ci_complete

(cherry-picked from 3e1f6484d7)
5 years ago
Matt Martz 1592c8b0fd
[stable-2.9] Ensure task from the worker is finalized/squashed (#73881) (#73929)
* Ensure task from the worker is finalized/squashed. Fixes #57399. Fixes #49942
(cherry picked from commit 832631b)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Rick Elrod 9052b0e7f2
[security] Add more missing no_logs (#74115)
Change:
- Add missing no_log on fields and subfields which should have it.
- Update several changelogs with CVE id.

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Matt Clay 7fa32b9b44 [stable-2.9] Fix ansible-test coverage exporting.
(cherry picked from commit b75844af45)
5 years ago
Mark Chappell 84e61b32f8 Ensure unit test paths for connection and inventory plugins are based on the context (#73877) 5 years ago
Sam Doran 21eac8aba4 Move file needed by cs_volume test to S3
There is a bad mirror missing the file and it is causing tests to fail.
5 years ago
Rhys d0703a8c7d
Update mongodb replicaset check_compatibility function (#72299)
* Update check_compatibility function
5 years ago
Felix Fontein 68f32e43c1
Backport of https://github.com/ansible-collections/community.docker/pull/88 to stable-1. (#73816) 5 years ago
Sam Doran 35c3b3d42d
[stable-2.9] Add AlmaLinux to the family of Red Hat-like operating systems (#73541) (#73544)
* Add changelog and fixtures for AlmaLinux support

Co-authored-by: Christoph Schug <com+github@schug.net>.
(cherry picked from commit 2f5c83dfb1)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Matt Martz 4c503fe3b1
[stable-2.9] Don't treat host_pinned as lockstep (#73484) (#73513)
* [stable-2.9] Don't treat host_pinned as lockstep (#73484)

* Don't treat host_pinned as lockstep. Fixes #73364

* Add intg tests.
(cherry picked from commit d3f3784b86)

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

* Make non-lockstep callback tests more deterministic (#73511)

(cherry picked from commit 125c220343)
5 years ago
Felix Fontein fc4c154a8e
Backport of 8702713ac3 (#73638) 5 years ago
Gonéri Le Bouder cf53554cf5
[ansible-test] attempt to work around podman (#72096) (#73570)
Change:
- podman > 2 && < 2.2 does not support "images --format {{json .}}"
- podman also now outputs images JSON differently than docker
- Work around both of the above.

Test Plan:
- Tested with podman 2.0.6 in Fedora 31.

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit 0332046699)
5 years ago
Gonéri Le Bouder 462edf003e
ansible-test: yamllint, check the assigment (#73584)
Ensure `yamllint`'s `check_assignment()` correctly ignore the
attribute assignment. Those don't have any `.id` attribute and will
trigger an `AttributeError` exception.

See: https://github.com/ansible/ansible/pull/73322
(cherry picked from commit 0a8d5c0983)
5 years ago
Matt Martz 0d20c829a2
[stable-2.9] Normalize ConfigParser between Python2 and Python3 (#73715) (#73724)
* [stable-2.9] Normalize ConfigParser between Python2 and Python3 (#73715)

* Normalize config parser between py2 and py3

* Add tests and changelog

* Use different config entry, since we supply certain env vars.
(cherry picked from commit 950ab74758)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Sam Doran 5a9f4f7bb3 Move win_uri to a group that does not reboot the test instance
Another test in group3 reboots the test instance, killing the ssh connections
needed for access to the httptest container.

ci_complete
5 years ago
Sam Doran 733704f97e Rebalance Windows test groups to avoid timeouts 5 years ago
Sam Doran 55a3f2e1eb Update signing key used in incidental_setup_flatpak_remote tests
The original key was created using the default expiration time of two years.
Signed the repo again using a key that expires in twenty years.
5 years ago
Ashwini Mhatre 67e0d9a481
[stable-2.9]:Fix IOSXR integration test (#73607)
* Fix integration testcase in netconf_config for iosxr
5 years ago
Rick Elrod 83fc193cb6
[mongodb tests] Wait for ports in TIME_WAIT (#73655)
Change:
- The latest mongodb we install causes processes to not die correctly
  (they end up as zombies), and this causes the ports they listen on to
  be held in TIME_WAIT. We need to wait for them to fall out of
  TIME_WAIT before we can continue and use them again.

Test Plan:
- CI
- Local playing in containers

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Matt Clay b20547af70 Fix cryptography install in ansible-test.
This fix is based on https://github.com/ansible/ansible/pull/73530/
5 years ago
Andrew Klychkov 069311bff3
postgresql_query: fix datetime.timedelta type handling (#73520) 5 years ago
Jordan Borean 49ebd509df
no_log mask suboption fallback values and defaults CVE-2021-20228 (#73487) (#73493)
(cherry picked from commit 0cdc410dce)
5 years ago
Rick Elrod d268891703
[setup_rpm_repo test] Ensure rpm-build is present (#73516) (#73515)
Change:
- Other targets might remove rpm-build as they clean up after
  themselves. Ensure that it's present in setup_rpm_repo because
  rpmfluff needs it.

Test Plan:
- Local experimentation with yum_repository and mysql_db (the latter of
  which depends on a handler which was removing rpm-build) on
  stable-2.9.

Signed-off-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit aca5b0e43b)
5 years ago
Sam Doran e3c08d001d
[stable-2.9] pause - adjust warning when run in background (#73182) (#73230)
When the pause module is run in the background and seconds parameter is provided,
do not warn.

* Add tests
* Fix existing tests
  The test wasn't failing when it should have.
(cherry picked from commit 0e6c334115)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Sam Doran 3361517fa9
[stable-2.9] facts - properly report virtualization facts for Linux guests on bhyve (#73204). (#73234)
(cherry picked from commit df451636e7)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Andrew Klychkov 2b217c9c9b
postgresql_set: Return a message when a passed parameter has not been found (#73286)
Co-authored-by: Andrew Klychkov <andrew.klychkov@gmail.com>
5 years ago
Sam Doran 0435079477
[stable-2.9] Fix YAML error message when error is at the end of the file (#73241) (#73297)
If a YAML file fails to load due to a syntax error in a file, or there is an error in the last line of a
file, PyYAML reports the last line number of the file as the index where the error occurred.

When reading the file lines, we use that index to the get the relevant line.  If the index value is out
of range, the relevant line is lost for error reporting.

Subtract one from the index value to avoid the IndexError in this specific scenario. It is possible
to still get an IndexError, which will be handled as it is currently.

* Update existing tests and add new tests
(cherry picked from commit e8d4b62b41)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Martin Krizek 65fdc41fb1
Local vars should have highest precedence in AnsibleJ2Vars (#72830) (#73369)
Ability to add local variables into AnsibleJ2Vars was added in
18a9eff11f to fix #6653. Local variables
are added using ``AnsibleJ2Vars.add_locals()`` method when creating a
new context - typically when including/importing a template with
context. For that use case local template variables created using
``set`` should override variables from higher contexts - either from the
play or any parent template, or both; Jinja behaves the same way.

Also removes AnsibleJ2Vars.extras instance variable which is not used.

Also adds missing test for #6653.

Fixes #72262
Fixes #72615

ci_complete

(cherry picked from commit a2af8432f3)
5 years ago
Andrew Klychkov 6f4ea2f19e
postgresql_query: fix decimal handling (#73414)
Co-authored-by: Andrew Klychkov <andrew.klychkov@gmail.com>
5 years ago
Sloane Hertel d8a82154d4
[2.9] Fix warning for nonexistent inventory cache (#72840) (#73444)
* Fix inventory cache warning by checking if the key exists before loading it

(cherry picked from commit 840bdc1e10)
5 years ago