1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

195 commits

Author SHA1 Message Date
Jon Ellis
97c72f88b7
Sudoers validate (#4794)
* Use visudo to validate sudoers rules before use

* Replace use of subprocess.Popen with module.run_command

* Switch out apt for package

* Check file mode when verifying file to determine whether something needs to change

* Only install sudo package for debian and redhat environments (when testing)

* Attempt to install sudo on FreeBSD too

* Try just installing sudo for non-darwin machines

* Don't validate file ownership

* Attempt to install sudo on all platforms

* Revert "Attempt to install sudo on all platforms"

This reverts commit b9562a8916.

* Remove file permissions changes from this PR

* Add changelog fragment for 4794 sudoers validation

* Add option to control when sudoers validation is used

* Update changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add version_added to validation property

Co-authored-by: Felix Fontein <felix@fontein.de>

* Also validate failed sudoers validation error message

Co-authored-by: Felix Fontein <felix@fontein.de>

* Make visudo not executable instead of trying to delete it

* Update edge case validation

* Write invalid sudoers file to alternative path to avoid breaking sudo

* Don't try to remove or otherwise modify visudo on Darwin

* Update plugins/modules/system/sudoers.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Remove trailing extra empty line to appease sanity checker

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-21 12:41:24 +02:00
ahussey-redhat
45362d39a2
Add keyring and keyring_info modules (#4764) 2022-06-20 19:15:08 +02:00
s-hamann
44e21dd407
sudoers: fix handling of state: absent (#4852) (#4853)
* sudoers: fix handling of state: absent (#4852)

* typo fixes
2022-06-19 15:34:24 +02:00
Alexei Znamensky
739ca737f1
cmd_runner: add __call__ method to invoke context (#4791)
* cmd_runner: add __call__ method to invoke context

* change xfconf to use the callable form

* add changelog fragment

* Update changelogs/fragments/4791-cmd-runner-callable.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-15 08:06:26 +02:00
Felix Fontein
84d8ca9234
Fix alternatives module (#4836)
* Only pass subcommands when they are specified as module arguments.

* When 'subcommands' is specified, 'link' must be given for every subcommand.

* Extend subcommand tests.
2022-06-14 16:02:31 +02:00
Marius Rieder
57e83ac80b
alternatives: Fix bug with priority default (#4810)
* alternatives: Fix bug with priority default

If neigther the priority nor the subcommands where specified the module decided to update the priority with the default value anyway. This resulted in bug #4803 and #4804

* Add changelog fragment.

* Distinguish None from 0.

* Address review comments.

* Update plugins/modules/system/alternatives.py

Co-authored-by: Pilou <pierre-louis@libregerbil.fr>

* Remove unrelated issues from changelog.

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Pilou <pierre-louis@libregerbil.fr>
2022-06-13 21:40:02 +02:00
Jon Ellis
2d1e58663c
Ensure managed sudoers config files have 0440 permissions (#4814)
* Ensure sudoers config files are created with 0440 permissions to appease visudo validation

* Remove change not required by the bugfix

* Add changelog fragment for 4814 sudoers file permissions

* Update changelogs/fragments/4814-sudoers-file-permissions.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Have less oct casting

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-12 08:17:56 +02:00
Alexei Znamensky
8ba3d94740
xfconf module utils: providing a cmd_runner object (#4776)
* xfconf: changed implementation to use cmd_runner

* added module_utils/xfconf.py

* xfconf_info: using cmd_runner

* added module_utils to BOTMETA.yml

* added changelog fragment

* use cmd_runner_fmt instead of deprecated form
2022-06-06 10:38:46 +02:00
Marius Rieder
373da56b5b
Add subcommands parameter for module alternatives. (#4654)
* Add slaves parameter for module alternatives.

* alternatives: Improve documentation abous slaves parameter

* alternatives: Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* alternatives: Add schangelog for slaves parameter

* alernatives: Add integration tests

* alternatives: Improv tests

* alternatives: Update tests/integration/targets/alternatives/tasks/slaves.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* alternatives: Rework logic to support updating priority and subcommands

* alternatives: Use more inclusive naming

* alternatives: Fix linter warnings

* alternatives: Dont fail if link is absent

* alternatives: Update changelog fragment

* alternatives: Add tests for prio change and removing

* alternatives: Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* alternatives: Add `state=auto`to reset mode to auto

* alternatives: Fix linter warnings

* alternatives: Fix documentation.

* alternatives: Combine multiple messages.

* alternatives: Set command env for all commands.

* alternatives: Do not update subcommands if parameter is omited

* alternatives: Fix a bug with python 2.7 var scoping

* alternatives: Improce diff before generation

* alternatives: Fix linter warnings

* alternatives: Fix test names

* alternatives: Simplify subcommands handling and improve diffs

* aliases: Only test for subcommand changes if subcommands parameter is set.

* Update plugins/modules/system/alternatives.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-06 10:33:39 +02:00
Ge0rgi0s
62ff263ac1
Add puppet confdir option (#4740)
* Add puppet confdir option

* Add puppet confdir option change fragment

* Improve quoting in plugins/modules/system/puppet.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add version_added to plugins/modules/system/puppet.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Georg Vogt <georg.vogt@tngtech.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-06 10:32:20 +02:00
Alexei Znamensky
49836bb484
gconftool2_info: new module (#4743)
* gconftool2_info: new module

* fixed imports

* fixed docs for gconftool2_info

* fixed docs for gconftool2_info

* minor adjustment in docs

* added tests

* adjustments
2022-06-04 09:13:53 +02:00
Alexei Znamensky
6052776de1
Multiple modules using ModuleHelper (#4674)
* Multiple modules using ModuleHelper

Replaced raising exception with calling method do_raise() in MH.
Removed the importing of the exception class.

* added changelog fragment
2022-05-23 07:19:24 +02:00
Felix Fontein
319c29c2a2
Add RHEL 9.0, FreeBSD 13.1, Ubuntu 22.04 and Fedora 36 to CI, fix bug in filesystem module (#4700)
* Add RHEL 9.0 and FreeBSD 13.1 to CI.

* RHEL 9 has no pyOpenSSL apparently.

* Adjust URL for EPEL.

* Fix cargo install on FreeBSD 13.1.

* Add Ubuntu 22.04 and Fedora 36 to CI.

* Fix logic.

* filesystem: do not die output line does not contain ':'

* Skip django_manage tests on RHEL 9 as well.

* homectl tests don't work with RHEL 9.0.

* Improve error handling, improve fatresize output handling.

* Skip Fedora 36.

* Skip filesystem vfat tests on Ubuntu 22.04.

There, resizing fails with a bug:
Bug: Assertion (disk != NULL) at ../../libparted/disk.c:1620 in function ped_disk_get_partition_by_sector() failed.

* 'trusty' is 14.04. Adding 22.04 to skip list.

* Skip jail tests for FreeBSD 13.1.

* Add config for postgres on Ubuntu 22.04.

* Make CentOS 6 happy.

* Adjust postgres version.

* Try installing EPEL a bit differently.

* Skip ufw and iso_extract tests on RHEL 9.

* Skip odbc tests on RHEL 9.

* Skip RHEL 9.0 for snap tests.

* Add changelog fragment for filesystem code changes.
2022-05-22 17:20:30 +02:00
Alexei Znamensky
1a2fa802c0
[6.0.0] xfconf - deprecate parameter disable_facts (#4520)
* xfconf: deprecate parameter disable_facts

* added changelog fragment

* changed deprecation to 8.0.0

* Update changelogs/fragments/4520-xfconf-deprecate-disable-facts.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* added parameter deprecation

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-17 19:26:06 +02:00
Alexei Znamensky
fbff98c5f2
gconftool2: improvements (#4647)
* gconftool2: improvements

* added changelog fragment

* typo

* Update changelogs/fragments/4647-gconftool2-command-arg.yaml

Per recommendation from Felix. Danke!
2022-05-12 07:10:34 +02:00
Felix Fontein
1a9b3214fd
[5.0.0] Remove Ansible 2.9 / ansible-base 2.10 compatibility code (#4548)
* Remove Ansible 2.9 / ansible-base 2.10 compatibility code.

* Remove path_join shim from BOTMETA.

* Update comment.

* Bump minimally required ansible-core version.
2022-04-26 11:51:01 +02:00
Felix Fontein
54b2f0819d
[5.0.0] Bump version to 5.0.0, remove deprecated features (#4516)
* Remove deprecated features.

* Fix changelog.

* Remove ignore.txt entries.

* One more.

* Remove state=get tests.
2022-04-26 11:45:15 +02:00
Tanner Prestegard
29c49febd9
Add 'state' parameter for alternatives (#4557)
* Add 'activate' parameter for alternatives

Allow alternatives to be installed without being set as the current
selection.

* add changelog fragment

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* rename 'activate' -> 'selected'

* rework 'selected' parameter -> 'state'

* handle unsetting of currently selected alternative

* add integration tests for 'state' parameter

* fix linting issues

* fix for Python 2.7 compatibility

* Remove alternatives file.

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-26 08:20:29 +02:00
Alexei Znamensky
a2bfb96213
xfconf: added missing value types (#4534)
* xfconf: added missing value types

* added changelog fragment

* Update plugins/modules/system/xfconf.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-20 20:58:40 +02:00
Alexei Znamensky
3c6cb547f3
xfconf: improve docs (#4533) 2022-04-20 08:24:51 +02:00
elara-leitstellentechnik
8ccc4d1fbb
Implement btrfs resize support (#4465)
* Implement btrfs resize support

* Add changelog fragment for btrfs resize support

Co-authored-by: Fabian Klemp <fabian.klemp@frequentis.com>
2022-04-13 07:07:51 +02:00
Alexei Znamensky
7e6a2453d0
seport: minor refactor (#4471)
* seport: minor refactor

* added changelog fragment

* Update plugins/modules/system/seport.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/seport.py

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-10 14:34:15 +02:00
Ulf Tigerstedt
fa65b9d1f0
Fix documentation for sudoers module (#4469)
* Fix documentation for sudoers module

* Update plugins/modules/system/sudoers.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-10 15:39:09 +12:00
doubletwist13
17fe813c18
feat: sudoers module supports runas parameter with default of root (#4380)
* feat: sudoers module supports runas parameter with default of root

* fix: sudoers tests now pass

* chore: add changelog fragment for 4380

* fix: runas feature now a non-breaking change wh no def with no default

* fix: no trailing space in sudoers.py

* Update plugins/modules/system/sudoers.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-03-24 07:07:07 +01:00
Felix Fontein
ca2c64b5ca
Fix sanity issues. (#4346) 2022-03-14 20:56:27 +01:00
Alexei Znamensky
4af7f49ac0
mksysb - revamped module + fix bug in backup_dmapi_fs option (#3295)
* Revamped module + fix bug in backup_dmapi_fs option

* added changelog fragment

* added copyright line
2022-03-14 07:13:45 +01:00
Pavol Babinčák‏
9567c99c9f
dconf: Skip processes that disappeared while we inspected them (#4153)
* dconf: Skip processes that disappeared while we inspected them

Fixes #4151

* Update changelogs/fragments/4151-dconf-catch-psutil-nosuchprocess.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-02-10 07:15:37 +01:00
Joseph Torcasso
acd8853242
vdo: Remove unused variable (#4163)
* fix vdo error #3916

* add changelog fragment
2022-02-07 20:12:44 +01:00
Felix Fontein
9322809b3a
Fix return value documentation to use a valid value for 'type'. (#4142) 2022-02-02 20:58:27 +00:00
gaetan-craft
6a7811f696
Fix local port regex in listen_ports_facts (#4092)
* Fix local port regex

Thsi PR fix the bug reported in #4091

* Update changelogs/fragments/4092-fix_local_ports_regex_listen_ports_facts.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-31 19:33:11 +01:00
Will Hegedus
526369a243
python_requirements_info: don't overwrite results in 'mismatched' dict key (#4078)
* bugfix: don't overwrite results in 'mismatched'

Whichever mismatched package is evaluated last is the value stored in the
'mismatched' key. Instead, it should have a subdict for each pkg that is mismatched
to keep in line with its documented usage.

* Update changelogs/fragments/4078-python_requirements_info.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-29 15:30:07 +01:00
James Livulpi
ab7e4ee578
New Module: Homectl module for managing systemd-homed (#4018)
* initial development of homectl module

* botmeta

* fix some linting

* Update .github/BOTMETA.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* use array form of run_command

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* added mofifying user record and cleaned up based on comments

* added updating records/multiple changes regarding options, examples doc, return doc

* add integration tests and more overall improvements

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* removed modify handle within present

* adding more options and better checking of user records when updating

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add code review changes

- remove unsafe_shell with run_command.
- use dict.pop() in user_metadata dict.
- consistent quoting to single quotes.
- change logic to determine check mode better
- fix integration tests and added check_mode tests

* Fix handling of mount opts

When a user is created without mountopts homed will use nodev and nosuid
by default, however the user record metadata will not contain these
values. This commit takes extra care that correct value is being set to
true or false. So if a user gives mountopts with just nodev we need to
make sure the nosuid and noexec gets set to false, etc. If mountopts are
same as currently in user record make sure nothing would be changed and
outputs correctly.

Also fixed some tests.

* change fmethod modify_user to prepare_modify_user_command

* Code review fixes and add existing user pw checking

- Added methods to check existing users password is correct by comparing
  the hash stored in homed user record and the hash of given password
- Updated integration tests for above case
- Added aliases file so CI can run

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 07:11:12 +01:00
Guillaume Rousse
a675afcba9
fix alternatives parsing when they are part of a group (#3976)
* fix alternatives parsing when they are part of a group

* add changelog fragment

Co-authored-by: Guillaume Rousse <guillaume.rousse@renater.fr>
2022-01-10 07:10:22 +01:00
Benoit Vaudel
fe57cd5ac8
puppet: Add documentation and remove deprecation for show_diff, keep deprecation for alias show-diff (#3980)
* puppet: Add documentation and remove deprecation for show_diff

* Add changelog fragment

* Update changelogs/fragments/3980-puppet-show_diff.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/puppet.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/system/puppet.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fixing syntax error introduced in 29298da3

* More documentation for show_diff and fix some sanity errors

* Update changelogs/fragments/3980-puppet-show_diff.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update tests/sanity/ignore-2.10.txt

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add validate-modules:parameter-invalid to ignores due to invalid and depricated alias

* Keep use-argspec-type-path in ignores

* Update plugins/modules/system/puppet.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Benoit Vaudel <benoit@catalyst.net.nz>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-10 07:08:17 +01:00
Felix Fontein
11205eefee
Fix BOTMETA and corresponding sanity test (#3989)
* Fix BOTMETA and authors mistakes.

* Fix BOTMETA sanity test regex.
2022-01-05 22:54:21 +01:00
Jon
1ba79f3c6a
Sudoers (take 2) (#3746)
* Add module and pass the andebox validate-modules

* Fixes pep8 and sanity checks

* Add tests (intending that they'll fail)

* Fix pep8 complaint

* Remove stub test_sudoers file

* Add version_added to documentation

Co-authored-by: Andrew Pantuso <ajpantuso@gmail.com>

* Various improvements as suggested by reviewers

* Remove further required: false from documentation

* Make yaml indentation consistently indented

* Remove default for command argument

Co-authored-by: Andrew Pantuso <ajpantuso@gmail.com>

* Refactor check_mode checking as guards

* Update documentation formatting and use to_native

* Update plugins/modules/system/sudoers.py

* Update examples and formatting

* Fix merge conflict

* Update handle

* Add some integration tests

* Update tests to pass yamllint

* Fix assertions typo

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* Remove wrapping quotes from assertions

* Use >- for long example names

* Add aliases file to sudoers integration tests

* Fix integration test name

* Create new alternative sudoers directory in case /tmp doesn't exist

* Alternative assertion test for checking rule revocation

* Re-quote assertions

* Update version_added to 4.3.0

Co-authored-by: Felix Fontein <felix@fontein.de>

* Uppercase first character of short_description

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Andrew Pantuso <ajpantuso@gmail.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-05 08:30:44 +13:00
Felix Fontein
a2f72be6c8
Prepare for distutils.version being removed in Python 3.12 (#3936)
* Prepare for distutils.version being removed in Python 2.12.

* Fix copy'n'paste error.

* Re-add Loose prefix.

* Fix Python version typos.

* Improve formulation.

* Move message into own line.

* Fix casing, now that the object is no longer called Version.
2021-12-24 17:34:48 +00:00
Alexei Znamensky
daabb53a2b
xfconf - using aggregated base class (#3919)
* xfconf - using aggregated base class

* added changelog fragment

* fixed typo
2021-12-19 14:17:17 +01:00
Felix Fontein
59bbaeed77
Docs improvements. (#3893) 2021-12-12 11:01:14 +01:00
Alexei Znamensky
4bddf9e12c
aix_lvg - invoke run_command passing list (#3834)
* aix_lvg - invoke run_command passing list

* added changelog fragment
2021-12-09 21:20:12 +01:00
Alexei Znamensky
70f73f42f8
aix_filesystems - invoke run_command passing list (#3833)
* aix_filesystems - invoke run_command passing list

* added changelog fragment
2021-12-09 21:19:44 +01:00
Anatoly Pugachev
c14eafd63f
small docs update for timezone module (#3876)
* small docs update for timezone module
fixes #3242

* Update plugins/modules/system/timezone.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-12-09 20:49:21 +01:00
Alexei Znamensky
3dd5b0d343
interfaces_file - fixed dup options bug (#3862)
* interfaces_file - fixed dup options bug

* added changelog fragment
2021-12-07 21:54:54 +01:00
Alexei Znamensky
6b91c56c4e
java_cert - invoke run_command passing list (#3835)
* java_cert - invoke run_command passing list

* added changelog fragment
2021-12-03 07:27:03 +01:00
Alexei Znamensky
ccb74ffd7c
svc - invoke run_command passing list (#3829)
* svc - invoke run_command passing list

* added changelog fragment
2021-12-01 13:18:38 +01:00
Alexei Znamensky
ff0c065ca2
python_requirements_info - improvements (#3797)
* python_requirements_info - improvements

- returns python version broken down into its components
- minor refactoring

* adjusted indentation in the documentaiton blocks

* added changelog fragment

* fixes from PR review + assertion in test
2021-11-30 06:08:45 +00:00
Alexei Znamensky
59c1859fb3
python_requirements_info - fail when version operator used without version (#3785)
* python_requirements_info - fail when version operator used without version

* added changelog fragment

* simplified way of achieving the same result
2021-11-26 07:09:46 +01:00
Michaela Lang
921417c4b5
extend open_iscsi to allow rescanning a session to discover new mapped LUN's #3763 (#3765)
* <!--- Describe the change below, including rationale and design decisions -->

<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->

According to issue 3767, adding a session rescan flag to add and utilize mapped_luns after login into a portal and target.

<!--- Pick one below and delete the rest -->
- Feature Pull Request

<!--- Write the short name of the module, plugin, task or feature below -->
open_iscsi rescan flag

<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->

<!--- Paste verbatim command output below, e.g. before and after your change -->
``` yaml
      - name: Rescan Targets
        open_iscsi:
          rescan: true
          target: "{{ item.0 }}"
        register: iscsi_rescan
        loop:
          - iqn.1994-05.com.redhat:8c4ea31d28e
        tags:
          - rescan
```
```bash
    TASK [Rescan Targets] ********************************************************************************************************************************************************************
    changed: [node1] => (item=['iqn.1994-05.com.redhat:8c4ea31d28e'])
    changed: [node2] => (item=['iqn.1994-05.com.redhat:8c4ea31d28e'])

    TASK [Output rescan output] **************************************************************************************************************************************************************
    ok: [node1] => {
        "iscsi_rescan": {
            "changed": true,
            "msg": "All items completed",
            "results": [
                {
                    "ansible_loop_var": "item",
                    "changed": true,
                    "failed": false,
                    "invocation": {
                        "module_args": {
                            "auto_node_startup": null,
                            "discover": false,
                            "login": null,
                            "node_auth": "CHAP",
                            "node_pass": null,
                            "node_user": null,
                            "port": "3260",
                            "portal": null,
                            "rescan": true,
                            "show_nodes": false,
                            "target": "iqn.1994-05.com.redhat:8c4ea31d28e'"
                        }
                    },
                    "item": [
                        "iqn.1994-05.com.redhat:8c4ea31d28e"
                    ],
                    "sessions": [
                        "Rescanning session [sid: 3, target: iqn.1994-05.com.redhat:8c4ea31d28e, portal: 127.0.0.1,3260]",
                        "Rescanning session [sid: 1, target: iqn.1994-05.com.redhat:8c4ea31d28e, portal: 127.0.0.2,3260]",
                        "Rescanning session [sid: 2, target: iqn.1994-05.com.redhat:8c4ea31d28e, portal: 127.0.0.3,3260]",
                        ""
                    ]
                }
            ]
        }
    }
    ok: [node2] => {
        "iscsi_rescan": {
            "changed": true,
            "msg": "All items completed",
            "results": [
                {
                    "ansible_loop_var": "item",
                    "changed": true,
                    "failed": false,
                    "invocation": {
                        "module_args": {
                            "auto_node_startup": null,
                            "discover": false,
                            "login": null,
                            "node_auth": "CHAP",
                            "node_pass": null,
                            "node_user": null,
                            "port": "3260",
                            "portal": null,
                            "rescan": true,
                            "show_nodes": false,
                            "target": "iqn.1994-05.com.redhat:8c4ea31d28e"
                        }
                    },
                    "item": [
                        "iqn.1994-05.com.redhat:8c4ea31d28e"
                    ],
                    "sessions": [
                        "Rescanning session [sid: 3, target: iqn.1994-05.com.redhat:8c4ea31d28e, portal: 127.0.0.1,3260]",
                        "Rescanning session [sid: 2, target: iqn.1994-05.com.redhat:8c4ea31d28e, portal: 127.0.0.2,3260]",
                        "Rescanning session [sid: 1, target: iqn.1994-05.com.redhat:8c4ea31d28e, portal: 127.0.0.3,3260]",
                        ""
                    ]
                }
            ]
        }
    }
```

* minor_changes:
  - open_iscsi - extended module to allow rescanning of established session for one or all targets. (https://github.com/ansible-collections/community.general/issues/3763)

* * fixed commend according to the recommendation.

* Update plugins/modules/system/open_iscsi.py

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-22 19:28:08 +01:00
Jan Gaßner
245cee0ece
listen_ports_facts: Added support for ss (#3708) 2021-11-16 19:50:29 +01:00
jake2184
352047314b
Rework safety check on size arguments for when LV doesn't exist (#3681)
* Rework safety check on size arguments for when LV doesn't exist

* Update changelogs/fragments/3681-lvol-fix-create.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Jake Reynolds <jake.reynolds@bidfx.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-13 14:00:32 +01:00