* Don't create dest directory in check mode
uncomment existing test
Fix checking for file attribute changes in check mode and add a test
(cherry picked from commit b7a0e0d792)
This change allows ansible-test to work with newer versions of git on AZP..
(cherry picked from commit bad8843124)
Co-authored-by: Matt Clay <matt@mystile.com>
- Support loading of vendored Python packages.
- Exclude vendored Python packages from payloads.
(cherry picked from commit 6bfe6b899a)
Co-authored-by: Matt Clay <matt@mystile.com>
Always indicate the Python version being used before installing requirements.
(cherry picked from commit 5e3db6e441)
Co-authored-by: Matt Clay <matt@mystile.com>
Integration test target prefixes defined in a `tests/integration/target-prefixes.{group}` file can now contain an underscore (`_`) character.
(cherry picked from commit e6cffce0eb)
Co-authored-by: Matt Clay <matt@mystile.com>
* [stable-2.14] ansible-test - Fix pylint error with old home dir (#80151)
(cherry picked from commit 27287b40c0)
Co-authored-by: Matt Clay <matt@mystile.com>
* ansible-test - Fix error with missing pylint home (#80155)
(cherry picked from commit 367d45facd)
* don't ignore templated _raw_params that k=v parser failed to parse (#79913)
fixes#79862
(cherry picked from commit e1d298ed61)
* backport test change to runme.sh
* add null 'manifest' key to metadata for git repo collections containing MANIFEST.json
changelog
* set to Sentinel instead of None
* Test installing a collection in a git repo that contains a MANIFEST.json
* fix test
* Update changelogs/fragments/ansible-galaxy-install-git-src-manifest.yml
(cherry picked from commit 321848e98d)
* Normalize deprecation records.
* Fix alias deprecations in suboptions.
* Report in which option an alias warning happened for suboptions.
* Add deprecation tests for suboptions.
* Also test deprecation in list of dicts.
* Adjust unit tests for toplevel alias deprecation field name change.
(cherry picked from commit 8a7185c224)
* Ensure we are passing ciphers to all url_get calls. Fixes#79717
* Add clog frag
* Fix tests
(cherry picked from commit 2143bcd)
Co-authored-by: Matt Martz <matt@sivel.net>
Fix ignoring certs when downloading tarballs
Fix ignoring certs when downloading a collection from a specific source that isn't in the configured servers list
(cherry picked from commit acbf4cc60e)
* validate-modules: don't fail on invalid YAML
When validate-modules encounters invalid YAML (e.g. in the EXAMPLES
section), it tries to reformat the exception to include the line number
in the Python file instead of the line number of the embedded YAML
document. However, PyYAML doesn't allow modification of the Mark object
(anymore) which leads to a new exception being raised, instead of
reporting the original exception.
As the original exception is not needed in other places anymore, we
don't have to modify it at all and can just compute the right line
number when reporting the error via ansible-test.
Fixes: #75837
* Add test for invalid module doc YAML syntax.
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit a7111c4dbb)
Co-authored-by: Evgeni Golov <evgeni@golov.de>
Also improve the ansible-test-container integration test:
- Add coverage for the no-probe code path.
- Add work-arounds for centos6 containers (to support backporting).
- Avoid systemd debug when the container doesn't use cgroup.
(cherry picked from commit 04fc98c794)
Co-authored-by: Matt Clay <matt@mystile.com>
* Fix file touch check mode result (#79360) (#79422)
Fixes#79360
(cherry picked from commit 3936b5c471)
* Rename changelog fragment according to PR number
* local connection: avoid tb when running in container with invalid user
* clog
* cannot use uid, leave empty and ~/ will resolve itself
* get back to what it did
(cherry picked from commit 5f3a6b78db)
* background threads writing to stdout/stderr can cause children to deadlock if a thread in the parent holds the internal lock on the BufferedWriter wrapper
* prevent writes to std handles during fork by monkeypatching stdout/stderr during display startup to require a mutex lock with fork(); this ensures no background threads can hold the lock during a fork operation
* add integration test that fails reliably on Linux without this fix
(cherry picked from commit 1424484be0)
as chmod/mode is not the only thing we attempt and Ubuntu not shipping acl
in newer versions can lead to some confusion
fixes#79146
(cherry picked from commit 0f18ddca9f)
* ansible-galaxy install - fix unnecessary api check when installing a role from git repo (#79090)
* delay server api evaluation until a GalaxyRole needs to make an api call for info, list, and install
(cherry picked from commit cb2e434dd2)
* Fix isinstance check (#79159)
Use GalaxyAPI for isinstance check instead of RoleDistributionServer, since the latter is defined in __main__ sometimes (when running integration tests or ansible-galaxy from source) and importing from ansible.cli.galaxy won't reference the same object.
(cherry picked from commit 89d682464b)
* Don't assume column index for netmask and broadcast. Fixes#79117
* fix typo
(cherry picked from commit f53dbf9)
Co-authored-by: Matt Martz <matt@sivel.net>
* [stable-2.14] Ensure that we do not squash keywords in validate (#79049)
* Ensure that we do not squash keywords in validate. Fixes#79021
* become_user: nobody should only apply to the test tasks, not the setup_test_user role
* Update how become_user is specified
* Add test to ensure keyword inheritance is working for become
* Add clog frag
* Cache fattributes to prevent re-calculation
* ci_complete
* Remove unnecessary getattr.
(cherry picked from commit 420564c5bc)
Co-authored-by: Matt Martz <matt@sivel.net>
* Remove unneeded merge conflict changes
* omit keyword should reset to context (#78917)
* omit keyword should reset to context
ensure we use context/inheritance when calculating value,
using default only when context is unavailable.
fixes#75692
(cherry picked from commit 9650ddb11c)
* fixes to FA inheritance (#78990)
finalized applies to all field attributes
fix getting parent value
also remove unused/needed extend/prepend signature
moar testing
(cherry picked from commit ff6e4da36a)
* setup role needs it's own info
* Use python re to parse service output instead of grep. Fixes#78541
* Add clog frag
* Add an extra guard to abort if rc is 4, and /etc/init.d is missing
(cherry picked from commit 4458128)
Co-authored-by: Matt Martz <matt@sivel.net>
* Do not crash templating when filter/test name is not a valid Ansible plugin name.
* Store and re-raise KeyError if there was one.
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit 6d0aeac1e1)
* Fix known_hosts changed status when removing non-existing key (#78748)
* Ensure no change is reported when removing missing key for host with other keys
Co-authored-by: Matt Martz <matt@sivel.net>
* Rename changelog fragment for fix known hosts changed status cherry pick
* Rename changelog according to new PR number
Co-authored-by: Matt Martz <matt@sivel.net>
- Allow disabled, unsupported, unstable and destructive integration test targets to be selected using their respective prefixes.
- Allow unstable tests to run when targeted changes are made and the ``--allow-unstable-changed`` option is specified (resolves https://github.com/ansible/ansible/issues/74213).
(cherry picked from commit d3d7785472)
Co-authored-by: Matt Clay <matt@mystile.com>
* Add --offline option to 'ansible-galaxy collection install' to prevent querying distribution servers
This allows installing/upgrading individual tarfiles to have dependency resolution.
Previously needed to be done manually with --no-deps or else all collections and dependencies needed to be included in the requirements.
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
* Add OSMC to Debian OS_FAMILY_MAP
- os_family fact of the Debian-based OSMC distribution was not detected correctly
* tweak changelog
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
* new _fqcn attribute to plugin objects
* unbreak plugins in subdirs
* Fix inadventent changes to _load_name and use existing vars
* add plugin aliases and name property, and replace plugin._load_name where incorrect
* Fix listing plugin names
Fix listing legacy and builtin together
test deprecated plugin documentation
fix doc extensions
remove sometimes inaccurate _load_name handling from plugin.name
* Add tests for REJECT_EXTS and doc extensions
Fix unpredictable collection redirects so non-fqcns in the redirect list are guaranteed to be legacy (instead of determined by the collections keyword)
Move aliases and name properties to _update_object so all plugin types, including doc fragments, can use them
* make legacy plugin names internally consistent
* rename attributes to ansible_name and ansible_aliases
This fixes bug which prevents identification of broken playbook when
passing multiple playbooks as arguments, something that is common
especially with `--syntax-check`.
Affects: ansible-lint