Commit Graph
53768 Commits
Author SHA1 Message Date
Matt ClayandGitHub 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.
2023-04-14 15:13:58 -07:00
Rogier KriegerandGitHub 6aac0e2460 Extend OpenBSDStrategy to also update current hostname. (#80521)
Fixes #80520
2023-04-14 10:41:44 -04:00
kloud-byunandGitHub 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
2023-04-14 08:07:08 -04:00
Sloane HertelandGitHub 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.
2023-04-13 11:18:38 -04:00
Anwesha DasandGitHub d081ed3616 Adds Ansible 8 Porting Guide to Index Page (#80511) 2023-04-12 16:51:28 -04:00
Matt MartzandGitHub f3774ae7d4 --syntax-check is only applicable to ansible-playbook. Fixes #80506 (#80507) 2023-04-12 15:24:34 -04:00
Anwesha DasandGitHub 362c949622 Add Ansible community 8.0.0a1 porting guide (#80498) 2023-04-12 13:59:08 -04:00
Matt ClayandGitHub 43c5cbcaef Fix galaxy CLI unit test assertions (#80504) 2023-04-12 10:32:59 -07:00
Matt ClayandGitHub 3ec828703f Fix unit test asserts (#80500) 2023-04-12 10:04:42 -07:00
Matt ClayandGitHub e87802cf2c pep517 backend - Use correct import_module import (#80480) 2023-04-12 10:00:09 -07:00
Matt ClayandGitHub 74b102b33c Fix unit tests returning values (#80499) 2023-04-12 09:59:11 -07:00
Matt ClayandGitHub bd22b849c6 Fix unclosed files in unit tests (#80497) 2023-04-12 09:51:20 -07:00
Martin KrizekandGitHub 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
2023-04-12 09:45:43 -04:00
Matt ClayandGitHub 9026bc5d76 Remove obsolete pkg_resources usage (#80489) 2023-04-11 19:33:57 -07:00
Matt ClayandGitHub 0371ea08d6 ansible-test - Add support for argcomplete 3 (#80482) 2023-04-11 12:03:18 -07:00
Matt MartzandGitHub 62211097cb Expand pylint deprecated plugin to catch ansible.module_utils.common.warnings uses (#80462) 2023-04-11 11:45:56 -05:00
Sean ReifschneiderandGitHub d5f3578369 Fixing bit shift, extra comma, reformatting "copy" test. (#80458) 2023-04-11 12:13:36 -04:00
DopeforHopeandGitHub a7d6fdda66 Update ansible_tips_tricks.rst (#80477)
Fix quotation marks in example
2023-04-11 11:38:02 -04:00
Martin KrizekandGitHub bc3cc426bf fetch_url: remove auto disabling decompress when gzip is not available (#80474) 2023-04-11 11:33:04 -04:00
Martin KrizekandGitHub 9f0a9cf20d get_action_args_with_defaults: remove deprecated redirected_names arg (#80473) 2023-04-11 11:31:43 -04:00
Matt MartzandGitHub 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
2023-04-11 11:02:20 -04:00
Martin KrizekandGitHub 5ddd530d1d Templar: do not add dict to globals (#80475)
All required Jinja2 versions (>=3.0) already do this, see
https://github.com/pallets/jinja/commit/f9d804ead73de76b29bb5a793e6d4335c5649e56
2023-04-11 09:49:00 -04:00
Maxwell GandGitHub 4e9d21ec32 installation_distros: update Fedora section (#80453) 2023-04-11 09:37:58 -04:00
Sean ReifschneiderandGitHub 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
2023-04-10 18:29:10 -04:00
Matt ClayandGitHub f9534fd7b7 ansible-test - Update default containers (#80468) 2023-04-10 14:29:09 -07:00
Christinanik251andGitHub 2ed4396558 Fix typo in playbooks_keywords.rst.j2 (#80461) 2023-04-10 14:33:40 -04:00
Christinanik251andGitHub 5a44acc704 Update P() semantic markup example (#80464) 2023-04-10 14:30:11 -04:00
Sviatoslav SydorenkoandGitHub a84b3a4e72 Fix misrendered sections in manpage generation
This change fixes bugs in the manpage generator that existed since it
was first added.

It exposes CLI `ARGUMENTS` value to manpage templates.

Before this change, the code contained a typo, causing the `for`-loop
iterate over individual characters of the `'ARGUMENTS'` string rather
than iterating over a tuple. A missing comma was at fault.

The updated code gets rid of the `for`-loop and conditionals since it
seems to have been a premature complexity increase and no other things
than `'ARGUMENTS'` were ever added into the broken iterable.

The functional change is that `arguments` is now always present in the
Jinja2 context, unlike being missing sometimes because of the previous
design (not that it was ever present, because of the bug! sigh...)

The Jinja2 templates perform an `{% if arguments %}` check, letting
the template engine silently ignore the missing variable. The clause
was always falsy, meaning that the arguments section was not included
in the manpages for at least the last 6 years. With this fix, it will
be.

This patch also deduplicates calling `opt_doc_list` @ generate_man.

It was called late in the execution, more times than necessary. This
patch makes sure it happens once by putting it at the top of the scope.

It fixes rendering library and inventory in manpages.

The corresponding Jinja2 templates have blocks wrapped with
conditionals like `{% if inventory %}` and `{% if library %}` but said
variables were never injected into the context, nor were they even
deduced on the Python side of the generator. This means that the
conditional clauses were always falsy, never showing the portions of
the manpages.

The Python script has hints for how the `inventory` variable was to be
calculated, which is confirmed through the Git paleontology efforts.

The block of code that references to the `inventory` bit was
incorrectly checking a variable with a list of nested objects for the
presence of a string which was never going to work.

This patch fixes this check by verifying the CLI flag against the
correct variable containing a list of options and exposes it to the
Jinja2 templates.
It also exposes the `library` variable in a similar way.

The block displaying other binaries in Sphinx CLI docs has been
synchronized with the manpage template.
Previously, the current binary was displayed also. This patch gets rid
of the unwanted trailing comma there too.

Finally, the CLI executables list in the manpage template now reuses
the same variable as the RST template that doesn't need any
post-processing in Jinja2.
Before, it was already used in the RST template so this patch aligns
both templates to use the same logic as they got out-of-sync over time.

PR #80450.
2023-04-08 14:04:59 +02:00
Matt ClayandGitHub 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.
2023-04-07 10:03:45 -07:00
aaronk1andGitHub bf4e0166a5 Update password.py documentation (#80297)
* Update password.py documentation with new semantic markup
2023-04-06 16:06:41 -04:00
Alicia CozineandGitHub 032881e4f1 documents approaches to octal modes better (#80112) 2023-04-06 15:39:25 -04:00
YiannisandGitHub af6d75e313 Add OpenSUSE to the distro's installation guide (#80308)
* Add OpenSUSE to the distro's installation guide

Similar to the rest of the distros, OpenSUSE distributes ansible and it was
missing.

Signed-off-by: ybonatakis <ybonatakis@suse.com>
2023-04-06 15:27:58 -04:00
ec403db1c7 Document how to run all tasks, even the ones with the never tag (#80315)
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2023-04-06 15:20:28 -04:00
dzvisionandGitHub a6e0012b8a Update playbooks_templating.rst (#80375) 2023-04-06 15:04:42 -04:00
WeiXinFam-InstaandGitHub 0460f78081 Documentation changes for #80367 and #80270 (#80391) 2023-04-06 14:55:39 -04:00
Andrew KlychkovandGitHub db8f1756bc [Docs] communication.rst: Add a hint about adding Matrix shields to READMEs (#80392) 2023-04-06 14:53:17 -04:00
Matt MartzandGitHub 7251938370 ansible.builtin inferred by collection_name == None (#80446) 2023-04-06 13:51:39 -05:00
88a380c8f0 📝 Document macOS user deletion over SSH (#80358)
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
2023-04-06 18:08:24 +01:00
4029da9a9f Semantic markup docs (#80240)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2023-04-06 16:46:03 +01:00
Felix FonteinandGitHub 92c694372b Replace validate-modules's semantic markup parser with antsibull-docs-parser (#80406) 2023-04-05 17:45:44 -07:00
Felix FonteinandGitHub 96f7fd5539 Extend ansible-doc test with more classic markup. (#80407) 2023-04-05 16:14:35 -07:00
Matt ClayandGitHub 163f297d7f Extend bulk issue creator (#80423)
It can now be used to create feature requests, not just deprecation bug reports.
2023-04-05 15:24:21 -07:00
flowerysongandGitHub fc5c0aadc9 Correct bypass_host_loop attribute for group_by (#80380)
This action originally bypassed the host loop, but it does not
currently.
2023-04-05 16:51:25 -05:00
Martin KrizekandGitHub 12ce7d2e4e dnf5: fix module/pkg names in the failed respawn msg (#80402) 2023-04-05 11:18:04 -05:00
Martin KrizekandGitHub 8d5c250234 dnf5: use the logs API to determine transaction problems (#80401) 2023-04-05 11:17:50 -05:00
Matt MartzandGitHub 6d1e355639 Only use the selectors code path when we are prompt matching (#79931) 2023-04-04 15:20:26 -05:00
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>
2023-04-04 14:43:58 -04:00
Matt ClayandGitHub 4f7f7d1c26 Remove old release announcement scripts (#80371)
These have been replaced by `packaging/release.py`
2023-04-04 11:08:44 -07:00
Marcel TelkaandGitHub d7e7c2d872 Update URLs in COPYING (#80385) 2023-04-04 10:37:23 -05:00
Geoffroy DoucetandGitHub 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
2023-04-04 11:02:41 -04:00