Commit Graph

11762 Commits (6e379e5d656089cdd4bc35c30c5911669e8d59eb)

Author SHA1 Message Date
Felix Fontein 6e379e5d65
validate-modules: do not treat falsy non-`False` defaults as `None` (#79267)
* Do not treat falsy non-False defaults as None.

* Fix various instances of this in modules.

* Add changelog fragment.
2 years ago
Sviatoslav Sydorenko 6674c43edd
Log `runme.sh` execution in integration tests (#79263)
* Log `runme.sh` execution in integration tests

This patch adds `set -x` where it's missing in the integration tests.
It also enables `pipefail` in `runme.sh` scripts that use pipes.

* Add a change note for PR #79263
2 years ago
Brian Coca 0f18ddca9f
mention acl in permissions errors (#79209)
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
2 years ago
Matt Clay d55423f5a4 ansible-test - Update default container. 2 years ago
Felix Fontein 74b80c3193
Bump antsibull-docs version from 1.6.1 to 1.7.0. (#79071) 2 years ago
Matt Clay 4fb5240af2 ansible-test - Update base and default containers. 2 years ago
Matt Clay 4202acb41b Fix ansible-test-git test for newer git versions.
The latest versions of `git` include a fix for CVE-2022-39253. The fix blocks the file protocol by default.

See: 45c9f05c44/Documentation/RelNotes/2.30.6.txt
2 years ago
Matt Clay 645b6b8581 ansible-test - Fix pylint support on Python 3.11. 2 years ago
Sviatoslav Sydorenko a76bbb18a5
Restrict `wheel` below v0.38.0 under Pythons < 3.7 (#79187)
* Restrict `wheel` below v0.38.0 under Pythons < 3.7

* Add a change note for PR #79187

* Update changelogs/fragments/79187--wheel-0.38.0.yml

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

* Use constraints file when installing wheel.

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Sloane Hertel 89d682464b
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.
2 years ago
Brian Coca f66016df0e
copy, avoid moving non temp remote 'non' files (#79102)
* copy, avoid moving non temp remote files that are not dirs/files
fix tests
2 years ago
Sloane Hertel cb2e434dd2
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
2 years ago
Martin Krizek 3a6eca6670
Fix test for jinja2_native preserve quotes (#79131)
Fixes https://github.com/ansible/ansible/pull/79119#discussion_r993752129
2 years ago
Matt Martz f53dbf90ea
Don't assume column index for netmask and broadcast (#79121)
* Don't assume column index for netmask and broadcast. Fixes #79117

* fix typo
2 years ago
Sloane Hertel c4d6629bce
fix password unit tests (#79113) 2 years ago
Martin Krizek d34b578685
jinja2_native: preserve quotes in strings (#79119)
Fixes #79083
2 years ago
Sloane Hertel f9cb679675
compile role with all parents in the dep chain (#79079)
fix inheriting from parents when role depth exceeds 3

Fixes #47023
2 years ago
Brian Coca 5d253a1380
fix password lookup's use of f=v settings (#76551)
update tests
2 years ago
Matt Clay 14e7f05318 ansible-test - Update pylint to 2.15.4. 2 years ago
Sloane Hertel e208fe5932
copy module - fix copying directories recursively with remote_src=True (#76997)
* copy module - fix copying directories containing modified subdirs with remote_src=True. Previously, the first changed subdir would prevent recursively checking for changes for in subdirs at the same level.

* Fix reporting changed for copying empty directories with remote_src=True. If a directory is created on the remote but nothing else, changed is True.
2 years ago
Brian Coca fcea07bbef
Custom salt for ansible-vault encrypt (#79063)
* Custom salt for ansible-vault encrypt

  add VAULT_ENCRYPT_SALT config
  add salt testing


Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Piotr Stawarski <p@stawarski.pl>
2 years ago
sbettid 8cf7a0d3f0
Fix collection install from source respects symlinks (#78983)
* Fix installation from source transforms symlinks of dirs to empty dirs

* Add test to check symlinks to dirs are respected when installing from source

* Add changelog for collection install from source symlink to dirs issue
2 years ago
Matt Martz 420564c5bc
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
2 years ago
Donatas Abraitis 11c1777d56
facts: List all local (scope host) IP address ranges (#79018)
After changes:
```
        "ansible_locally_reachable_ips": {
            "ipv4": [
                "127.0.0.0/8",
                "127.0.0.1",
                "192.168.0.1",
                "192.168.1.0/24"
            ],
            "ipv6": [
                "::1",
                "fe80::2eea:7fff:feca:fe68",
                ...
            ]
        },
```

192.168.1.0/24 is a local prefix, where any IP address inside this range
is reachable locally (or outside this host if this prefix is announced via
EGP/IGP).

Signed-off-by: Donatas Abraitis <donatas.abraitis@hostinger.com>
2 years ago
Martin Krizek e1daaae42a
Fix using FQCN for flush_handlers (#79057)
Fixes #79023
2 years ago
Brian Coca ff6e4da36a
fixes to FA inheritance (#78990)
finalized applies to all field attributes
fix getting parent value
also remove unused/needed extend/prepend signature
moar testing
2 years ago
Felix Fontein 6d0aeac1e1
Do not crash templating when filter/test name is not a valid Ansible plugin name (#78913)
* 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>
2 years ago
Matt Clay 5b239acb77 ansible-test - Update distro containers to 4.8.0.
The updated containers include coverage 6.5.0.
2 years ago
Brian Coca 9650ddb11c
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
2 years ago
Matt Clay 20c1252212 ansible-test - Update coverage to version 6.5.0.
ci_complete
ci_coverage
2 years ago
Jordan Borean ba6da65a0f
Fix connection/become task loop settings (#78565)
* Fix connection/become task loop settings

* Remove old code
2 years ago
Jordan Borean be4807b712
ansible-test validate-module - support sidecar docs (#78904) 2 years ago
Matt Martz c3fc8db41c
Deprecate using a list of dicts for vars. See #78920 (#78927) 2 years ago
Felix Fontein d93883645c
Upgrade antsibull-docs to 1.6.1 (#78872)
* Bump antsibull-docs version to 1.6.0 to fully support filter docs.

* known_good_reqs.txt no longer exists.

* Bump version to 1.6.1.
2 years ago
Brian Coca 0b678d5036
avoid roles exporting vars: (#69040)
- correct 'vars:' precedence to allow phasing out of include_params
 - actually merge vars and always include role_vars
 - avoided dupe deps from giving wrong vars
 - use 'first' instance of dep as others are from previous instances/invocations
   and can have diff values for vars
 - ensured deps only provide exportable vars themselves
 - added COMMENTS
 - added tests
 - apply export restrictions setting to defaults
 - use 'public' as cutoff

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

ci_complete
2 years ago
Matt Clay bc274f57f7
ansible-test - Improve pylint command consistency. (#78896)
* ansible-test - Improve pylint command consistency.

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2 years ago
sbettid de4ff281ab
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>
2 years ago
Felix Fontein 50dae8087e
runtime-metadata sanity test: ensure redirects are FQCRs (#78802)
* Ensure that meta/runtime.yml redirects are FQCRs.

* Avoid crash when YAML errors without context mark happen, for example if file starts with 'foo---' instead of '---'.
2 years ago
Matt Clay d3d7785472
ansible-test - Fix integration test target filter. (#78862)
- 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).
2 years ago
Matt Clay 16cde1104f
ansible-test - Update base and default containers. (#78846) 2 years ago
Matt Martz 4c26022171
Don't request repo updates when only testing modes (#78843) (#78850)
(cherry picked from commit 254204856f)
2 years ago
Matt Martz 76b746655a
Add `use_rsa_sha2_algorithms` option for paramiko (#78789)
Fixes #76737
Fixes #77673

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Clay 4d25233ece
ansible-test - Update Python 3.11 support. (#78840)
- Update sanity test requirements to fully support Python 3.11.
- Make Python 3.11 the default in the base and default test containers.
2 years ago
Alex Willmer 163819efa2
tests: Fix `test_ansible_version()` when run within a git checkout (#78636)
When running the unit tests locally, in a git clone, `ansible --test`
prints additional information about the git revision, e.g.

```
~/src/ansible$ ansible --version
ansible 2.10.8
...
~/src/ansible$ source hacking/env-setup
...

Setting up Ansible to run out of checkout...
...
~/src/ansible$ ansible --version
[WARNING]: You are running the development version of Ansible. You
should only run Ansible from "devel" if you are modifying the Ansible
engine, or trying out features under development. This is a rapidly
changing source of code and can become unstable at any point.
ansible [core 2.14.0.dev0] (test_ansible_version-devel df497ea13b) last
updated 2022/08/25 10:37:07 (GMT +100)
...
```

which causes `test_ansible_version()` to fail.

Also removed an unused argument from previous parameterisation.

Co-authored-by: Alex Willmer <alex.willmer@cgi.com>
2 years ago
Brian Coca b1ff0f4ebc
vault secrets file, keep context when symlink (#78734)
* vault secrets file, keep context when symlink

	fixes #18319

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Matt Clay e5e87a3927
ansible-test - Update pylint to 2.15.3. (#78811) 2 years ago
Sloane Hertel a02e22e902
Add --offline option to 'ansible-galaxy collection install' (#78678)
* 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>
2 years ago
Ruediger Pluem 1d410ca700
Fix local facts unreadable (#76095)
* Catch exceptions during stat calls

If such an exception is not caught it causes the complete
local facts gathering to fail.
2 years ago
Markus Opolka 616ad883ad
Add OSMC to Debian OS_FAMILY_MAP (#78778)
* 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>
2 years ago
Sloane Hertel f26f3325ba
apt - fix module short-circuiting when a package is not installed and only_upgrade is True (#78790) 2 years ago