Commit Graph

6621 Commits (bade98dc8f2cc7c5e41f44f75d70a88187932bc7)

Author SHA1 Message Date
Matt Martz 7c31e6b1c0
[stable-2.15] Check if skeleton is /dev/null while creating home folder (#75948) (#82103)
* Check if skeleton is /dev/null while creating home folder

* Add test for linux



(cherry picked from commit 25b3d3a)

Co-authored-by: Holger Dörner <42909210+HolgerDoerner@users.noreply.github.com>
1 year ago
Brian Coca fdbdc2ae35
restore role param precedence (#82106) (#82139)
* add test for setfact/param override

(cherry picked from commit 20a54eb236)
1 year ago
Brian Coca 5623783bcf
ansible-pull: expand destinantion directoy to avoid purgin in / (#82030) (#82222)
* expand destinantion directoy to avoid purgin in /

  bad things could happen and help alone is not enough

(cherry picked from commit 8825e60add)
1 year ago
Brian Coca 23cd32e31e
wait_for, fallback to read for non mmapable files (#82064) (#82234)
* wait_for, fallback to read for non mmapable files (#82064)

(cherry picked from commit 8b102dca4a)
1 year ago
Brian Coca 5b5c26c644
no_log avoid masking booleans (#82217) (#82236)
* no_log avoid masking booleans (#82217)

(cherry picked from commit 6e448edc63)
1 year ago
Brian Coca 0ef9984918
Restore import_role variable exporting behavior (#81840) (#81873)
* Import role public (#81772)

revert to previous behavior to push vars to play at compile time
add `public` parameter to allow per import control of exporting (vs just the global config)

Co-authored-by: tchernomax <maxime.deroucy@gmail.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit ab6a544e86)

* adapted to prev version

 - removed new functionality
 - restored global config functioning overriding specific public option

* remove typoe

* quote it

(cherry picked from commit 9a4bc7e7b3)
1 year ago
Martin Krizek 3e2ce2d073
[stable-2.15] run_once: unnotify hosts on handlers that are not run (#81667) (#81919)
Fixes #81666
(cherry picked from commit 2d5861c)
1 year ago
Martin Krizek a05d254ca2
[stable-2.15] Properly template tags in parent blocks (#81624) (#81922)
When templating tags (which happens outside of standard `post_validate`) we
need to template each object in the inheritance chain and set the templated
values on those objects individually. That way when `task.tags` is called the
`extend` functionality properly picks up the templated values of all
parents into one flatten list.

Fixes #81053
(cherry picked from commit 9b3ed5e)
1 year ago
Brian Coca 8896db97ed
Fix Jinja plugin deduplication (#82002) (#82054)
for j2 plugins dedupe on path and  not basename
for j2 this is a container file , for other plugins file name == plugin name

(cherry picked from commit b4566c18b3)
1 year ago
Matt Clay 9aeced838f [stable-2.15] Fix subversion integration test (#82029)
- Remove dependency on the htpasswd module (and thus passlib)
- Fix setup/teardown of the httpd process
- Fix cleanup of temporary directories.
(cherry picked from commit 09d943445c)

Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Jordan Borean 92447debff
win_fetch - improve test time by not scanning Win dir (#81884) (#81887)
(cherry picked from commit dfc62589f6)
1 year ago
Sviatoslav Sydorenko ccb00b74fe
[backport][stable-2.15] Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree (#81747)
* Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree

PR #81606.

Prior to this patch, when `--pre` CLI flag was not passed, the
dependency resolver would treat concrete collection dependency
candidates (Git repositories, subdirs, tarball URLs, or local dirs or
files etc) as not meeting the requirements.

This patch makes it so pre-releases in any concrete artifact
references, and the ones being specifically pinned dependencies or
user requests, met anywhere in the dependency tree, are allowed
unconditionally.

This is achieved by moving the pre-release check from
`is_satisfied_by()` to the `find_matches()` hook, following the
Pip's example.

As a bonus, this change also fixes the situation when a collection
pre-releases weren't considered if it didn't have any stable releases.
This now works even if `--pre` wasn't requested explicitly.

Finally, this patch partially reverts commit
6f4b4c345b, except for the tests. And it
also improves the `--pre` hint warning to explain that it mostly
affects Galaxy/Automation Hub-hosted collection releases.

Ref #73416
Ref #79112
Fixes #79168
Fixes #80048
Resolves #81605

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit 7662a05085)

* Shorten the collection namespace and name @ tests

This is needed on the 2.15 branch which uses older galaxy containers
that have restricted FQCN size.
1 year ago
Matt Martz f71190068b
[stable-2.15] Add compat function for parsing Content-Disposition header (#81807) (#81828)
* py2 compat for get_param

* Add tests, and handle ValueError

* Add clog frag
(cherry picked from commit 831dc6e)
1 year ago
Martin Krizek 2a29739ee6
Allow for searching handler subdir for included task via include_role (#81733) (#81758)
Fixes #81722

(cherry picked from commit 1e7f7875c6)
1 year ago
Sloane Hertel 8f621fd6cd
Only mark a role as complete once a task in it executes for the target host (#81565) (#81668)
* If all tasks in the role are skipped or unreachable, the role is not marked as complete for the host.

* Only mark the role as complete if a task in the role succeeds or fails for the host.

(cherry picked from commit 8034651cd2)
1 year ago
Matt Davis 5888674946
fix various Jinja plugin caching issues (#79781) (#81643)
* fix various Jinja plugin caching issues

* consolidate the wrapper plugin cache
* remove redundant cache in J2 filter/test interceptor

* intra-template loader bypass

* fix early exits swallowing some exception detail

* misc comment cleanup

(cherry picked from commit dd79c49a4d)
1 year ago
Matt Martz 1e930684bc
[stable-2.15] Prevent roles from using symlinks to overwrite files outside of the installation directory (#81780) (#81785)
* Sanitize linkname during role installs

* Add tests

* add clog frag.
(cherry picked from commit ddf0311c63)
1 year ago
Matt Martz 6bae9486b1
[stable-2.15] tarfile: Handle deprecation warning for extract and extractall (#81545) (#81632)
* Python 3.11.4 introduces a new parameter 'filter' in extract and
extractall in tarfile. Handle deprecation warning message emitted
in Python 3.12.
* added probing mechanism in ansible-galaxy code to detect broken
data filter implementation in tarfile.

Fixes: #80832



(cherry picked from commit 1cc5efa)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Klaus Frank ac8188febd
first_found fix no terms option (#76550) (#81451)
For backport without the fix for multiple items clobbering previous settings

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
1 year ago
Martin Krizek caf8cdbe91
include_role: expose vars from parent roles to role's handlers (#81524) (#81548)
Fixes #80459

(cherry picked from commit 98f1627817)
1 year ago
Brian Coca ebe6c7e1c3
filters vault/unvault fix vault_id parameter usage (#81422) (#81448)
* vault/unvault filters, fixed id field to match documented.

fixes #81420

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f3a15a4a95)
1 year ago
Jordan Borean daa2d9b8fd
PowerShell - remove uneeded dotnet code for future compatibility (#81472) (#81577)
(cherry picked from commit f3976117fb)
1 year ago
Martin Krizek febd0f3a69
Last handler with same name wins for listen too (#81358) (#81525)
Fixes #49371
Fixes #81013

(cherry picked from commit 0cba3b7504)
1 year ago
Matt Martz 733f6542de
[stable-2.15] Revert logic to use Popen.communicate (#80874) (#81517)
* [stable-2.15] Revert logic to use Popen.communicate (#80874)

* Back out use of communicate, add better comments, add bufsize, and align with subprocess._communicate

* tests

* re-order logic slightly

* more comments

* loopty loop

* yet another comment

* Revert "yet another comment"

This reverts commit 96cd8ada5fa0441b92f2298bdaa6cb40594847d2.

* Revert "loopty loop"

This reverts commit 96ea066f6a7d18902c04a14f18dd79b38e56f5e7.

* ci_complete

* Copy in comment too

* Wording updates

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

* Back out bufsize

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>.
(cherry picked from commit 553f51e728)

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

* Address merge conflict issues
1 year ago
Matt Clay 697af6ba33
[stable-2.15] ansible-test - Always use managed entry points (#81537) (#81539)
(cherry picked from commit 390e508d27)
1 year ago
Sloane Hertel 20cd618bc8
password_hash - fix bcrypt algorithm when passlib is not installed (#81385) (#81425)
(cherry picked from commit f5431321a2)
1 year ago
Sloane Hertel 85a3eb272a
[2.15] Consider all configured collection paths when installing collections (#81324)
* Consider all configured collection paths when installing collections (#81243)

* Only install collections which can't be satisfied by a collection in any of the configured paths.

* Improve warning for unexpected collection install path

Fix warning when path is configured, but is a pip-managed path

Normalize the path before validating to fix warning consistency

(cherry picked from commit efbc00b6e4)

* Update warning patch for version 2.15 due to non-existence of the config GALAXY_COLLECTIONS_PATH_WARNING
1 year ago
Matt Clay 5d57a8e363
[stable-2.15] Omit pre-built man pages from sdist (#81395) (#81397)
Since man pages aren't accessible to users after a `pip install`, there's no need to include them in the sdist.
This change makes it trivial to build man pages from source, which makes them much easier to iterate on.
It also simplifies creation and testing of the sdist, since it no longer requires building man pages.

The new `packaging/cli-doc/build.py` script can generate both man pages and RST documentation.
This supports inclusion on the docs site without a dependency on `ansible-core` internals.
Having a single implementation for both simplifies keeping the two formats in sync..
(cherry picked from commit 691c8e8603)
1 year ago
Matt Clay 5421a1304c
[stable-2.15] Remove `docs` and `examples` directories (#81011) (#81232)
* Remove docs dir

* Updates to reflect docs removal

* Fix integration test

* Remove examples dir

* Updates to reflect examples removal

* Remove build_library and build-ansible.py

* Remove refs to build_library and build-ansible.py

* Remove obsolete template

* Remove obsolete template reference

* Remove the now obsolete rstcheck sanity test.
(cherry picked from commit 72e038e823)
1 year ago
Matt Clay 04e4280437
[stable-2.15] ansible-test - Fix sanity traceback with `-e` opt (#81271) (#81272)
Also remove redundant warning about missing programs.

Includes integration tests to verify `-e` does not traceback.
(cherry picked from commit 3f7bf0bcd4)
1 year ago
Matt Clay add8a968e8
[stable-2.15] ansible-test - Pre-build PyYAML wheels (#81300) (#81306)
This works around Cython failures when attempting to install PyYAML >= 5.4 <= 6.0..
(cherry picked from commit e964078a83)
1 year ago
Matt Clay c779af621e
[stable-2.15] Disable cron integration test on Alpine (#81301) (#81302)
The tests are now failing due to the lack of `libfaketime` in the Alpine repos.
(cherry picked from commit 261a12b8a9)
1 year ago
Sviatoslav Sydorenko a9c656f8f3
Replace `reboot_command` integration test with unit tests (#78956) (#81266)
Co-authored-by: Matt Clay <matt@mystile.com>

(cherry picked from commit b6ebb9d41a)
1 year ago
Matt Clay 2b2510b653
[stable-2.15] Use *.md instead of *.rst for test READMEs (#81009) (#81229)
(cherry picked from commit 6ac0ea3567)
1 year ago
Martin Krizek 0cd0788eac
Properly disable modularity tests for dnf5 only (#81195) (#81196)
(cherry picked from commit eb19692f48)
1 year ago
Martin Krizek 7b97a0232a
Re-introduce RHEL 9 modularity testing in CI (#81160) (#81192)
(cherry picked from commit 7b2647f3b2)
1 year ago
Martin Krizek 94a6f6e0de
Register handlers immediately if currently iterating handlers (#80898) (#81059)
This fixes the issue where handlers notifying other handlers are
not properly run because the notification is not registered unless
another flush_handlers occurs. Instead, if the current host state
is iterating handlers we immediately register the handler to be
run so the notification is not lost.

Fixes #80880

(cherry picked from commit 660f1726c8)

Co-authored-by: James Cammarata <jimi@sngx.net>
1 year ago
Matt Martz 130fdcd50e
[stable-2.15] Don't mutate templar.environment, only overlay on local myenv (#81005). (#81054)
(cherry picked from commit 73e04ef2d6)
1 year ago
Martin Krizek 7a61d9fb11
dnf5 - enable env groups testing in CI (#81032) (#81056)
Implemented in https://github.com/rpm-software-management/dnf5/pull/585

(cherry picked from commit f13e35cbf9)
1 year ago
Martin Krizek e5d4cb89f8
dnf5: enable now implemented cacheonly functionality (#81141) (#81145)
Note that this also fixes a traceback caused by backwards incompatible
change in dnf5 where cacheonly was changed from bool to string:
https://github.com/rpm-software-management/dnf5/pull/665/files#diff-ab65249ff7fccadfb2864b6826f6559f7f16fad43fd3bf2da0b4fe8db790d59aR179

(cherry picked from commit 0cc50e0673)
1 year ago
Abhijeet Kasurde 6bddb3d3c1
[bp/2.15] deb822_repository: use http-agent with open_url (#80894)
* Use http-agent in open_url API while getting
  cloudflare content

Fixes: #80809

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Martz 8fe49b6b35
[stable-2.15] URI Module find json sub type (#80745) (#80891)
* uri: fixed search for json types to include strings in the format xxx/yyy+json
(cherry picked from commit 0c7361d9ac)

Co-authored-by: Brent Barbachem <barbacbd@dukes.jmu.edu>
2 years ago
Martin Krizek 01000c622f
Account for overlays when interacting with Jinja envs (#80705) (#80718)
Instead of using Templar.environment in Templar.do_template for
accessing/mutating the environment, myenv local variable should be used
because it is the environment used for actual templating. It can either
point to Templar.environment or newly created environment overlay.

Fixes #80605

(cherry picked from commit 8cd95a8e66)
2 years ago
Martin Krizek c6fc345fb0
Fix calling v2_playbook_on_notify callback (#80585) (#80612)
Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 989a7d6951)
2 years ago
Sloane Hertel 4de262300b
ansible-galaxy - fix installing dir sources with a trailing path separator (#79110) (#80540)
* strip trailing path separator from type=dir sources

(cherry picked from commit 964e678a7f)
2 years ago
Sloane Hertel 2c35d46298
argspec - fix validating type for required options that are None (#79677) (#80542)
* Only bypass type validation for null parameters if the default is None. A default is mutually exclusive with required.

* Prevent coercing None to str type. Fail the type check instead.

(cherry picked from commit 694c11d5bd)
2 years ago
Martin Krizek c0b452c73c
Last handler defined runs, fix for roles (#79558) (#80495)
Fixes #73643
* clear_notification method and simplify ifs
* Deduplicate code
* Limit number of Templar creations
* Fix sanity
* Preserve handler callbacks order as they were notified

(cherry picked from commit 09dd80b4ec)
2 years ago
Matt Clay c7603bbb72
[stable-2.15] Replace validate-modules's semantic markup parser with antsibull-docs-parser (#80406) (#80432)
(cherry picked from commit 92c694372b)

Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Matt Clay 13cdec1f46
[stable-2.15] Extend ansible-doc test with more classic markup. (#80407) (#80431)
(cherry picked from commit 96f7fd5539)

Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Sloane Hertel 4fcf731ced
Fetch signatures from galaxy after the dependency resolver runs (#80334) (#80397)
Reduce the number of Galaxy API calls made during dependency resolution by fetching remote signatures afterwards, since these are not used in backtracking.

Reduce the verbosity to `-vvvv` (to match other Galaxy API calls) to see this activity.

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
(cherry picked from commit 460abe0cef)
2 years ago