* Improvements in module_helper
- added `ModuleHelperException` to handle problems specific to ModuleHelper
- updated `module_fails_on_exception` for `ModuleHelperException`
- `StateMixin`: composed names of state methods are now calculated instead of fixed.
- `CmdMixin`: added `run_command_fixed_options` to pass some parameters on every call
* Improvements in module_helper
- Named deprecations: ability to declare a `dict` of deprecations indexed by names, allowing module maintainer to trigger them by those names, and also allowing the module user to acknowledge them in a similar way.
- Adding `ack_named_deprecations` to module's `argument_spec` when they exist.
- Providing doc fragment for `ack_named_deprecations`.
- Added method `__quit_module__` providing a hook for code that needs to be run when quitting the module.
- Created convenience classes combining `ModuleHelper`, `StateMixin`, `CmdMixin`.
* fixed validation
* fixed validation
* changelog fragment
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* Improvement on Named Deprecations
Per the comments in PR, we want to expose a call to a ``deprecate`` method on the module code, so that pylint can properly perform its static analysis on deprecations.
This prompted a revamp of the named deprecation feature.
* Use .get() instead of [] for the param to ack named deprecations.
* Changes from suggestions in the PR
* removed named deprecations
* Update changelogs/fragments/1480-module-helper-improvements.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/module_utils/module_helper.py
Co-authored-by: Felix Fontein <felix@fontein.de>
**SECURITY** - CVE-2021-20180
Hide user sensitive information which is marked as ``secured``
while logging in console.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Provide a user friendly message by handling json decode
exception rather than providing a stacktrace
Fixes: #1614
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* fix reconfigure option
If `init_reconfigure` is true, the init fails because it is run as:
`terraform init -input=false - r e c o n f i g u r e`
* changelog fragment
* typo
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* When module fails return meaningful error message to user
returned by homebrew-tap command.
* Doc update
Fixes: #1411
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
**SECURITY** - CVE-2021-20178
Hide user sensitive information like `privkey` and `authkey`
while logging in console.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Added shard_group_duration to influxdb_retention_policy module
* Use shard_group_duration as optional
* Add change log and handle invalid shard group value error
* Add change log and handle invalid shard group value error
* Added doc examples for shard_group_duration parameter
* Add documentation for the shard group duraiton parameter value
* Fixed description
* Add ipa_pwpolicy module
Used for modifying FreeIPA password policies
Functions similarly to the existing IPA modules
* Add sample return value to ipa_pwpolicy module
* Add unit tests for the ipa_pwpolicy module
Also moves the `exit_json` call in the main module outside of the try
clause because it was stopping the tests from working
* Update version added for the ipa_pwpolicy module
* Add check_mode note for the ipa_pwpolicy module
* Add missing period in ipa_pwpolicy module doc
* Fix tense of the ipa_pwpolicy module description
* Reword ipa_pwpolicy documentation
Improve the wording of the ipa_pwpolicy documentation to make it more
clear
* Rename ipa_pwpolicy options to use shorter names
* Remove kubevirt and set up redirects to community.kubevirt
This also removes the dependency on community.kubernetes which fixes
https://github.com/ansible-collections/community.general/issues/354.
* Update changelogs/fragments/1317-kubevirt-migration-removal.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/1317-kubevirt-migration-removal.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add missed redirects
Co-authored-by: Felix Fontein <felix@fontein.de>
* changed make parameter from --question to -q
* changelog fragment
* Update changelogs/fragments/1574-make-question.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fixed bug
- The module was searching back (and forward, in the ``after`` state) for lines that were not comments, assuming it would be a valid rule or an include.
* remove the line, make yamllint happy
* Update changelogs/fragments/1394-pamd-removing-comments.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* add support for all monit service types
* ignore case when performing check
* add changelog
* Escape special characters before matching
Co-authored-by: Felix Fontein <felix@fontein.de>
* escape each element individually
Co-authored-by: Felix Fontein <felix@fontein.de>
* Removed the bridge-slave from list of ip based connections since nmcli does not accept IP options for bridge-slave connections.
* Update changelogs/fragments/1517-bridge-slave-from-list-of-ip-based-connections.yml
Thanks for the tip.
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Online SAS is rebranded as Scaleway in 2015. Updated
inventory documentation for the same.
Fixes: #814
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* updated deprecated homebrew cask commands
* added methods for brew version deprecation check
* added comments and changelog fragment
* added unit test for version comparison
* switch to use disutils LooseVersion for version comparison
* updated changelog message and minor refactor for building brew command based on version
* added caching logic for retrieval of brew version and updated PR changelog yaml
* Update changelogs/fragments/1481-deprecated-brew-cask-command.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/packaging/os/homebrew_cask.py
* Update plugins/modules/packaging/os/homebrew_cask.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/packaging/os/homebrew_cask.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* switch to use subprocess.check_output instead of subprocess.run
* replace subprocess with run_command
* removed unused subprocess import
* removed error handling logic to depend on check_rc=True instead
Co-authored-by: Felix Fontein <felix@fontein.de>
* Remove Google cloud plugins migrated to community.google
* Remove another symlink
* Fix typo for community.general version
* Update changelogs/fragments/1319-google-migration-removal.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/1319-google-migration-removal.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add fragment for inventory script
* fix yaml formatting
* adjust past relnotes in accordance with removal of google plugins
Co-authored-by: Felix Fontein <felix@fontein.de>
* Added code to support command groups inside sudo rules
* Added command groups to documentation of ipa_sudorule.py
* Update changelogs/fragments/1555-ipa-sudorule-add-commandgroup.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/ipa/ipa_sudorule.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Eric Nothen <eric.nothen@payback.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fixed case of empty section + parameter validation
* Adjusted code for integration test, and added test case for empty section
* Update changelogs/fragments/479-ini_file-empty-section.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/479-ini_file-empty-section.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Using "is changed" in integration tests, per PR review
Co-authored-by: Felix Fontein <felix@fontein.de>
* Some improvements to the module
- Fixed examples documentation ().
- Module no longer incorrectly reports change for information gathering operations ().
- Replaced custom parameter validation with ``required_if`` ().
- Added the traceback output to ``fail_json()`` calls deriving from exceptions ().
* added PR URL to changelof frag
* Update changelogs/fragments/jira_improvements.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* mentioned issue required for transition in chnagelog
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add support for keyed_groups, groups, and compose options to linode inventory
plugin
* Changed instance,label to instance.label
various lint fixes around spacing
* Change self._strict to a local variable as it's no longer needed in other
methods
* Modified DESCRIPTION to add a version_added property to each of the new options.
* Add Changelog fragment
* Minor changes to the changelog fragment
* Replace 'the standard' with 'support for'
* Update description to note that the inventory groups are created by default
from the group attribute not tags and that the group attribute has been
depricated by Linode.
* Remove trailing space in description
* Add period to changelog fragment
Co-authored-by: Clinton Bunch <cdbunch@zeus.int.zentaur.org>
* nios_member: fix nios api member_normalize error with python 3
Force a copy of the key to allow change during iteration.
* Update - add changelog fragment
* Update - add changelog fragment
* Update changelogs/fragments/1527-fix-nios-api-member-normalize.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Ensured ``changed`` returns ``False``.
- Added small improvement on the ``_load_scope()`` method.
* yamllint caught it
* Rephrased changelog fragment
* Do not remove non-ASCII Unicode from multi-line string output.
* Added basic tests.
* Add Unicode test.
* Simplify tests, avoid later Jinja features.
* Refactor.
* Make use diy tests use callback test framework as well.
* Remove color codes.
* Work around stable-2.9 bug.
* Simplify again.
* Fresh branch to try this again
* Fix typo
* Fix sanity error
* Redid some tests, not sure if this works...
* Re-fixed documentation
* Fixed linter
* Update layout
* Processed feedback
* Processed feedback
* Added check_mode
* Run test with check mode
* Fix layout
* Fix more layout
* Fixed last sanity errors (for now)
* Check mode is not a module arg..
* Fix sanity-error
* Reworked check_mode and adapted tests
* Added extra test to also run through remove logic, added message for check_mode to show output is different, grabbed magicmock from different library to fix py2 errors
* Remove unused function
* Processed feedback
* Processed feedback
* Processed feedback
* Some adjustments/improvements
- Added doc details for parameters ``description`` and ``objectClass``
- Added type details to argument_spec of parameters ``description`` and ``objectClass``.
- Removed unused import
- Simplified logic of ``LdapEntry._load_attrs()``
- Replaced parameter validation test with ``required_if``.
* Added changelog frag
* Raises error for non-existent repo path, requires Ansible 2.10.4 or higher.
* Changes from suggestions in the PR
* Suggestion from PR
* Update changelogs/fragments/630-git_config-handling-invalid-dir.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* saltstack: fix put_file to preserve checksum
Use hashutil.base64_decodefile to ensure that the file checksum
is preserved, since file.write only supports text files.
Signed-off-by: Zac Medico <zmedico@gmail.com>
* Update changelogs/fragments/1472-saltstack-fix-put_file-to-preserve-checksum.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Code refactor
* Handle exception
* Provide useful error message to user when exception is raised
Fixes: #1504
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Bitbucket's pagination for pipeline variables is flawed.
Refactor bitbucket_pipeline_variable code to correct this logic.
Fixes: #1425
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>