* ansible-galaxy - support resolvelib versions >= 0.5.3, <= 0.8.1
Test incompatibilities are removed for resolvelib >= 0.6.0
Test against the latest 0.8.x version and fix requirements
* Fix tests - use a venv for testing the range of resolvelib versions
* Update temporary hardcoded fallback for ansible-test
* Update hardcoded upperbound for sanity tests
* Make error check more flexible
(cherry picked from commit 143e7fb45e)
* Fix ansible-galaxy traceback when unexpected version of resolvelib is installed (#77630)
* Fix traceback when a supported version of resolvelib is not installed
Try to read the supported version range from the package distribution info and fall back to a hardcoded lowerbound/upperbound (>=0.5.3,<0.6.0).
* Add tests for unsupported resolvelib versions
* Resolve remaining import sanity test issues.
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 82f3a57bee)
* Fix boolean condition so that ansible-galaxy collection install works when a valid resolvelib is installed. (#77906)
(cherry picked from commit 6fbc8bd2bc)
* ansible-galaxy - ensure variable is defined for any error when getting the ansible-core distribution (#77993)
(cherry picked from commit db335498d0)
Co-authored-by: Felix Fontein <felix@fontein.de>
* `importlib.util` appears to be lazily imported and is sometimes unavailable as an attribute of `importlib` without an explicit import
(cherry picked from commit 6e78425f8d)
* apt: fix virtual package install version detection
Change 4a62c4e3e4 introduced version
matching in installation.
The problem stems from
if version_installable or version:
pkg_list.append("'%s=%s'" % (name, version_installable or version))
When the package is a virtual-package, package_status() is returning
the "version_installable" of the package *satisfying* the
virtual-package; but then this is trying to install the
virtual-package with this version pin.
For example, "yaml-mode" is a virtual package satisifed by
"elpa-yaml-mode" (currently 0.0.14-1) and trying to install it fails
with
$ usr/bin/apt-get -y ... install 'yaml-mode=0.0.14-1'
... failed: E: Version '0.0.14-1' for 'yaml-mode' was not found ...
In the case of a virtual-package with nothing installed to satisfy it,
we should just return blank values to allow apt-get to do it's thing.
The tests are updated to install and remove this package.
Fixes: #76779
(cherry picked from commit e4c0bbf885)
Co-authored-by: Ian Wienand <iwienand@redhat.com>
* If there is a platform specific handler, prefer the resolved module over the resolved action when loading module_defaults
Add a toggle for action plugins to prefer the resolved module when loading module_defaults
Allow moving away from modules intercepted as actions pattern
Fixes#77059
(cherry picked from commit 621e782ed0)
* winrm, psrps added missing var entry
this handles issue with the default being set to inventory_hostname
but defaults not being templated implicitly
fixes#77841
(cherry picked from commit eecbaee7f4)
* make the pre-flight sniffing more robust to different failure conditions (was failing on Ubuntu 22.04 VMs)
* remove skip aliases (the test needs to function everywhere to assert that the selinux facts bits behave properly when it's N/A)
(cherry picked from commit 4ff10fcd31)
* Fix 'ansible-config dump --only-changed -t all' to only display headers if plugin options are changed
* changelog
* add a test
(cherry picked from commit 1214b63f4f)
* ansible-test - Backport `InternalError`
NOTE: This is a partial backport, including only one new class.
(cherry picked from commit b960641759)
* ansible-test - Fix subprocess management. (#77641)
* Run code-smell sanity tests in UTF-8 Mode.
* Update subprocess use in sanity test programs.
* Use raw_command instead of run_command with always=True set.
* Add more capture=True usage.
* Don't expose stdin to subprocesses.
* Capture more output. Warn on retry.
* Add more captures.
* Capture coverage cli output.
* Capture windows and network host checks.
* Be explicit about interactive usage.
* Use a shell for non-captured, non-interactive subprocesses.
* Add integration test to assert no TTY.
* Add unit test to assert no TTY.
* Require blocking stdin/stdout/stderr.
* Use subprocess.run in ansible-core sanity tests.
* Remove unused arg.
* Be explicit with subprocess.run check=False.
* Add changelog.
* Use a Python subprocess instead of a shell.
* Use InternalError instead of Exception.
* Require capture argument.
* Check for invalid raw_command arguments.
* Removed pointless communicate=True usage.
* Relocate stdout w/o capture check.
* Use threads instead of a subprocess for IO.
(cherry picked from commit 5c2d830dea)
* ansible-test - Add support for remote Ubuntu VMs.
(cherry picked from commit 6513453310)
* ansible-test - Fix remote completion validation.
(cherry picked from commit e2200e8dfc)
* ansible-test - Add multi-arch remote support.
(cherry picked from commit 2cc74b04c4)
* ansible-test - Enhance the shell command. (#77734)
* ansible-test - Add shell --export option.
* ansible-test - Support cmd args for shell command.
Also allow shell to be used without a valid layout if no delegation is required.
* ansible-test - Improve stderr/stdout consistency.
By default all output goes to stdout only, with the exception of a fatal error.
When using any of the following, all output defaults to stderr instead:
* sanity with the `--lint` option -- sanity messages to stdout
* coverage analyze -- output to stdout if the output file is `/dev/stdout`
* shell -- shell output to stdout
This fixes issues two main issues:
* Unpredictable output order when using both info and error/warning messages.
* Mixing of lint/command/shell output with bootstrapping messages on stdout.
* ansible-test - Add changelog fragment.
(cherry picked from commit fe349a1ccd)
* ansible-test - Fix remote args restriction.
The platform-specific and global fallbacks were not working with the `--remote` option.
This regression was introduced by https://github.com/ansible/ansible/pull/77711
(cherry picked from commit 76ead1e768)
* docs: update porting guide for ansible 6.0.0b1 (#77913)
(cherry picked from commit 7c89562580)
* docs: add missing notes in porting guide for 6.0.0b1 (#77926)
There was an issue with the changelog in community.network 4.0.0, it's
been fixed in 4.0.1 and now properly included.
(cherry picked from commit 9f7956ba30)
* Remove platform dev guides from core docs (#77915)
(cherry picked from commit f3c684564c)
* Migrate community.vmware Dev Guide to collection (#77723)
(cherry picked from commit b69eb28ed2)
* Issue #77681 revamp getting started guide (#77897)
(cherry picked from commit 89e4fb71e6)
* ssh retry docs addition (#77930)
(cherry picked from commit 15750aec52)
* fix: update button text to "Load token" (#77925)
(cherry picked from commit 16e0d4a121)
* fix bad merge conflict resolution
Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Mario Lenz <m@riolenz.de>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: Dan Kolepp <10145457+dkolepp@users.noreply.github.com>
* ansible-test - Add RHEL 9.0 remote support.
* Add RHEL 9.0 to CI. (#77853)
* Add RHEL 9.0 to CI.
* Restrict network manager inspection to RHEL8
* Skip module tests when astream_name is undefined, undefine it for RHEL9 until 9.1
* Remove redundant test.
Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 43d650f924)
* Include test fix from https://github.com/ansible/ansible/pull/77847
* Remove statement about dependencies and includes. Fixes#75055 (#77912)
(cherry picked from commit a2eb472fb6)
* doc: Clarify stride/increment in inventory intro (#77893)
(cherry picked from commit 9010f0fbe3)
* Remove double spaces in errormessage (#77839)
(cherry picked from commit 711b51fad6)
* add anchors for crossreferencing (#77800)
(cherry picked from commit a99623bce1)
* [docs]Mention that global variables are not mapped to hostvars (#77783)
(cherry picked from commit 74469bf54a)
* Point to Kerberos as a safer winrm setup method (#77794)
(cherry picked from commit 45d930e9c1)
* more context on multiple facts modules (#77896)
(cherry picked from commit dbbeea0686)
Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: rawtaz <rawtaz@users.noreply.github.com>
Co-authored-by: Wouter Schoot <wouter@schoot.org>
Co-authored-by: Sergei Petrosian <30409084+spetrosi@users.noreply.github.com>
Co-authored-by: TheBigBear <TheBigBear@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
* stub out ovirt dev guide with pointer to new location (#77751)
(cherry picked from commit 5e22fe21fd)
* Docsite/communication.rst: fix formatting (#77760)
(cherry picked from commit 97e574fe6e)
* Updated the playbook section in this docs (#77747)
(cherry picked from commit 42086c14a3)
* 2.13 GA has been bumped up a week to release on May 16 (#77772)
(cherry picked from commit 75bc630565)
* Fix plugin dev examples (#77759)
* Fix plugin dev examples
* Update docs/docsite/rst/dev_guide/developing_plugins.rst
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 9923e92d97)
* docs: Update ansible-core release date in Ansible roadmap (#77775)
(cherry picked from commit 235f2598b1)
* revamp basic concepts docs (#77748)
(cherry picked from commit 8e91403412)
* core-2.13 - update release table (#77780)
(cherry picked from commit 6230244537)
* clarify Ansible EOL details (#77778)
* clarify Ansible EOL details: update docs/docsite/rst/reference_appendices/release_and_maintenance.rst
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 654fff05e6)
* Update url to quickstart video. (#77779)
(cherry picked from commit f75bb09a8b)
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Desmond Obisi <51109125+DesmondSanctity@users.noreply.github.com>
Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Mario Lenz <m@riolenz.de>
Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Tabah Baridule <dulemartins07@gmail.com>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
* Docsite: move a stepped down steering committee member to past members (#77715)
(cherry picked from commit a1ddb83fc1)
* add collection pr review checklist (#77661)
Co-authored-by: Emmanuel Ugwu <32464178+ugwutotheeshoes@users.noreply.github.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
(cherry picked from commit ef2fe6823c)
* clarify latest release (#77577)
* clarify latest release
* fix tables
(cherry picked from commit f633b62cbc)
* typo in doc (#77672)
(cherry picked from commit c71faec595)
* Docs: `ansible-test sanity` example with a folder
##### SUMMARY
The docs mentions explicitly that you can run the tests against certain files which might not relay that it works on folders too!
Let's make this clear :)
##### ISSUE TYPE
- Docs Pull Request
+label: docsite_pr
(cherry picked from commit 52bd59c481)
* docs: update porting guide for ansible 6.0.0a2 (#77736)
(cherry picked from commit 0cfc291573)
* simplify developing modules (#77647)
(cherry picked from commit 255745b3e6)
* Mention admin requirement for runas become (#77722)
(cherry picked from commit dd094a4413)
* core branch descriptions (#76152)
(cherry picked from commit d352f2ec21)
* Fix ansible-test import analysis warning.
Fix overlooked in https://github.com/ansible/ansible/pull/68372/
(cherry picked from commit 77732ed50d)
* Revert "Fix ansible-test import analysis warning."
This reverts commit 676f1056cb.
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Kristian Heljas <11139388+kristianheljas@users.noreply.github.com>
Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
* docs: Update porting guide for ansible 5.7.0 (#77646)
(cherry picked from commit 709ae7c050)
* remove import_play examples from include module (#77597)
(cherry picked from commit d321fa3f15)
* trim down to use sanity test docs requirements file (#77612)
* trim down to use sanity test docs requirements file
* add requirements back
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update docs/docsite/rst/community/documentation_contributions.rst
(cherry picked from commit a65fbfad5b)
* Typo fix (#77648)
(cherry picked from commit cf5f0690f0)
* Update guide_vultr.rst (#77665)
(cherry picked from commit f6fb402d1f)
* add select distro installs to docs (#77567)
(cherry picked from commit 096393a221)
* community_steering_committee.rst: add new member (#77589)
(cherry picked from commit 3cbfee7852)
* clarify latest release (#77577)
* clarify latest release
* fix tables
(cherry picked from commit f633b62cbc)
* typo in doc (#77672)
(cherry picked from commit c71faec595)
Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: deosrc <deosrc@g-de.co.uk>
Co-authored-by: Jan-Piet Mens <jp@mens.de>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* Prevent losing unsafe from lookups
This patch fixes a bug which under certain conditions results in data
returned from lookups not being marked as unsafe.
Each time Templar.do_template is invoked a new AnsibleContext is
created and stored effectively at two places:
1) as an instance variable in templar_obj.cur_context
2) as a local variable called new_context in do_template method of Templar
Due to custom functionality in Ansible's Context that allows for nested
templating it is possible that during resolving variable's value
template/do_template method is called recursively again, again creating
a new context. At that point the problem manifests itself because as
mentioned in 1) above the context is overwriten on the templar object
which means that any subsequent calls to _lookup will use the new
context to mark it as unsafe which is now different to the local
new_context which is used for testing for unsafe property.
The solution to the problem appears to be to restore the original
context inside do_template and also to eliminate the local variable
new_context to prevent problems in the future.
It appears that we don't have a better way of storing the context other
than as some form of global variable and so this appears to be the
"best" solution possible at this point. Hopefully data tagging will be
the solution here.
For more examples see unit and integration tests included in this patch.
Fixes#77535
(cherry picked from commit 3980eb8c09)