Jinja2-3.0.0 and 3.0.1 has a bug where undefined values cannot be
checked to see if they contain a value: https://github.com/pallets/jinja/issues/1448#issuecomment-846029509
We workaround this in two ways, either of which would be sufficient:
* Normalize the data so that choices is an empty iterable when it isn't
specified in the documentation. This is what antsibull-docs (and thus
documentation builds on 2.10+) do.
* Change the logic in the template to check whether choices exists
before checking containment. This better expresses the logic at that
point in the template (if there is a default value but there is not a
list of choices, then display the default in its own string) so it's
a good change to make as well.
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>
Due to the recent security incident, use our own copy hosted in S3
to mitigate future risk from running an arbitrary script downloaded from a
remote and untrtusted server.
(cherry picked from commit aa12af1d34)
Co-authored-by: Sam Doran <sdoran@redhat.com>
* [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>
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>
* [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>
* updates list of available versions for Ansible 3 (#74265)
(cherry picked from commit 126e9244c2)
* oops, also need to update pointer to latest
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
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>
* 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)
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>
This commit fixes the error for adding bridge
slaves: nmcli bridge-slave returns "Error: invalid or not allowed setting 'bridge-port'
This fix is related to #42460, #54617, and #68065
* changelog
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>
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)
* 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>
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>