Commit Graph

4079 Commits (a7e666829e9583cde3a4ea1e10871be29dcabc9c)

Author SHA1 Message Date
Matt Davis d8484f0af7
Update default test container Python to 3.12 and support for PyLint 3.0.1 (#81953)
* temporary PyLint plugin to mask 3.12 finalizer noise

* ansible-test - Default to Python 3.12 for base/default

* ansible-test - Update pylint requirements

* ansible-test - Remove obsoleted changelog entry

* Add changelog fragment for pylint work-around
9 months ago
Matt Martz 92d2c66db2
Remove py2 support from urls.py (#81880) 9 months ago
Jordan Borean 8a5ccc9d63
ansible-galaxy - fix traceback error for invalid req file (#81917)
Provide a better error message when encountering a YAML requirements file that is not a dictionary or list.

Fixes: #81901
9 months ago
Matt Clay 921efce43a
ansible-test - Remove more Python 2.7 / 3.6 support (#81898) 9 months ago
Abhijeet Kasurde c0eefa955a
docs: update error message (#81554)
* Reword the error message when the module fails to parse parameters
  in JSON format
* misc typo fixes

Fixes: #81188

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
9 months ago
Matt Davis c1343cc304
switch available_hosts to `frozenset` from `list` in ansible-inventory (#81870)
* major speedup large inventories, since it's consulted iteratively
9 months ago
Sloane Hertel debf2be913
optimize host_group_vars and vars plugin loading (#79945)
* Improve host_group_vars efficiency:

* normalize the basedir with `os.path.realpath()` once and cache it
* cache missing paths/files
* reduce the calls to `isinstance`

Add a couple more general improvements in vars/plugins.py get_vars_from_path():

* call `PluginLoader.all()` once for vars plugins and reload specific
  plugins subsequently
* don't reload legacy/builtin vars plugins that are not enabled

Add a test for host_group_vars and legacy plugin loading

Co-authored-by: Matt Davis <mrd@redhat.com>

* changelog

* Add a new is_stateless attribute to the vars plugin baseclass

update integration tests to be quieter and use the same test pattern

Fix deprecation and adjust test that didn't catch the issue (deprecation only occured when the value was False)

move realpath cache to host_group_vars (do not smuggle call state as instance data)

refactor under a single 'if cache:' statement

Call os.path.isdir instead of always calling os.path.exists first. Just call os.path.exists to differentiate between missing and non-directory.

remove call to super(VarsModule, self).get_vars()

use the entity name as the cache key instead of variable location

Remove isinstance checks and use a class attribute just in case any plugins are subclassing Host/Group

Replace startswith by checking index 0 of the name instead, since host/group names are required

* rename is_stateless to cache_instance to make it more clear what it does

* add plugin instance cache using the path to plugin loader

reduce loading stage option if a new instance isn't created

don't require a known subdir on PluginLoader instantiation for backwards
compatibility

rename attribute again

contain reading from/initializing cached instances to a plugin loader method

* Deprecate v2 vars plugins

* Refactor to use the cache in existing plugin loader methods

Rename the attribute again

Refactor host_group_vars with requested changes

Make changelog a bugfixes fragment

Add a deprecation fragment for v2 vars plugins.

Add type hints

* unbreak group_vars

* Apply suggestions from code review

* misc tweaks

* always cache instance by both requested and resolved FQ name
* add lru_cache to stage calculation to avoid repeated config consultation

* handle KeyError from missing stage option

---------

Co-authored-by: Matt Davis <mrd@redhat.com>
9 months ago
Martin Krizek 9b3ed5ec68
Properly template tags in parent blocks (#81624)
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
9 months ago
Abhijeet Kasurde 304e63d76e
Add family fallback for Amzn to register as RedHat (#81755)
* Add family fallback for Amzn to register as RedHat

Fixes: #80882

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
9 months ago
Martin Krizek 2d5861c185
run_once: unnotify hosts on handlers that are not run (#81667)
Fixes #81666
9 months ago
Sloane Hertel b3408ab80b
Fix dnf module crash for non-existent url (#81801)
* ci_complete ci_coverage
9 months ago
Matt Clay b7903669b4
ansible-test - Update distro containers (#81851)
* ansible-test - Update distro containers

* Update the alpine3 container to Python 3.11

* Update changelog
9 months ago
Matt Clay 20f17687da
ansible-test - Invoke container sleep through env (#81853) 9 months ago
Sviatoslav Sydorenko ec265ec08a
Bump `coverage.py` to v7.3.2 in `ansible-test` (#81844) 9 months ago
Martin Krizek e756e359e0
Remove deprecated JINJA2_NATIVE_WARNING env var (#81720)
Fixes #81714
9 months ago
Brian Coca ab6a544e86
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>
9 months ago
Sloane Hertel 7fab552563
Fix reporting role as not found when remote_data is None (#81829) 9 months ago
Abhijeet Kasurde 4d4c50f856
Provide more info about plugin in deprecation message (#81719)
Provide more information about plugin usage which needs to be
used instead of the deprecated plugin in the deprecation message.

Fixes: #80561

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
9 months ago
lukaslihotzki-f 27bbff7c22
Add count and mandatory_count parameters in regex_replace filter (#81775) 9 months ago
Jordan Borean f22231de20
winrm - make command input more resiliant (#81538)
* winrm - make command input more resiliant

* Expand warning message
9 months ago
Martin Krizek 60c9660952
Add intentional tests for dnf install rpm when higher version is installed (#81740)
* Add intentional tests for dnf install rpm when higher version is installed

* ci_complete ci_coverage
9 months ago
Matt Martz ddf0311c63
Prevent roles from using symlinks to overwrite files outside of the installation directory (#81780)
* Sanitize linkname during role installs

* Add tests

* add clog frag
9 months ago
Hungtsetse 51f2ddd445
Extend mount info (#81768) 9 months ago
Val 91f94fb59d
Daemonize follow-up fixes (#81584)
* Ensure binary data transmission in daemonize

* Add changelog fragment
9 months ago
Matt Clay 3794612832
ansible-test - Skip pylint test on Python 3.12 (#81706) 9 months ago
Brian Coca 2aef0406d4
ansible-galaxy fix scm dependency error (#81599)
* ansible-galaxy fix scm dependency error

  also changed usage of 'virtual colleciton' to actual type
  avoid error by filtering out virtual collections that dont have
expected properties

simplified as per webknjaz

* Update lib/ansible/galaxy/collection/__init__.py
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
10 months ago
Matt Martz 7c7385521e
Harden the ansiballz and respawn python templates (#81753)
Harden our python templates for respawn and ansiballz around str literal quoting
10 months ago
Brian Coca 9edf64eaeb
Deprecating paramiko options in base config (#81593)
* Deprecating paramiko options in base config

 they exist in the plugin itself since 2.14

* clog
10 months ago
Martin Krizek 1e7f7875c6
Allow for searching handler subdir for included task via include_role (#81733)
Fixes #81722
10 months ago
Abhijeet Kasurde 86fd7026a8
Handle exceptions in interpreter discovery (#81745)
* Handle exceptions like AnsibleError, AnsibleConnectionFailure
  raise while interpreter discovery.

Fixes: #78264

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Carlos Camacho 9244b2bff8
Make sure paths are treated correctly when building collection files manifest (#81619)
* Make sure paths are correct when building collection files manifest

This commit makes sure the path of the files part of
the collection build manifest are correct.

This commit uses os.path.commonprefix instead of
dealing with strings.

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>

Bugfix Pull Request
Fixes: #81618

* Revert the change note type to `minor_changes`

* Clarify the change note with user-oriented details

---------

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
10 months ago
René Moser e4b9f9c6ae
tests: update CloudStack test container to version 1.7.0. (#81732) 10 months ago
Sviatoslav Sydorenko 7662a05085
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>
10 months ago
Abhijeet Kasurde 4b7705b07a
Remove deprecated APIs from ansible-doc (#81729)
* Removed add_collection_plugins
* Removed find_plugins

Fixes: #81716

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Matt Martz 3ec7a6e0db
Fix ansible-test issues with detecting docker host and forwarding ports (#81726)
* Properly detect docker host using ssh

* Disable ControlPath when creating SSH port forwards

* typo fix

Co-authored-by: Matt Clay <matt@mystile.com>

* Add clog frag

---------

Co-authored-by: Matt Clay <matt@mystile.com>
10 months ago
Abhijeet Kasurde 0ea40e09d1
vars: handle exception in combine_vars (#81700)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Matt Martz f7234968d2
bump devel to 2.17.0.dev0 (#81712) 10 months ago
Abhijeet Kasurde a1a6550daf
inventory_ini: Handle SyntaxWarning in ini parsing (#81707)
* handle SyntaxWarning ini inventory parsing

Fixes: #81328

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Abhijeet Kasurde 2793dfa594
reboot: show last error message in verbose log (#81578)
* The last error message is now presented in a verbose log

Fixes: #81574

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Abhijeet Kasurde 6f65397871
galaxy: check if the target for symlink exists (#81586)
* Symlinks in the collection might be pointing to non-existent
  targets. Check and report the failure to the user.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Felix Fontein 7f0baabbe0
blockinfile: avoid crash on Python 3 when creating directory fails (#81662)
* Avoid crash on Python 3.

* Add a test for the crash on Python 3
10 months ago
Abhijeet Kasurde e4468dc944
copy: print correct dest path when content + diff is used (#81678)
* when --diff is used with content parameter, print destination
  path instead of temporary file path.

Fixes: #79749

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Matt Clay 7d3d4572ed
Fix set filters to use set operations (#81639)
* Fix set filters to use set operations

* Fix integration tests

* Update filter documentation
10 months ago
Felix Fontein b1b029c6b5
ansible-doc: allow to filter by more than one collection (#81450)
Make collection filters more flexible for listing collections.
Co-authored-by: Maxwell G <maxwell@gtmx.me>
10 months ago
Sloane Hertel 8034651cd2
Only mark a role as complete once a task in it executes for the target host (#81565)
* 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.
10 months ago
Martin Krizek 3eb96f2c68
Lazy load Templar for [changed,failed]_when (#81650)
The `handler_templar` in `StrategyBase._process_pending_results` was
used for templating handler names which is no longer the case. Now it is
only used for templating `changed_when`/`failed_when`. To prevent
re-creating templars each time results are processed, just create it
on-demand when whens are processed.
10 months ago
Abhijeet Kasurde cd0aa35c19
encrypt: deprecate passlib_or_crypt (#81571)
* deprecate passlib_or_crypt in favor of do_encrypt

Fixes: #55839
10 months ago
Abhijeet Kasurde 6177888cf6
ansible-vault: Check if the destination is writable (#81660)
* Before performing shredding the original file, check if the
  destination file location is writable or not. This will
  prevent corruption of original file.

Fixes: #81455

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Martin Krizek a861b1adba
Replace ConfigParser.readfp() with read_file() (#81657)
* Replace ConfigParser.readfp() with read_file()

readfp was removed in Python 3.12.

Fixes #81656

* py2?

* Use PY3 for the python check
10 months ago
Matt Martz 3ec0850df9
Support packaging and importlib.metadata for pip module (#80881) 10 months ago
Matt Davis dd79c49a4d
fix various Jinja plugin caching issues (#79781)
* 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
10 months ago
Martin Krizek 4d40988876
Add type hints to ansible.utils.display::Display (#81400)
* Add type hints to ansible.utils.display::Display

Fixes #80841

* Avoid circular import

* Fix sanity

* type hint some of the functions of the module?

* Fix units

* Not sure about this

* Fix some of the issues from reviews

* Add changelog

* ...

* Update lib/ansible/utils/display.py

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

* remove py2 boilerplate

---------

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
10 months ago
Martin Krizek 24aac50369
utils/encrypt.py: remove unused private _LOCK (#81614)
Added in #15299, unused since #30160.

Fixes #81613
10 months ago
Abhijeet Kasurde 1cc5efa77b
tarfile: Handle deprecation warning for extract and extractall (#81545)
* 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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
10 months ago
Steffen Frömer ae69b280ad
Add short option for --ask-vault-pass (#80527)
Fixes: #80523
10 months ago
Matt Clay e1e0e2709c
ansible-test - Enable thread code coverage (#81604)
ci_complete
ci_coverage
10 months ago
Sviatoslav Sydorenko c59bcbe627
Bump `coverage.py` to v7.3.0 in `ansible-test` (#81077) 10 months ago
John HU 65a96daaf4
Fix typos in url lookup plugin options (#81587) 10 months ago
Aleksey Tsalolikhin bdaa091b33
Add warnings for illegal file names in role (#81555)
Co-authored-by: Aleksey Tsalolikhin <atsaloli.tech@gmail.com>
10 months ago
Brent Barbachem 4ab5ecbe81
dnf - fix for a package from URI and update_only (#81568)
Fixes #81376
10 months ago
Jordan Borean 7865b198d2
PowerShell - Improve error checking (#80984)
Improves the error checking when running PowerShell modules using
Ansible.ModuleUtils.Legacy. It will only return an rc of 1 if both the
PowerShell module runner signalled an error occurred and those error
records were present in the output. This should reduce some false
positive errors when using the older module style.
10 months ago
Jordan Borean f3976117fb
PowerShell - remove uneeded dotnet code for future compatibility (#81472) 10 months ago
Sam Doran 116948cd14
user - set current expiration correctly when no shadow entry exists (#75194) 10 months ago
Abhijeet Kasurde 2e6d849bdb
apt: ignore fail_on_autoremove and allow_downgrade when using aptitude (#81445)
* apt: ignore fail_on_autoremove and allow_downgrade when using aptitude

* fail_on_autoremove (--no-remove) and allow_downgrade (--allow-downgrades)
  parameters are only valid for apt-get and not for aptitude. Ignore them when
  aptitude is detected and used.

Fixes: #77868
10 months ago
swakeert 5deb4ee991
Remove duplicate FILE_ATTRIBUTES definition (#81494)
* Remove duplicated definition of the FILE_ATTRIBUTES constant in basic.py by importing it from the new location.
10 months ago
Sloane Hertel 194f829b0f
Fix pause CPU consumption (#81519)
* Sleep for the DEFAULT_INTERNAL_POLL_INTERVAL between polling for user input

Fixes #81516
11 months ago
Abhijeet Kasurde aa8a29a9d4
group: remove extraneous warning (#81557)
* remove extraneous warning shown when group does not exist

Fixes: #77049

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde 863e2571db
debconf: idempotency for password question (#81484)
* Gather value of password using debconf-get-selections command,
  use this information for idempotency.

Fixes: #47676

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Matt Clay f28e32c063
ansible-test - Limit deprecated check to core (#81552)
Using `# deprecated:` comment checks in collections would effectively limit those collections to a single version of ansible-core.
11 months ago
Caesarovich c69c83c962
Fix macos defaults (#79999) 11 months ago
Matt Clay 390e508d27
ansible-test - Always use managed entry points (#81537) 11 months ago
Martin Krizek a48feb4cfc
"retries" without "until": retry until success (#81531)
Fixes #20802
11 months ago
Martin Krizek 98f1627817
include_role: expose vars from parent roles to role's handlers (#81524)
* include_role: expose vars from parent roles to role's handlers

Fixes #80459
11 months ago
Matt Martz a2673cb564
Pre-calculate date early and use it for all zipfile writes (#81521)
* Pre-calculate date early and use it for all zipfile writes

Fixes #80089
Closes #80578
11 months ago
Martin Krizek 470f41b275
Deprecate STRING_CONVERSION_ACTION (#78860) 11 months ago
Matt Martz ca08261f08
Add ability to filter find on mode (#81485) 11 months ago
Martin Krizek 0cba3b7504
Last handler with same name wins for listen too (#81358)
Fixes #49371
Fixes #81013
11 months ago
Nikita Korolev bd3ffbe109
fix incorrect ansible_managed formatting (#79129)
Ansible breaks configs if file name could be parsed as jinja template
or contains `%` chars.
Especially `%n`[ame%] which is a line break pattern according to [strftime (3)](https://manpages.debian.org/bullseye/manpages-dev/strftime.3.en.html)
11 months ago
Abhijeet Kasurde 01469c558c
sanity: Document pep8 known issue with Python 3.12 (#81495)
The ``pep8`` sanity test may detect issues with f-strings on
Python 3.12, such as E201/E202, that are not detected under earlier
Python versions.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
11 months ago
Brian Coca f3a15a4a95
filters vault/unvault fix vault_id parameter usage (#81422)
* vault/unvault filters, fixed id field to match documented.

fixes #81420

Co-authored-by: Felix Fontein <felix@fontein.de>
11 months ago
Kristopher Newsome a1569ea4ca
iptables chain creation does not populate with a rule (#80257)
* iptables chain creation does not populate with a rule

fixes #80256

* Add changelog fragment

* Add rules and flush chain during integration tests

* Check chain rule on comment

* Update test/integration/targets/iptables/tasks/chain_management.yml
11 months ago
Abhijeet Kasurde f10d11bcdc
dpkg_selections: Check if package exists before selection operation (#81406)
* dpkg_selections: Check if the package exists before the selection operation

Fixes: #81404

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde 95fdd555b3
galaxy: Cross check the collection type (#81423)
* User-provided collection type might differ from collection
  source. Cross-check the type before proceeding

Fixes: #79463

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde c07652f42e
yum_repository: deprecate keepcache parameter (#81426)
* keepcache parameter can not be set in repository file
  instead it goes in yum.conf or dnf.conf

Fixes: #78693 

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Sloane Hertel f5431321a2
password_hash - fix bcrypt algorithm when passlib is not installed (#81385) 11 months ago
Sloane Hertel 2ebeb43d6f
ansible-galaxy - improve ignoring multiple signature status codes (#77610)
* ansible-galaxy - improve ignoring multiple signature status codes when using --ignore-signature-status-code

* fix backwards compatibility by adding a new plural option instead, and hide the singular from --help
11 months ago
Matt Clay c525514994
ansible-test - Update source layout detection (#81418) 11 months ago
Matt Clay 0c03a6bcf6
Add changelog fragment for docs/examples removal (#81410) 11 months ago
Abhijeet Kasurde 11e261b54f
CI: remove FreeBSD 12.4 from test matrix (#81315)
Fixes: #80417

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Matt Clay 691c8e8603
Omit pre-built man pages from sdist (#81395)
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.
11 months ago
Brian Coca 6d1f85bbe9
ansible-test: remove alpine 3.17 (#81124) 11 months ago
Matt Clay 081c60b9d3
Include subcommands in generated man pages (#81378)
Sub commands of `ansible-galaxy role` and `ansible-galaxy collection` are now documented.
11 months ago
Matt Clay 32b388b4ca
Fix missing command descriptions in manpages/docs (#81366) 11 months ago
Matt Clay f9d674fcfd
Fix command doc lookup in man page generation (#81365) 11 months ago
Matt Clay fead654671
Exclude internal options from man pages and docs (#81360) 11 months ago
Brian Coca 6db006a5fa
fix networking path (#81295)
* now uses class property instead of only relying on network_os variable

---------

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
11 months ago
Davide Sbetti d5d1c27bf3
Add option to blockinfile to wrap inserted block with blank lines (#81083)
* Add new blockinfile options 'prepend_newline' and 'append_newline' to wrap inserted block with blank lines
11 months ago
Sloane Hertel 4c41562270
remove deprecated datetime.datetime methods (#81323)
* Remove datetime.datetime.utcfromtimestamp and datetime.datetime.uctnow
  from controller code since they are deprecated in Python 3.12.

* Update target side code to use new utcfromtimestamp and utcnow utils in ansible.module_utils.compat.datetime that return aware datetime objects on Python 2.7 and 3.

Co-authored-by: Matt Clay <matt@mystile.com>
11 months ago
ERIK a5ccc0124f
Fix ansible_pkg_mgr is unknown in Kylin Linux (#81314)
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
11 months ago
denisecheng cd13812e32
Fix `ansible_pkg_mgr` incorrect in TencentOS Server Linux (#81336)
Signed-off-by: denisecheng <denisecheng@tencent.com>
Co-authored-by: denisecheng <denisecheng@tencent.com>
11 months ago
Matt Clay c8bc393871
Raise the minimum setuptools version to 66.1.0 (#81341)
* Raise the minimum setuptools version to 66.1.0

This is the first version to support Python 3.12.

While Python 3.10 and 3.11 could use an older version, a consistent minimum is easier to work with and test against.

* Fix PEP 517 integration test
11 months ago
Sloane Hertel 48dfe8e215
add Python 3.12 support to ansible-test (#80834)
* update docker containers versions to use newer ansible-test ref in the pre-built venvs

* Allow invoking ansible-test with Python 3.12

* Add python3.12 to the INTERPRETER_PYTHON_FALLBACK

* changelog

* add Python 3.12 as a non-default Python version for the test containers

* Update mypy ignores for Python 3.12

* Add Python 3.12 to CI matrix for unit tests, generic tests, and galaxy

* Update unit test for using the Python 2 collection loader path with Python 3.

Skip the existing test on Python 3.12, since find_module is removed.

Suppress the pre-existing deprecation warnings using the Python 2
codepath with Python 3.

Add a test for Python >= 3.12, which doesn't call find_module.

* Ignore sanity test errors on systems without libselinux present.
12 months ago
Sloane Hertel efbc00b6e4
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
12 months ago
René Moser 99eeaf7da8
ansible-test: cloudstack: bump test container version (#81319) 12 months ago
Sloane Hertel d20a0c02cc
ansible-test - update module_utils/urls.py unit test to support cryptography >= 41.0.0 (#81296) 12 months ago
Yuri Khan 371b62eab1
Add test for 256-color configuration values (#78613)
* Add test for 256-color configuration values

See #78607.

* color is not restricted to 16 choices

 currently supports up to 256, not listing them all
 TOOD: create examples and point to/list the basic 16

---------

Co-authored-by: Brian Coca <brian.coca+git@gmail.com>
Co-authored-by: Matt Clay <matt@mystile.com>
12 months ago
Matt Clay e964078a83
ansible-test - Pre-build PyYAML wheels (#81300)
This works around Cython failures when attempting to install PyYAML >= 5.4 <= 6.0.
12 months ago
Vlad Glagolev 894c339df8
Fix stealth exceptions and blocking select() in daemonize() (#81064)
* Fix stealth exceptions and blocking select() in daemonize()

* Add changelog entry
12 months ago
Matt Clay 765b2bd783
ansible-test - Narrow the scope of some sanity tests (#81273)
* ansible-test - Limit scope of replace-urlopen test

Only ansible-core code and plugins in collections can be expected to rely on module_utils.

* ansible-test - Limit scope of use-compat-six test

Only ansible-core code and plugins in collections can be expected to rely on module_utils.

* ansible-test - Limit scope of no-get-exception test

Only ansible-core code and plugins in collections should be checked for usage of outdated module_utils functions.

* Add integration tests
12 months ago
Matt Clay 3f7bf0bcd4
ansible-test - Fix sanity traceback with `-e` opt (#81271)
Also remove redundant warning about missing programs.

Includes integration tests to verify `-e` does not traceback.
12 months ago
Abhijeet Kasurde c5e54be5ea
apt: Return calculated diff while running apt clean (#81247)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
12 months ago
Abhijeet Kasurde c3015c5eb1
replace: handle exception while parsing escape char (#81244)
* replace: handle exception while parsing escape char

* Fail early when bad escape character is provided in replace module

Fixes: #79364

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Run tests in Python 3.6 or greater env

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
12 months ago
Brian Coca ee12bafe48
deprecate 'smart' connection value (#81218)
Co-authored-by: Jordan Borean <jborean93@gmail.com>
12 months ago
Sloane Hertel 59a791ee3b
ansible-test - remove Fedora 37 container and remote support (#81093) 12 months ago
Matt Clay 08307de366
ansible-test - Remove obsolete WinRM setup script (#81249)
The WinRM setup is handled internally by ansible-core-ci now.
12 months ago
Matt Clay 38e50c9f81
Convert non-docs *.rst files to *.md (#81217)
* Rename README.rst to README.md

* Change README format from reStructuredText to Markdown

* Fix whitespace in README.md

* Update setup.cfg to use README.md

* Replace changelog placeholder with README.md

* Update package-data sanity test
12 months ago
Brian Coca c7eca0e5c0
first_found lookup, let lookup handle templating errors (#81178)
* first_found lookup, let lookup handle templating errors

Avoids case in which TE was not sending valid and templatable entries to the lookup
The lookup already handles the case TE was attempting to itself, so no need for this code anymore.

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
12 months ago
Jordan Borean c3f479e378
Add type annotation for connection plugins (#78552)
* Add type annotation for connection plugins

* Use new | syntax instead of Union/Optional

* Fix pep issue

* Use ParamSpec and other minor fixes

* Fix up ParmaSpec args and kwargs type
12 months ago
Sloane Hertel 67b78a17c4
Remove Python 3.9 support for the controller (#80973)
* Remove obsolete Python <=3.9 controller code
* Remove Python 3.9 test controller bootstrapping
* Update test requirements

Co-authored-by: Matt Clay <matt@mystile.com>
12 months ago
Martin Krizek c3af71a2c8
dnf5: utilize automatic gpg check via transaction.run() (#81144)
https://github.com/rpm-software-management/dnf5/pull/607
12 months ago
Matt Clay 3d2ff64264
ansible-test - Fix import sanity test for targets (#81184) 1 year ago
Martin Krizek ca3ffbf4c2
ansible-test - remove test remotes: rhel 8.7/9.1 (#81065)
Fixes #80419
Fixes #80420
1 year ago
Sloane Hertel 73dde45f0f
ansible-galaxy - add pre-release hint to dependency resolution error (#81147)
* add pre-release hint to dependency resolution error if --pre wasn't provided

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
1 year ago
Norman Ziegner bcdb82992a
user - add parameter for password expiration warning days (#79884)
* user - add parameter to set number of warning days before password expires

Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
1 year ago
Martin Krizek 0cc50e0673
dnf5: enable now implemented cacheonly functionality (#81141)
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
1 year ago
Everson Leal 2f820381ea
Inventory Script Plugin: raise execution error (#81104)
It adds exception treatment when execute a inventory based on script with the --host argument

---------

Co-authored-by: Everson Leal <everson.leal@sonda.com>
1 year ago
Sloane Hertel e780b5e56d
ansible-galaxy - add config option for the default ansible-galaxy timeout (#81108)
allow configuring the default server timeout via env/ini
1 year ago
Brian Coca e22fe9be56
ansible-test add alpine 3.18 as remote (#81109)
* add crun to avoid runc
1 year ago
Matt Clay da2cd157f1
Fix arg splitting and key/value parsing (#80030)
* Improve readability of unit test output

This drops the trailing `-expectedXXX` suffixes from test names generated by parametrize.

* Add more splitter unit tests

This fills in code coverage gaps in the exising unit tests.

* Bug fixes and code cleanup

- Fix IndexError exceptions caused by parsing a leading newline, space or escaped space.
- Fix an AttributeError exception in `parse_args` when parsing `None`.
- Fix incorrect parsing of multi-line Jinja2 blocks, which resulted in doubling newlines.
- Remove unreachable exception handlers in the `parse_kv` function.
  The unreachable code was verified through analysis of the code as well as use of the `atheris` fuzzer.
- Remove unnecessary code in the `split_args` function.
- Add an optimization to `split_args` for the empty args case.

* Add unit tests for bug fixes

The splitter code is now fully covered by unit tests.

* Add another issue ref in changelog
1 year ago
Jordan Borean 98d1cf7aa2
Deprecate plural collections_paths option (#81063)
* Deprecate plural collections_paths option

* Fix test assumption
1 year ago
Brian Coca a7d2a4e032
display, also proxy warnings and deprecations (#81060)
Use generic proxy for display  methods with decorator
1 year ago
Brian Coca 38067860e2
template escaping: use configured variable start instead of default one (#81001)
this will handle escaping correctly in tempaltes that override the default jinja variable tokens
also fix optimization for single var path when overrides happen
1 year ago
Matt Clay c3926268e2
ansible-test - Avoid using atexit module (#81096) 1 year ago
Maxwell G bd5b0b4293
Avoid deprecated importlib.abc.TraversableResources (#81082)
* Avoid usage of deprecated importlib.abc.TraversableResources

This fixes ansible-compat test failures with Python 3.12.

* Add deprecated: marker for compat code

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

* add declarative deprecation comment to < 3.9 case

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Abhijeet Kasurde c69951daca
ansible-test: remove Ubuntu 20.04 LTS (#81070) 1 year ago
Abhijeet Kasurde bc68ae8b97
ansible-test: Added Fedora 38 (#81074) 1 year ago
Matt Martz 56b67cccc5
Resolve issues on python pre-3.10.6 with collection dirs longer than 100 characters (#81061) 1 year ago
Matt Martz 6fead15334
Pylint deprecated comment checker (#81071)
Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Brian Coca 534f688a53
remove Freebsd 13.1 from test matrix (#81058)
* remove Freebsd 13.1 from test matrix

fixes #80416


Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Martin Krizek cde15f3c81
Add test support for Python 3.11 on RHEL 8.8/9.2 (#80990)
Fixes #80412
Fixes #80413
1 year ago
Abhijeet Kasurde c1bc445aa7
ansible-test - Update openSUSE containers (#81062)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Sloane Hertel ecbbd7e5d1
Remove Python 3.5 support (#80972)
* Remove Python 3.5 support

* changelog

* add requested changes

* Update changelogs/fragments/remove-python3.5.yml

Co-authored-by: Matt Clay <matt@mystile.com>

* remove Python3 < 3.5 error handling

* remove Python3 < 3.5 error handling in TE too

---------

Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
James Cammarata 660f1726c8
Register handlers immediately if currently iterating handlers (#80898)
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
1 year ago
Matt Martz 73e04ef2d6
Don't mutate templar.environment, only overlay on local myenv (#81005) 1 year ago
Martin Krizek f13e35cbf9
dnf5 - enable env groups testing in CI (#81032)
Implemented in https://github.com/rpm-software-management/dnf5/pull/585
1 year ago
Felix Fontein 440b5fd040
Make sure that values that should be strings are actually strings. (#81029) 1 year ago
Vlad Glagolev faa6d55ee6
Fix Source Mage family mapping (#80985)
* Fix Source Mage family mapping

* Update docs too

* Add changelog fragment
1 year ago
Matt Clay b3f1290bcd
Remove docs dir dependency from man page build (#81003) 1 year ago
Martin Krizek 6fcbed0f3f
Simplify conditional.py (#80584)
* Simplify conditional.py
1 year ago
Holger Dörner 25b3d3a6f7
Check if skeleton is /dev/null while creating home folder (#75948)
* Check if skeleton is /dev/null while creating home folder

* Add test for linux

Co-authored-by: Holger Dörner <h.doerner@bitexpert.de>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
1 year ago
Vlad Glagolev c511a79172
Add simpleinit_msb fact for service_mgr (#80963)
* Add simpleinit_msb fact for service_mgr
1 year ago
Matt Martz 92d5ffda82
Update galaxy_ng container for tests (#80721) 1 year ago
Matt Clay 6e325d9e4d
Clean up MANIFEST.in (#80688)
* Remove unnecessary MANIFEST.in commands

This eliminates more setuptools warnings during build.

* Sort MANIFEST.in

Now that only include commands are used, the order of the commands no longer effects the build output.
1 year ago
Matt Martz 08a647214f
Indicate which args can be provided multiple times. Fixes #22396 (#80970) 1 year ago
Sloane Hertel 742d47fa15
replace deprecated ast.value.s with ast.value.value (#80968)
* replace deprecated ast.value.s with ast.value.value

the s attribute is deprecated since Python 3.8 and emits a warning in
3.12 causing some test failures
1 year ago
Matt Martz aa67d544fc
Handle unreachable errors in fetch properly. Fixes #27816 (#80952) 1 year ago
Matt Martz 0982d5fa98
Fix TypeError when installing subdir collections. Fixes #80943 (#80949) 1 year ago
Matt Clay 3a1d58bc58
ansible-test - Use raise from to handle exceptions (#80905) 1 year ago
Felix Fontein a5bb4c7dee
ansible-test - local change detection without --fork-point (#79734) 1 year ago
Abhijeet Kasurde e88ff32b10
deb822_repository: use http-agent with open_url (#80876)
* Use http-agent in open_url API while getting
  cloudflare content

Fixes: #80809

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Matt Martz 09387eaa24
Update dnf5 module to handle API change for setting the download directory. Fixes #80887 (#80888) 1 year ago
Sloane Hertel 09b4cae4fb
unarchive - ensure src is an absolute path before picking handler (#80738) 1 year ago
Abhijeet Kasurde d955fb1590
Removed unused `get_md5` parameter from stat (#80871)
* removed unused, undocumented `get_md5` parameter from stat module.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
Matt Martz 8652b231f2
Align yum_repository documentation with arguments (#80867) 1 year ago
Brent Barbachem 0c7361d9ac
URI Module find json sub type (#80745)
* uri: fixed search for json types to include strings in the format xxx/yyy+json
1 year ago
Matt Martz 61157f6a9e
Switch from multiprocessing.Queue to SimpleQueue (#80838) 1 year ago
Martin Krizek 202195f5e4
Remove unreachable error for removed include_role.static (#80837) 1 year ago
Brian Coca 4899d4a4d6
simple skip of connection (#80638)
Avoid 'persistent' connection handling if not needed
removed useless connection passing
added property to action classes as indicator/selector
1 year ago
Jordan Borean 8db9bd7574
Remove deprecated include (#80752)
* Remove deprecated include

* Add tombstone entry for include

* Use string for date

* Use todays date

* Remove uneeded if statement
1 year ago
Jordan Borean 2253837453
command - Add option to disable argument var expansion (#80512)
* command - Add option to disable argument var expansion

* Use test char that isn't an escape sequence
1 year ago
Jordan Borean 0a36cd910e
Removed testing support for Server 2012 and 2012 R2 (#80778) 1 year ago
Jordan Borean 0df794e5a4
urls - remove deprecated client key calls (#80751) 1 year ago
Matt Clay b16041f1a9
ansible-test - Fix traceback when mixing sources (#80801)
* ansible-test - Fix traceback when mixing sources

* ansible-test - Refactor layout error handling
1 year ago
Matt Clay e837680f4b
Use strings for `removal_date` in runtime metadata (#80815) 1 year ago
Brian Coca 0830b69059
config lookup, new option to show origin of value (#80651) 1 year ago
Martin Krizek 156493eed5
ansible-test - Add RHEL 9.2 support (#80755) 1 year ago
Matt Clay aacab0633a
ansible-test - Fix handling of long timeouts (#80769) 1 year ago
Matt Clay 4c6aa70662
ansible-test - Fix timeout handling (#80764) 1 year ago
Matt Clay fd341265d0
ansible-test - Avoid use of deprecated utcnow (#80750)
The timestamps are only used by ansible-test, not the junit callback, so this change only impacts ansible-test.
1 year ago
PRASOON KARUNAN V b576f0cda7
fix error if path had wildcard in it (#74723)
* fix error if path had wildcard in it

* add test

* add changelog fragment
1 year ago
Brian Coca 4b0d014d58
setup module, retry facter to handle --puppet errors (#80645)
* setup module, retry facter to handle --puppet errors

facter versions have changed how they deal with the --puppet flag
when puppet is not present, most versions will just ignore it and not error,
but initial versions of facter 4 changed the behaviour (later reverted).

fixes #80496
1 year ago
Matt Clay 790e0b0983
ansible-test - Update the NIOS test container (#80739) 1 year ago
Brian Coca 5a84ff26df
first_found fix no terms option (#76550)
also fix bug with multiple items clobbering previous settings

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
1 year ago
Martin Krizek 932abc0711
Prevent setting arbitrary attrs on Jinja2 envs via overrides (#80715) 1 year ago
Matt Clay cdeb607b1d
ansible-test - Always use unique container names (#80724) 1 year ago
Martin Krizek 8cd95a8e66
Account for overlays when interacting with Jinja envs (#80705)
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
1 year ago
Brian Coca d12aa7f69c
Add FreeBSD 13.2 to ansible-test (#80698) 1 year ago
Matt Clay 2cd1744be3
Use ansible.module_utils.common.text.converters (#80704)
Replace use of old `ansible.module_utils._text` and add a unit test to maintain backwards compatibility.
1 year ago
Matt Clay 54576cd794
pep517 backend - Copy symlinks when copying source (#80690) 1 year ago
Dmitriy Rabotyagov 7f48fa0129
Better parse virtualenv_command option for pip (#80624)
Atthe moment if a users wants to protect  virtualenv_command by using
quotes around 'venv', module will fail out as literal parsing is used
at the moment. In order to imrpove things, argparse is leveraged to
parse out passed value to the virtualenv_command

Closes-Bug: #76372

Signed-off-by: Dmitriy Rabotyagov <noonedeadpunk@gmail.com>
1 year ago
Brian Coca 06dcb4ad7a
Don't include a default for cli as it overrides config with lesser pr… (#80650)
* Don't include a default for CLI as it overrides config with lesser precedence

  connection plugins should already use the same config entries (and more)
  than DEFAULT_TIMEOUT.
1 year ago
Brian Coca 9bd698b3a7
service module : remove flag confugration from openbsd enable/disable service (#80628)
fixes #66434


* removed flag setting from enable/disable on openbsd
  service was changing permanent config on openbsd, which is not expected from the this module
* if in check mode, module should not stop at enable/disable
* simplify and clean up opensd service enable/disable
* does break for those that were using service for configuring flags
1 year ago
Sloane Hertel d5e2e7a0a8
[ansible-galaxy] Fix installing signed collections (#80661)
* 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
1 year ago
Sloane Hertel d18d4f84ec
_symbolic_mode_to_octal- fix raising ValueError for invalid symbolic modes (#80449)
validate the full user and perm strings instead of just first character

fixes unhelpful unarchive error for some invalid modes
1 year ago
Martin Krizek ed749cf0a0
Remove deprecated FileLock class (#80438) 1 year ago
Martin Krizek 8754d8e1e1
ActionBase: remove deprecated _remote_checksum (#80440) 1 year ago
Martin Krizek cc5f8c529b
Remove deprecated default.fact_caching_prefix ini config option (#80441) 1 year ago
Matt Clay 5ac292e12d
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.
1 year ago
Brian Coca 0c63b9622e
source module compression setting directly from config (#80647)
* source module compression setting directly from config

no need to proxy via play_context, which can fall out of date w/o constant variable updates.
1 year ago
Matt Clay 4d25e3d54f
Set the minimum setuptools to 45.2.0 (#80649)
Also update the package-data sanity test to use the minimum setuptools version.
1 year ago
Landson Guo ece8da71ea
Add TTY check and argument to disable it (#50603) (#68260)
* Add TTY check and argument to disable it (#50603)

* Fix formatting

* add changelog

* rename flag and updated help description

* add tests for tty check

* replace deprecated uses of assertRaisesRegexp to assertRaisesRegex

* fix yaml syntax

* shorten line 79

* Revert "replace deprecated uses of assertRaisesRegexp to assertRaisesRegex"

This reverts commit cea5fe1655.

* change back to assertRaisesRegexp
1 year ago
Brian Coca b2c0095722
Fix gather parallel (#80597)
* fix meaning of parallel in gather_facts
 * Update docs with note about parallel not always being faster
 * add 'smarter' usage of gahter_timeout for parallel tasks
 * restore async when needed, not always
 * added typing
 * parallelism tests
1 year ago
Martin Krizek 1e8b889b93
Templar: remove deprecated shared_loader_obj param (#80439) 1 year ago
Brian Coca 850a403226
service_facts, get more info for rcctl services (#80630)
uses rcctl get function to get all settables for a service
1 year ago
Matt Clay 372fc99686
ansible-test - Update pylint to 2.17.3 (#80632) 1 year ago
Martin Krizek a2be8915de
PlayIterator: remove deprecated methods (#80437) 1 year ago
Martin Krizek 36df60e226
dnf5: use new API to check package signatures (#80609) 1 year ago
Matt Clay abc58c026b
ansible-test - Use FreeBSD packaged setuptools (#80615)
This will avoid issues during bootstrapping caused by breaking changes in setuptools.
1 year ago
Martin Krizek 989a7d6951
Fix calling v2_playbook_on_notify callback (#80585)
Co-authored-by: Matt Martz <matt@sivel.net>
1 year ago
Maxwell G 734f38b259
Add GALAXY_COLLECTIONS_PATH_WARNINGS option. (#78487)
* Add GALAXY_COLLECTIONS_PATH_WARNING option.

This allows users to disable warnings from `ansible-galaxy collection
install` about `--collections-path` missing from Ansible's configured
collections_paths.
1 year ago
Martin Krizek 748f534312
Use target of /usr/bin/dnf for dnf version detection (#80550)
Fixes #80376
1 year ago
Matt Clay 7b50571588
ansible-test - Remove deprecated features (#80558) 1 year ago
Matt Clay 1fdeff949c
ansible-test - Update default containers (#80559) 1 year ago
Matt Clay ba47dd9ef4
ansible-test - Update pylint to 2.17.2 (#80555) 1 year ago
Matt Martz 0ee7cfb128
Implement checks, and backwards compat change, to move forward with UTF-8 only (#80370)
Co-authored-by: Sandra McCann <samccann@redhat.com>
1 year ago
Sloane Hertel 694c11d5bd
argspec - fix validating type for required options that are None (#79677)
* 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.
1 year ago
Sloane Hertel 964e678a7f
ansible-galaxy - fix installing dir sources with a trailing path separator (#79110)
* strip trailing path separator from type=dir sources
1 year ago
Matt Clay 676b731e6f
ansible-test - Replace pytest-forked (#80525)
- Unit tests now report warnings generated during test runs.
- Python 3.12 warnings about `os.fork` usage with threads (due to `pytest-xdist`) are suppressed.
- Added integration tests to verify forked test behavior.
1 year ago
Rogier Krieger 6aac0e2460
Extend OpenBSDStrategy to also update current hostname. (#80521)
Fixes #80520
1 year ago
kloud-byun 2e62724a8a
feature: add support for symbolic links when passing "dir" (#80460)
* update the include_vars action plugin to always follow symbolic links when traversing directories
1 year ago
Sloane Hertel bd6feeb6e7
Validate task attributes with first finalized attrs after loop (#80476)
* 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.
1 year ago
Matt Martz f3774ae7d4
--syntax-check is only applicable to ansible-playbook. Fixes #80506 (#80507) 1 year ago
Matt Clay e87802cf2c
pep517 backend - Use correct import_module import (#80480) 1 year ago
Martin Krizek 09dd80b4ec
Last handler defined runs, fix for roles (#79558)
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
1 year ago
Matt Clay 0371ea08d6
ansible-test - Add support for argcomplete 3 (#80482) 1 year ago
Martin Krizek bc3cc426bf
fetch_url: remove auto disabling decompress when gzip is not available (#80474) 1 year ago
Martin Krizek 9f0a9cf20d
get_action_args_with_defaults: remove deprecated redirected_names arg (#80473) 1 year ago
Martin Krizek 5ddd530d1d
Templar: do not add dict to globals (#80475)
All required Jinja2 versions (>=3.0) already do this, see
f9d804ead7
1 year ago
Sean Reifschneider 243aea45ce
Symbolic modes with X or =[ugo] always use original mode (#80132)
* Symbolic modes with X or =[ugo] always use original mode (Fixes #80128)

Here's what's happening, by way of this mode example: u=,u=rX

At the first step in the loop, the "u" bits of are set to 0. On the next
step in the loop, the current stat of the filesystem object is used to
determine X, not the "new_mode" in the previous iteration of the loop. So
while most operations kind of operate left to right, "X" is always going
back to the original file to determine whether to set x bit.

The Linux "chmod" (the only one I've tested) doesn't operate this way. In
it, "X" operates on the current state the loop understands it is in,
based on previous operations (and starting with the file permissions).

This is an issue with "X" and any of the "=[ugo]" settings, because
they are lookups. For example, if a file is 755 and you do "ug=rx,o=u",
file module produces 0557 and chmod produces 0555.

This really becomes a problem when you want to recursively change a
directory of files, and the files are currently 755, but you want to
change the directory to 750 and the files to 640. In chmod you can do
"a=,ug=rX,u+w" (or "a=,u=rwX,g=rX"), and have it apply equally to the
directory and the files. I can't come up with a single way in the ansible
file module to deterministically, recursively, set a directory to 750
and the contents to 640 no matter what the current permissions are,
as the code currently is.

The fix is to pass in "new_mode" to _get_octal_mode_from_symbolic_perms
in lib/ansible/module_utils/basic.py inside _symbolic_mode_to_octal. And
then take "new_mode" as an argument and use it instead of the filesystem
object stat.st_mode value.

* Fixing my new unit test, fixing bug in test comments
1 year ago
Felix Fontein 92c694372b
Replace validate-modules's semantic markup parser with antsibull-docs-parser (#80406) 1 year ago
Martin Krizek 12ce7d2e4e
dnf5: fix module/pkg names in the failed respawn msg (#80402) 1 year ago
Martin Krizek 8d5c250234
dnf5: use the logs API to determine transaction problems (#80401) 1 year ago
Matt Martz 6d1e355639
Only use the selectors code path when we are prompt matching (#79931) 1 year ago
Sloane Hertel 460abe0cef
Fetch signatures from galaxy after the dependency resolver runs (#80334)
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>
1 year ago
Geoffroy Doucet c1e19e4bdd
Fix getting timeout for get mounts facts on Linux (#79847)
* Fix how to get the gather_timeout setting while getting the
mounts facts on Linux.

Issue: #79844
1 year ago
Matt Davis 5e131a96c0
bump devel to 2.16.0.dev0 (#80390) 1 year ago
Felix Fontein 2f647e9617
Implement semantic markup support for Ansible documentation in validate-modules. (#80243) 1 year 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'.
1 year ago
tu1h 043a0f3ee8
Fix run_once by instantly tiny post_validate (#78492) (#80051)
Signed-off-by: tu1h <lihai.tu@daocloud.io>
1 year ago
Felix Fontein 0e509ecf25
Support role extension for semantic markup. (#80305) 1 year ago
Martin Krizek a81b787a05
Add new dnf5 module (#80272) 1 year 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
1 year ago
Matt Martz d2f6ea4179
New deb822_repository module (#80018)
Fixes #77073
1 year ago
Matt Martz 9faf94468b
Enforce that `Display.display` requires a `str` (#80327)
* Enforce that Display.display requires a str

* clog frag

* ci_complete
1 year ago
Brian Coca bf74f390af
clog (#80336)
(cherry picked from commit 97c8da7783)
1 year 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
1 year 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
1 year ago
Matt Clay 8ce102f302
ansible-test - Remove macos/12.0 remote (#80319) 1 year 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>
1 year ago
Felix Fontein b398613120
Add support for plugin field in seealso. (#80212) 1 year ago