Commit Graph

3745 Commits (3e2ce2d0737122d14827605c67fe3c18eb9bc12e)

Author SHA1 Message Date
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
Felix Fontein 9f2b37ad39
Make sure that values that should be strings are actually strings. (#81029) (#81057)
(cherry picked from commit 440b5fd040)
1 year ago
Matt Martz 2c5856d7bc
[stable-2.15] Resolve issues on python pre-3.10.6 with collection dirs longer than 100 characters (#81061) (#81072)
(cherry picked from commit 56b67cc)
1 year ago
Matt Clay 2f7465969e
ansible-test - Add Fedora 38 remote (#81157)
Also record a known issue for Fedora 37 remotes.
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
Matt Clay 30f3fc2335
[stable-2.15] ansible-test - Avoid using atexit module (#81096) (#81097)
(cherry picked from commit c3926268e2)
1 year ago
Matt Martz 3d9a1cfdc6
New release v2.15.1 (#81088) 1 year ago
Matt Martz de8eb87110
New release v2.15.1rc1 (#81036) 1 year ago
Matt Clay 85065d6b7d
[stable-2.15] Remove docs dir dependency from man page build (#81003). (#81022)
(cherry picked from commit b3f1290bcd)
2 years ago
Matt Martz 4536ef6303
[stable-2.15] Fix TypeError when installing subdir collections. Fixes #80943 (#80949) (#80950)
(cherry picked from commit 0982d5f)
2 years 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
Matt Clay 88042f98d6
[stable-2.15] ansible-test - local change detection without --fork-point (#79734) (#80899)
(cherry picked from commit a5bb4c7dee)

Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Matt Martz 94b97c9c0b
[stable-2.15] Update dnf5 module to handle API change for setting the download directory. Fixes #80887 (#80888) (#80889)
(cherry picked from commit 09387ea)
2 years ago
Matt Clay 6b1ba183eb
[stable-2.15] ansible-test - Fix traceback when mixing sources (#80801) (#80827)
* ansible-test - Fix traceback when mixing sources

* ansible-test - Refactor layout error handling

(cherry picked from commit b16041f1a9)
2 years ago
Matt Clay 6bce05fd4d
[stable-2.15] ansible-test - Fix handling of long timeouts (#80769) (#80772)
(cherry picked from commit aacab0633a)
2 years ago
Matt Clay 398841ba0d
[stable-2.15] ansible-test - Fix timeout handling (#80764) (#80765)
(cherry picked from commit 4c6aa70662)
2 years ago
Matt Clay 86efb07b59
[stable-2.15] ansible-test - Avoid use of deprecated utcnow (#80750) (#80757)
The timestamps are only used by ansible-test, not the junit callback, so this change only impacts ansible-test.

(cherry picked from commit fd341265d0)
2 years ago
Matt Clay 0b1b2c238a
[stable-2.15] pep517 backend - Copy symlinks when copying source (#80690) (#80700)
(cherry picked from commit 54576cd794)
2 years ago
Matt Martz 748096552f
New release v2.15.0 (#80799) 2 years ago
Matt Clay 5b1efaac29
New release v2.15.0rc2 (#80686) 2 years ago
Matt Clay e88a1a426f
ansible-test - Update default containers (#80685) 2 years ago
Matt Clay 6f4d3a7944
Backport setuptools fixes (#80684)
* Use package_data instead of include_package_data (#80652)

This resolves warnings generated by setuptools such as the following:

_Warning: Package 'ansible.galaxy.data' is absent from the `packages` configuration.

(cherry picked from commit 5ac292e12d)

* Set the minimum setuptools to 45.2.0 (#80649)

Also update the package-data sanity test to use the minimum setuptools version.

(cherry picked from commit 4d25e3d54f)
2 years ago
Sloane Hertel 6dd566b9bb
[ansible-galaxy] Fix installing signed collections (#80661) (#80665)
* Fix installing signed collections by using the fqcn, version, source, and type as a unique identifier.

Define __hash__ and __eq__ methods to handle Candidate/Requirement comparison excluding signatures which aren't fully populated until install time.

* Remove PinnedCandidateRequests since it is redundant now.

* Fix verifying against a signed remote when the keyring isn't configured

(cherry picked from commit d5e2e7a0a8)
2 years ago
Matt Martz 96c1a9346c
New release v2.15.0rc1 (#80639) 2 years ago
Matt Clay 3e846be696
[stable-2.15] ansible-test - Update pylint to 2.17.3 (#80632) (#80634)
(cherry picked from commit 372fc99686)
2 years ago
Martin Krizek 78eecfb9dc
dnf5: use new API to check package signatures (#80609) (#80622)
(cherry picked from commit 36df60e226)
2 years ago
Matt Clay 53fd504935
[stable-2.15] ansible-test - Use FreeBSD packaged setuptools (#80615) (#80616)
This will avoid issues during bootstrapping caused by breaking changes in setuptools.

(cherry picked from commit abc58c026b)
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
Martin Krizek 79751ed970
Use target of /usr/bin/dnf for dnf version detection (#80550) (#80593)
Fixes #80376

(cherry picked from commit 748f534312)
2 years ago
Matt Clay 82b47c8d5c
ansible-test - Update the default containers (#80560) 2 years ago
Matt Clay c49dd110ee
[stable-2.15] ansible-test - Update pylint to 2.17.2 (#80555) (#80557)
(cherry picked from commit ba47dd9ef4)
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
Matt Martz f90c7f1a7d
[stable-2.15] Implement checks, and backwards compat change, to move forward with UTF-8 only (#80370) (#80545)
(cherry picked from commit 0ee7cfb)
2 years ago
Matt Martz 1c16d871d6
New release v2.15.0b3 (#80537) 2 years ago
Sloane Hertel 86bcfec830
Validate task attributes with first finalized attrs after loop (#80476) (#80517)
* Validate task attributes `run_once` and `action` with finalized attrs after individual loop results

* Validate task attribute `ignore_unreachable` using individual loop results

Once there's a way to post validate only certain fields, we can use self._task.post_validate() instead

This replaces the fix introduced in https://github.com/ansible/ansible/pull/80051.

(cherry picked from commit bd6feeb6e7)
2 years ago
Matt Martz f7d2c41fa2
[stable-2.15] --syntax-check is only applicable to ansible-playbook. Fixes #80506 (#80507) (#80509)
(cherry picked from commit f3774ae)
2 years ago
Matt Clay 7ce3270f72
[stable-2.15] pep517 backend - Use correct import_module import (#80480) (#80501)
(cherry picked from commit e87802cf2c)
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
Felix Fontein 39efd7a151
Fix pull request URL in changelog. (#80465) 2 years ago
Matt Clay 352127ec2b
[stable-2.15] ansible-test - Add support for argcomplete 3 (#80482) (#80484)
(cherry picked from commit 0371ea08d6)
2 years ago
Matt Martz f27a4a4f5c
New release v2.15.0b2 (#80467) 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
Martin Krizek 8f0ddcba2c
dnf5: fix module/pkg names in the failed respawn msg (#80402) (#80434)
(cherry picked from commit 12ce7d2e4e)
2 years ago
Martin Krizek 856e0312ff
dnf5: use the logs API to determine transaction problems (#80401) (#80433)
(cherry picked from commit 8d5c250234)
2 years ago
Matt Martz 66ef54e83f
[stable-2.15] Only use the selectors code path when we are prompt matching (#79931) (#80400)
(cherry picked from commit 6d1e355)
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
Matt Martz 5a262ab510
New release v2.15.0b1 (#80395) 2 years ago
Felix Fontein 2f647e9617
Implement semantic markup support for Ansible documentation in validate-modules. (#80243) 2 years ago
Brian Coca 4b20191c52
list all tags (including never) when listing tags (#80309)
* Ensure we default to show all tags when listing tags

 'never' was being excluded by default,as it is not part of the 'run tags'
 runtime default ('all'). For listing we now add it to the default 'run tags'.
2 years ago
tu1h 043a0f3ee8
Fix run_once by instantly tiny post_validate (#78492) (#80051)
Signed-off-by: tu1h <lihai.tu@daocloud.io>
2 years ago
Felix Fontein 0e509ecf25
Support role extension for semantic markup. (#80305) 2 years ago
Martin Krizek a81b787a05
Add new dnf5 module (#80272) 2 years ago
Sloane Hertel 666188892e
fix using templated values for include/import role FA (#80320)
* fix using templated values for include/import role options 'public', 'allow_duplicates', and 'rolespec_validate'

* pass templated values without changing the instance

* Fix templating by setting always_post_validate to True and calling IncludeRole.post_validate() instead

ci_complete

* add changelog
2 years ago
Matt Martz d2f6ea4179
New deb822_repository module (#80018)
Fixes #77073
2 years ago
Matt Martz 9faf94468b
Enforce that `Display.display` requires a `str` (#80327)
* Enforce that Display.display requires a str

* clog frag

* ci_complete
2 years ago
Brian Coca bf74f390af
clog (#80336)
(cherry picked from commit 97c8da7783)
2 years ago
Jordan Borean fb6b90fe42
Improve Ansible.Basic.cs tempdir uniqueness (#80328)
* Improve Ansible.Basic.cs tempdir uniqueness

The current tempdir naming scheme can result in the same name if the
remote worker starts at the same time as another. By using the process
id it should add enough uniqueness to avoid this situation.

* Fix sanity issues

* Fix up compile issue on older hosts
2 years ago
Jordan Borean ba4505f5cb
Ansible.Basic - Improve temporary file cleanup process (#80293)
* Ansible.Basic - Improve temporary file cleanup process

* Add comment on struct value used
2 years ago
Matt Clay 8ce102f302
ansible-test - Remove macos/12.0 remote (#80319) 2 years ago
Wong Hoi Sing Edison 016b7f71b1
ansible-galaxy - support `resolvelib >= 0.5.3, < 1.1.0` (#80196)
* ansible-galaxy - support `resolvelib >= 0.5.3, < 1.1.0`

<https://pypi.org/project/resolvelib/1.0.1> released on 2023-03-09:

-   <https://github.com/sarugaku/resolvelib/blob/main/CHANGELOG.rst#101-2023-03-09>
-   <https://github.com/sarugaku/resolvelib/releases/tag/1.0.1>

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>

* Trigger CI by pinning resolvelib with latest version

Since resolvelib is pre-installed in our test containers, we should temporarily pin the latest version allowed to force the tests to run with that version. Once the tests have passed that commit can be reverted.

Please make those changes without force pushing, so that we keep the reference to the passing CI run. We can squash the commits when merging the PR so the temporary commits won't be in the final commit merged to the devel branch.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>

* https://github.com/ansible/ansible/pull/80196#discussion_r1136003637

Also test resolvelib with multiple supported versions.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>

* Revert "Trigger CI by pinning resolvelib with latest version"

This reverts commit 5518e5dbca.

---------

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2 years ago
Felix Fontein b398613120
Add support for plugin field in seealso. (#80212) 2 years ago
Matt Martz 42355d181a
Do not double calculate loops and `delegate_to` (#80171) 2 years ago
Felix Fontein fafb23094e
ansible-doc: fix broken seealso links in text output (#80280)
* Fix broken URLs.

* Also remove auto-generated description for modules outside ansible.builtin.
2 years ago
Felix Fontein 4ea50cef23
validate-modules: check_mode attribute and compare with supports_check_mode parameter (#80090)
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2 years ago
Felix Fontein 5388f6020a
validate-modules: support plugin see-also (#80244) 2 years ago
Matt Clay 6a6824f570
ansible-test - Update CloudStack test container (#80278) 2 years ago
Matt Martz 2ae013667e
ansible-galaxy collection install retry improvements (#80180)
* clog frag

* Fix retries so that each explicit call to _call_galaxy is retried for the correct number of attempts. Fixes #80174

* Extend retry logic to common URL related connection errors. Fixes #80170

* Extend retries to downloading artifacts

* Extend param docs for change

* Rework the exception handling

* Don't be overly broad, reduce to TimeoutError, and BadStatusLine for now

* _download_file needs to raise AnsibleError.orig_exc

* Remove unused import

* Add IncompleteRead

* Add socket.timeout for py39

* Add 502 to retry codes

* Move http error code checking first

* Use itertools.tee to replay the backoff_iterator instead of using a callable

* Actually set a CLI default of 60s for timeout, to prevent implicit galaxy from using 10s as default from Request.open

* Import typing

* fix type hints

* Use http.HTTPStatus instead of int HTTP error codes where feasible

* Split exception handling

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Add missing import

---------

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2 years ago
Felix Fontein a2dc5fcc7d
Implement semantic markup support for Ansible documentation in ansible-doc. (#80242) 2 years ago
Matt Clay bad8843124
ansible-test - Update git diff handling (#80202)
This change allows ansible-test to work with newer versions of git on AZP.
2 years ago
Sloane Hertel 6165dfea40
ansible-galaxy role info - fix unhandled AttributeError
* catch GalaxyError instead of its base class to ensure it will have a http_error attribute
2 years ago
Sloane Hertel b7a0e0d792
copy - fix check mode with remote_src=True (#78624)
* Don't create dest directory in check mode

uncomment existing test

Fix checking for file attribute changes in check mode and add a test
2 years ago
Matt Clay 31658031ed
ansible-test - Remove pointless comparison (#80168) 2 years ago
Martin Krizek cfa7acbc19
Raise an error on invalid FA.isa value (#80040)
Avoids bad definitions of playbook classes
2 years ago
Brian Coca a1bff416ed
paramiko connection now uses the correct source of data (#79704)
* paramiko connection now uses the correct source of data

* keep orig name

* added missing port to docs

* Update changelogs/fragments/paramiko_config.yml

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>

* test ansible_host templating

* added missing private_key_file

* removed all play_context fallbacks

* Update lib/ansible/plugins/connection/paramiko_ssh.py

Co-authored-by: Jordan Borean <jborean93@gmail.com>

* Update lib/ansible/plugins/connection/paramiko_ssh.py

Co-authored-by: Jordan Borean <jborean93@gmail.com>

---------

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2 years ago
Martin Krizek 694f12d01b
Avoid redundant unsafe wrapping in ansible_eval_concat (#80143)
The wrap_var is done in do_template for all concat functions after their
return.
2 years ago
Matt Clay 27287b40c0
ansible-test - Fix pylint error with old home dir (#80151) 2 years ago
Matt Clay 7c62cdeecd
Fix MANIFEST.in includes (#80147) 2 years ago
Brian Coca ca604513db
apt_repository, dont assume only missing apt-key will populate stderr (#79827)
fixes #79825
2 years ago
Brian Coca ff3ee9c4bd
ansible-inventory prevent duplicating host entries (#80059)
this happened after implementing limits we introduced a bug that a host would be duplicated if it existed in a group's children
2 years ago
Sviatoslav Sydorenko 8fec2d2a82
Add macOS 13 to CI and ansible-test (#79508)
*  Add macOS 13.2 to `ansible-test`

* 🧪 Replace macOS 12.0 with 13.2 in the CI matrix

* Skip `lookup_url` under macOS 13.2

This is due to https://wefearchange.org/2018/11/forkmacos.rst.html
that manifests itself as follows:

    TASK [lookup_url : Test that retrieving a url works] ***************************
    objc[15394]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
    objc[15394]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in t
    he fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
    ERROR! A worker was found in a dead state

* 📝 Extend ansible-test change note w/ macOS 13.2
2 years ago
Sam Doran 292c70368b
unarchive - log errors from underlying commands (#75329)
* unarchive - log errors from underlying commands

When a command run by the module fails, log the errors if debugging is enabled.

* Use debug() method
2 years ago
Sam Doran a56428de11
unarchive - properly handle relative path for `dest` (#75267)
* unarchive - properly handle relative path for dest

* Add integration test

* Return output of underlying commands with increased verbosity

* Revert "Return output of underlying commands with increased verbosity"

This reverts commit a2790c8275cdc5697b65670a0beffdc74b741bf6.

* Warn when a relative destination path was provided
2 years ago
Sloane Hertel b981a9dfcd
add a worker queue to get updates from the main results thread (#79886)
* Create a queue per WorkerProcess to receive intra-task updates
* Update `pause` action to use the worker queue
* Deprecate ConnectionBase()._new_stdin
* Add new `Display`  convenience method `prompt_until` to manage both controller- and worker-sourced prompting without cross-fork stdin sharing, in-worker mechanism to handle request-response over new worker queue.
2 years ago
Mark Chappell f64e79be41
sanity tests - ignore pre-release versions for deprecation comparisons (#79185) 2 years ago
Yaakov Selkowitz c028006aaf
Define all processor facts on s390x (#19755) (#79806)
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2 years ago
Matt Clay f587856beb
Remove straight.plugin dependency (#80084) 2 years ago
Matt Clay 6bfe6b899a
ansible-test - Fix vendoring support (#80074)
- Support loading of vendored Python packages.
- Exclude vendored Python packages from payloads.
2 years ago
Martin Krizek 3fd0e12571
Introduce Delegatable and Notifiable mixin classes (#80077)
* Introduce Delegatable and Notifiable mixin classes

* fix sanity

* fix sanity
2 years ago
Martin Krizek 6c3d2a4e51
Use FAs with inheritance only when applicable (#80026)
... and set default value of an attribute on an object
only in NonInheritableFA.

Fixes #79777

ci_complete
2 years ago
devon-mar 1108c0f331
Fix markdown in changelog fragment (#80065) 2 years ago
Matt Clay bca55d945b
ansible-test - Adjust vcenter test plugin behavior (#80063)
The previous change to the default mode of operation for the plugin is now limited to collections.

This enables easier testing of the plugin in core, so the previously removed tests have been restored.
2 years ago
Sviatoslav Sydorenko c05d813661
Fix #80020 typos confusing `pylint` for `pytest` (#80056) 2 years ago
Matt Clay 5e3db6e441
ansible-test - Show Python version before install (#80022)
Always indicate the Python version being used before installing requirements.
2 years ago
Matt Clay e6cffce0eb
ansible-test - Allow target prefixes to use `_` (#80021)
Integration test target prefixes defined in a `tests/integration/target-prefixes.{group}` file can now contain an underscore (`_`) character.
2 years ago
Matt Clay fe2732b91e
ansible-test - Support pylint assertion rewriting (#80020)
Add support for `pylint` assertion rewriting when running unit tests on Python 3.5 and later.
2 years ago