Commit Graph

12008 Commits (70e0b1f5448143f54f096b9a0a991e1d70fd7690)

Author SHA1 Message Date
Felix Fontein 70e0b1f544
docsite build: upgrade sphinx-ansible-theme and antsibull-core (#80734) 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 eea7137449
Fix os.walk issues in package-data sanity test (#80703) 1 year ago
Matt Clay 23e2ca91c2
Improve coverage of role unit tests (#80695) 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
Matt Clay 251360314d
Fix docs-build test to not mutate source tree (#80689) 1 year ago
Matt Clay 884215bd1c
Improve unit test code coverage (#80683) 1 year ago
Matt Clay 71f6e10dae
Use assertRaisesRegex in unit test (#80663) 2 years 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
2 years ago
Martin Krizek ed749cf0a0
Remove deprecated FileLock class (#80438) 2 years ago
Martin Krizek 8754d8e1e1
ActionBase: remove deprecated _remote_checksum (#80440) 2 years 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.
2 years 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
2 years 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
2 years ago
Martin Krizek 1e8b889b93
Templar: remove deprecated shared_loader_obj param (#80439) 2 years ago
Matt Clay 5e220416a2
ansible-test - Update the default containers (#80635) 2 years ago
Matt Clay 372fc99686
ansible-test - Update pylint to 2.17.3 (#80632) 2 years ago
Martin Krizek a2be8915de
PlayIterator: remove deprecated methods (#80437) 2 years ago
Matt Clay abc58c026b
ansible-test - Use FreeBSD packaged setuptools (#80615)
This will avoid issues during bootstrapping caused by breaking changes in setuptools.
2 years ago
Martin Krizek 989a7d6951
Fix calling v2_playbook_on_notify callback (#80585)
Co-authored-by: Matt Martz <matt@sivel.net>
2 years ago
Maxwell G f4615d69ad
tests: replace a mock import with unittest.mock (#80589) 2 years ago
Martin Krizek 748f534312
Use target of /usr/bin/dnf for dnf version detection (#80550)
Fixes #80376
2 years ago
Matt Clay 7b50571588
ansible-test - Remove deprecated features (#80558) 2 years ago
Matt Clay 1fdeff949c
ansible-test - Update default containers (#80559) 2 years ago
Matt Clay ba47dd9ef4
ansible-test - Update pylint to 2.17.2 (#80555) 2 years 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.
2 years ago
Sloane Hertel 964e678a7f
ansible-galaxy - fix installing dir sources with a trailing path separator (#79110)
* strip trailing path separator from type=dir sources
2 years 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.
2 years 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
2 years ago
Matt Clay 43c5cbcaef
Fix galaxy CLI unit test assertions (#80504) 2 years ago
Matt Clay 3ec828703f
Fix unit test asserts (#80500) 2 years ago
Matt Clay 74b102b33c
Fix unit tests returning values (#80499) 2 years ago
Matt Clay bd22b849c6
Fix unclosed files in unit tests (#80497) 2 years 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
2 years ago
Matt Clay 0371ea08d6
ansible-test - Add support for argcomplete 3 (#80482) 2 years ago
Matt Martz 62211097cb
Expand pylint deprecated plugin to catch ansible.module_utils.common.warnings uses (#80462) 2 years ago
Martin Krizek bc3cc426bf
fetch_url: remove auto disabling decompress when gzip is not available (#80474) 2 years ago
Martin Krizek 9f0a9cf20d
get_action_args_with_defaults: remove deprecated redirected_names arg (#80473) 2 years ago
Matt Martz 2a795e5747
Manage basic.selinux completely, instead of mocking potentially missing module (#80448)
* Manage basic.selinux completely, instead of mocking potentially missing module. Fixes #80436

* pep8
2 years 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
2 years ago
Matt Clay f9534fd7b7
ansible-test - Update default containers (#80468) 2 years ago
Matt Clay babdec80cc
Fix the parsing integration tests (#80454)
Most of the bad_parsing tests were no longer running, with several of them no longer being valid.
The invalid tests have been removed and the valid ones rewritten.
2 years ago
Matt Martz 7251938370
ansible.builtin inferred by collection_name == None (#80446) 2 years ago
Felix Fontein 92c694372b
Replace validate-modules's semantic markup parser with antsibull-docs-parser (#80406) 2 years ago
Felix Fontein 96f7fd5539
Extend ansible-doc test with more classic markup. (#80407) 2 years ago
Matt Clay 163f297d7f
Extend bulk issue creator (#80423)
It can now be used to create feature requests, not just deprecation bug reports.
2 years ago
Matt Martz 6d1e355639
Only use the selectors code path when we are prompt matching (#79931) 2 years ago