Commit Graph

52696 Commits (97c8da77838e93b416c5e700abafa89a8383e950)
 

Author SHA1 Message Date
Sandra McCann 271097434b
set current version to 6 (#78110) 2 years ago
Sandra McCann 16970567bf
update conf.py for Ansible 6 release (#78049) (#78109)
(cherry picked from commit e8a77626a3)
2 years ago
Sandra McCann d9f999f1c3
update release page to reflect Ansible 6 release (#78047) (#78108)
Co-authored-by: Iheanacho Amarachi Sharon  <58210919+Iheanacho-ai@users.noreply.github.com>
(cherry picked from commit a9ce358f98)
2 years ago
Sandra McCann 45920f1d2e
docs: Update porting guide for Ansible 6.0.0 (#78101) (#78106)
(cherry picked from commit 1b63e7d3fa)

Co-authored-by: Ompragash Viswanathan <ompragash.viswanathan@gmail.com>
2 years ago
Sandra McCann f09e6b7769
Backportapalooza 06 16 (#78072)
* Docsite: Updated style guide resources (#78048)

(cherry picked from commit 561cf1956d)

* Create reusable role layout snippet for documentation (#78057)

* reuse role structure
* reuse role snippet in role docs

(cherry picked from commit f4ad1c771e)

* Docsite: update links to community docs (#78043)

(cherry picked from commit 46d86a882d)

* Windows - incorrect python-devel package in WinRM docs (#78037)

Co-authored-by: Emanuele Barbato <manu@Giuseppes-MacBook-Air.local>
(cherry picked from commit 681dc6eab9)

* issue #72449 winrm script rm (#77931)

(cherry picked from commit 3cd2c494bd)

* reword the regex note (#75393)

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
(cherry picked from commit 66c0882314)

* Document debconf interaction with dpkg-reconfigure (#74196)

Signed-off-by: David Greaves <david@dgreaves.com>
(cherry picked from commit 5b90601ca4)

Co-authored-by: Lewis Brogan <ilewisbrogan@gmail.com>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Emanuele Barbato <30394740+emanuelebarbato@users.noreply.github.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: David Greaves <david@dgreaves.com>
2 years ago
Dimitri Savineau 739fb490c7
Update Ansible release version to v2.13.1.post0. (#78095) 2 years ago
Dimitri Savineau e9f633ec72
New release v2.13.1 (#78086) 2 years ago
Dimitri Savineau 34203f6b56
Update Ansible release version to v2.13.1rc1.post0. (#78044) 2 years ago
Dimitri Savineau d34ba977fb
New release v2.13.1rc1 (#78033) 2 years ago
Sandra McCann fa898f4fcc
Docs Backportapalooza 06 09 (#78020)
* Move AWS guidelines to collection (#77959)

(cherry picked from commit 0ff1ba3e12)

* docs: Update porting guide for ansible 5.9.0 (#77982)

(cherry picked from commit f9d4c26143)

* docs: Update porting guide for ansible 6.0.0rc1 (#77991)

(cherry picked from commit a30500144e)

* Fix docs links for the steering committee (#77974)

(cherry picked from commit ca9be6e27e)

* Add macOS fork issue to FAQ (#77965)

* Add macOS fork issue to FAQ

* Remove colon from error msg

(cherry picked from commit 0fae2383da)

* Docs: change community collection inclusion process (#77905)

(cherry picked from commit e589eba506)

* update backport instructions to reflect stable-2.13 (#77958)

Co-authored-by: Divine Odazie <dodazie@gmail.com>
(cherry picked from commit 85329beb90)

* mention different results for password_hash depending on library used (#76863) (#77963)

(cherry picked from commit fa840d4c7c)

* Rephrase-community (#77985)

(cherry picked from commit 556ac89664)

Co-authored-by: Mario Lenz <m@riolenz.de>
Co-authored-by: Ompragash Viswanathan <ompragash.viswanathan@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Philippe Kueck <philfry@users.noreply.github.com>
Co-authored-by: Bennykillua <67695793+Bennykillua@users.noreply.github.com>
2 years ago
Sloane Hertel cf5c0c9b06
ansible-galaxy - support resolvelib versions >= 0.5.3, < 0.9.0 (#77649) (#78008)
* 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)
2 years ago
Matt Clay 44e249df3a
[stable-2.13] Update AZP test container to 3.0.0. (#78022)
(cherry picked from commit 1321d6ecd5)
2 years ago
Sloane Hertel 977c2480db
[2.13] Fix ansible-galaxy traceback when unexpected version of resolvelib is installed (#77901)
* 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>
2 years ago
Matt Davis 3957913485
fix pip module resolution (#78000) (#78006)
* `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)
2 years ago
Brian Coca be9c208cb4
apt: fix virtual package install version detection (#76781) (#77909)
* 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>
2 years ago
Sloane Hertel 63a0860231
Add toggle to fix module_defaults with module-as-redirected-action on a per-module basis (#77265) (#77899)
* 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)
2 years ago
Brian Coca f80f58903b
Fix windows connection options (#77844) (#77894)
* 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)
2 years ago
Felix Fontein 02104472e2
Update PSF-license.txt to version from CPython 3.9.5. (#77805) (#77829)
(cherry picked from commit 201aba3d0f)
2 years ago
Joseph Torcasso e5e3bc849d
template/__init__.py - fix KeyError when wantlist=False with non-list (#77824)
(cherry picked from commit c9ce7d08a2)
2 years ago
Matt Davis 9796d055b9
fix SELinux facts tests (#77707)
* 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)
2 years ago
Brian Coca f02e870b1b
dont rely on path to set config defs for plugins (#77659) (#77694)
(cherry picked from commit a3cc6a581e)
2 years ago
Sloane Hertel f026e3dcf9
Fix 'ansible-config dump --only-changed -t all' verbosity (#77898) (#77922)
* 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)
2 years ago
Sloane Hertel 0c76edb63a
Pin PyYAML version compatible with Python 3.8+ (#77936) (#77986)
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit e89176caac)
2 years ago
Sloane Hertel 68c2f09ae8
[2.13] fix ansible-galaxy-collection integration test (#77992)
* ansible-galaxy-collection - use --pinentry-mode loopback for gpg key revocation (#77967)

(cherry picked from commit 1706d35fc4)

* fix ansible-galaxy-collection test with revoked key (#77989)

* Remove unnecessary gpg passphrase

(cherry picked from commit a43112290a)
2 years ago
Matt Clay 6291280ef8
[stable-2.13] Make fuzzy plugin matching deterministic. (#77997)
(cherry picked from commit 5a0b230e24)

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Clay 567a295c00
[stable-2.13] ansible-test - Adjust unit test mock usage. (#77961) (#77999)
(cherry picked from commit 23914d3f0b)

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Clay ae380e3bef
[stable-2.13] ansible-test - Multiple backports (#77951)
* 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)
3 years ago
Sandra McCann f3b56ec661
Backportapalooza 06 02 (#77960)
* 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>
3 years ago
Matt Clay 2ac74197af [stable-2.13] ansible-test - Prefer unittest.mock for core.
(cherry picked from commit 81351022d8)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 44ce9fe998 [stable-2.13] ansible-test - Fix shell target options handling.
(cherry picked from commit f933314101)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 2b6df9ea36
Add RHEL 9.0 to ansible-test and CI. (#77923)
* 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
3 years ago
Sandra McCann e6b16ddeb5
Docs backportapalooza 05 26 (#77921)
* 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>
3 years ago
Sandra McCann c45ba4f9ca
docs: Update porting guide for ansible 5.8.0 (#77843) (#77859)
(cherry picked from commit 059204b871)

Co-authored-by: David Moreau Simard <moi@dmsimard.com>
3 years ago
Sandra McCann 8d99c1cc0c
docs: Update porting guide for ansible 6.0.0a3 (#77842) (#77858)
(cherry picked from commit 66e92a3aff)

Co-authored-by: David Moreau Simard <moi@dmsimard.com>
3 years ago
Matt Clay 46a1eb6832 [stable-2.13] Prefer unittest.mock over mock. (#77886)
(cherry picked from commit 2595b42aca)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 47e1cc38fd [stable-2.13] Use unittest.mock instead of mock. (#77883)
This can only be done for controller tests.
(cherry picked from commit 3a9a23fb1a)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 93b8ccda21 [stable-2.13] Avoid deprecated method in unit tests.
(cherry picked from commit 5f74350fd5)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
David Schmidt 006ea84f70
Update Ansible release version to v2.13.0.post0. (#77809) 3 years ago
Dimitri Savineau ad609fa57e
New release v2.13.0 (#77799) 3 years ago
Sandra McCann d0d1cc9e54
05 12 backportapalooza (#77787)
* 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>
3 years ago
Sandra McCann 256641b780
set stable-2.13 to latest (#77798) 3 years ago
Sandra McCann 0d1d1b74b3
update version switcher to include 2.13 (#77786) (#77795)
(cherry picked from commit f5642cea28)
3 years ago
Sandra McCann 14f64ae38f
core-2.13 - update release table (#77780) (#77785)
(cherry picked from commit 6230244537)
3 years ago
Sandra McCann a6d7eb8710
[docs][backport] 5 06 docs backportapalooza (#77749)
* 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>
3 years ago
Sandra McCann a07e3eb45b
4 28 docs backportapalooza (#77686)
* 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>
3 years ago
samccann f4f1f772c1 [stable-2.13] shift to ansible_core_version
(cherry picked from commit 7471c036ec)

Co-authored-by: samccann <samccann@redhat.com>
3 years ago
Christian Adams 511389ef3a
Update Ansible release version to v2.13.0rc1.post0. (#77718) 3 years ago
David Schmidt f282306b1b
New release v2.13.0rc1 (#77717) 3 years ago
Martin Krizek 89e6dcda26
Prevent losing unsafe from lookups (#77609) (#77650)
* 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)
3 years ago
Christian Adams 8f1c25d154
Update Ansible release version to v2.13.0b1.post0. (#77634) 3 years ago