* nmcli: Compare MAC addresses case insensitively
* Update changelogs/fragments/2416-nmcli_compare_mac_addresses_case_insensitively.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/net_tools/nmcli.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add mac to TESTCASE_BRIDGE so test_bridge_connection_unchanged covers case sensitive mac address comparison
* Update plugins/modules/net_tools/nmcli.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Convert current_value to uppercase as well in case nmcli changes behaviour
Co-authored-by: Felix Fontein <felix@fontein.de>
* lxd dynamic inventory and test data
* added ``merge_profile`` parameter to merge configurations from the play to an existing profile
* cosmetic changes
* added ``merge_profile`` parameter to merge configurations from the play to an existing profile
* cosmetic changes
* fix pylint errors
* fix flake8 warnings
* fix pep8 errors without "line to long"
* fix ansible tests
* fix typo
* fix version added
* fix lost of suggestions from felixfontein
* fix filter
fix ansible test errors
* delete test config
* delete 'notes:' and copy content to description
* move testdata
load testdata by path from config
* updated documentation
* fix test data and remove inventory branch
* fix spellings and rename lxd to community.general.lxd
* fix documentation
* remove selftest
* strip example data
* add unit test
* switch to ansible.module_utils.common.dict_transformations
* documentation cleanup
* move lxd_inventory.atd from files to fixtures
* update documentation
move lxd_inventory.atd
* rename self.groups to self dispose
remove dumpdata
* cleanup
* fix unittests
comment out dump_data, it breaks the unit tests
* fix pep8
* Apply suggestions from code review
* Update plugins/inventory/lxd.py
* add test if no groupby is selected
* rename disposed to groupby
remove unused constant
other suggested cleanups
* Use bundled ipaddress instead of own code.
* Update plugins/inventory/lxd.py
* Exceptions should not be eaten.
* Improve error handling for network range/address parsing.
* Fix typo.
* Make network range valid.
* Do not error when groupby is not a dict.
Co-authored-by: Frank Dornheim <“dornheim@posteo.de@users.noreply.github.com”>
Co-authored-by: Felix Fontein <felix@fontein.de>
* added some cases for unsupported network interface and multi-nic without IP addresses
* added changelog fragment
* lint fixes and added option for ansible_host setting
* added description about the new option
* lint fix too long line
* Update changelogs/fragments/2259-proxmox-multi-nic-and-unsupported.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/inventory/proxmox.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/inventory/proxmox.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/inventory/proxmox.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Added CommandDisabled
* refactored to code and added a test case where an interfaces doesnt have a mac address or is invalid to reset it to 00:00:00:00:00:00
* Update tests/unit/plugins/inventory/test_proxmox.py
Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
* Update tests/unit/plugins/inventory/test_proxmox.py
Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
* mac-address is set to None instead of 00:00:... when not defined
* changed None to empty string for mac-address
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
* Keycloak: add realm management
* Minor fixes
* Review fixes
* Remove sort of list because condition on list cannot be true
* Add exception in fail_json and update test
* Change output for secret and version in comments
* Update copyright
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add missing traceback
* Apply suggestions from code review
* Update plugins/modules/identity/keycloak/keycloak_realm.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Allow keycloak_group.py to take token as parameter for the authentification
* Fix some pep8 issues
* Add changelog fragment
* Refactor get_token to pass module.params + Documentation
* Update plugins/module_utils/identity/keycloak/keycloak.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/module_utils/identity/keycloak/keycloak.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fix unit test and add new one for token as param
* Fix identation
* Check base_url format also if token is given
* Update plugins/doc_fragments/keycloak.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/keycloak/keycloak_client.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/keycloak/keycloak_clienttemplate.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Allow keycloak_group.py to take token as parameter for the authentification
* Refactor get_token to pass module.params + Documentation
* Update plugins/module_utils/identity/keycloak/keycloak.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/keycloak/keycloak_group.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Check if base_url is None before to check format
* Fix unit test: rename base_url parameter to auth_keycloak_url
* Update plugins/module_utils/identity/keycloak/keycloak.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/2250-allow-keycloak-modules-to-take-token-as-param.yml
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update plugins/module_utils/identity/keycloak/keycloak.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update plugins/modules/identity/keycloak/keycloak_client.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update plugins/modules/identity/keycloak/keycloak_client.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update plugins/modules/identity/keycloak/keycloak_clienttemplate.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update changelogs/fragments/2250-allow-keycloak-modules-to-take-token-as-param.yml
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update plugins/module_utils/identity/keycloak/keycloak.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update plugins/modules/identity/keycloak/keycloak_clienttemplate.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update plugins/modules/identity/keycloak/keycloak_group.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update plugins/modules/identity/keycloak/keycloak_group.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Switch to modern syntax for the documentation (e.g. community.general.keycloak_client)
* Add check either creds or token as argument of all keyloak_* modules
* Update plugins/modules/identity/keycloak/keycloak_client.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
* copying from the previous branch
* passing sanity - docs incomplete
* adjusted parameter name
* adjusted unit tests for mode=new
* adjusted integration tests for mode=new
* added 'russoz' to list of maintainers for cpanm
* Update tests/integration/targets/cpanm/tasks/main.yml
* Update tests/integration/targets/cpanm/tasks/main.yml
* ensuring backward compatibility + tests
* added changelog fragment
* version for new parameter and adjusted example
* typo and formatting
* Update plugins/modules/packaging/language/cpanm.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/packaging/language/cpanm.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/packaging/language/cpanm.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* multiple changes
- some fixes from PR
- supporting tests
- integration is no longer unsupported => destructive, should run on
apt- and rpm-based systems only
* only run integration tests in redhat-family > v7 or debian-family
Co-authored-by: Felix Fontein <felix@fontein.de>
* linode_v4: add support for `private_ip` option.
* linode_v4: remove `required` attribute from `private_ip` parameter.
* linode_v4: add changelog fragment.
* linode_v4: add PR link to changelog fragment.
Co-authored-by: Amin Vakil <info@aminvakil.com>
* linode_v4: add the `version_added` attribute to the `private_ip` section of module documentation
Co-authored-by: Felix Fontein <felix@fontein.de>
* linode_v4: improve styling of `private_ip` docs
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Added handling for commas in the agent field for agent configuration
* Removed test statement
* Added changelog fragment
* Fixed spelling on fragment :-)
* Added agent network interaces fact
* Adding changelog fragment
* More concise looping over interfaces
* Adding unit test case for agent interfaces
* Correcting whitespace issue
* Commented new dummy json returns with corresponding method
* java_keystore - improve error handling and returned results
* set check_rc=False to return results as documented when module fails
* set LANG, LC_ALL and LC_MESSAGES to C to rely keytool output parsing
* fix pylint's `no-else-return` and `unused-variable` hints
* update related unit tests accordingly
* add a changelog fragment
update unit test (remove stdout_lines from returned dict)
fix unit test: failure is now expected when alias does not exist
* Update changelogs/fragments/2183-java_keystore_improve_error_handling.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix integration test: overwrite keystore at the same location
Co-authored-by: Felix Fontein <felix@fontein.de>
* Added module for ipa_otpconfig
* Make no_log=False explicit.
* Updated inputs to be int type instead of strings to align to expected inputs. Updated output message
* Add changelog fragment
* Remove changelog fragment as this is a new module
* Update plugins/modules/identity/ipa/ipa_otpconfig.py
Add version_added field to module description.
Co-authored-by: Felix Fontein <felix@fontein.de>
* Updated punctuation in examples
* Add unit test for ipa_otpconfig
* Add ipa_otptoken module with unit test
* Updated documentation in unit test
* Update plugins/modules/identity/ipa/ipa_otpconfig.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/ipa/ipa_otpconfig.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/ipa/ipa_otptoken.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/ipa/ipa_otptoken.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/ipa/ipa_otptoken.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/ipa/ipa_otptoken.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/ipa/ipa_otptoken.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/identity/ipa/ipa_otptoken.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Added some documentation updates to make it conform to ansible standards
* Update plugins/modules/identity/ipa/ipa_otptoken.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Address review comments
Co-authored-by: Chris Costa <chris.costa@compellingtech.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Bugfix: PyGithub does not support explicit port in base_url
* Fix unit tests
* Fix unit tests
* Added changelog
* Update changelogs/fragments/2204-github_repo-fix-baseurl_port.yml
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* replace inline clear password by environment variable on a per-command basis.
* add changelog fragment
* update related unit tests
* Update changelogs/fragments/2177-java_keystore_1668_dont_expose_secrets_on_cmdline.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix unit test: force result without lambda
Co-authored-by: Felix Fontein <felix@fontein.de>
* added metadata for variables in module helper
* adjustments
* added separate support for tracking changes
* rewrote the diff code
* added integration test for module_helper
* using ansible.module_utils.common.dict_transformations.dict_merge
* improved dependency management
* restore ModuleHelper to base classes of CmdStateModuleHelper
* added assertions to ensure the failing module name appears in the error messages
* added test code for state-based modules
* fixed test name
* renamed class to VarMeta
* small fixes
* fixes from the PR
* fixed VarDict.__set_attr__
* added VarDict.__getitem__()
* added changelog fragment
* adjustments per PR
* ModuleHelper.output is now aware of conflicting variable names
* Update plugins/module_utils/module_helper.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* improve temporary files storage (naming/removal)
* update unit tests
* Update changelogs/fragments/2163-java_keystore_1667_improve_temp_files_storage.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* add dedicated function to randomize PKCS#12 filename
fix unit tests (also mock the new function)
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add support for `sudo su -` using password auth
Allow users to run Ansible tasks through `sudo su -` using password auth
- Feature Pull Request
sudosu
So I have been using this at various customers for bootstrapping Ansible mostly.
Often you have an existing setup where there is a user that has root-access enabled through sudo, but only to run `su` to log using the user's password.
In these specific cases the root password is unique to the system and therefore not an easy way to automate bootstrapping.
Having a `sudo su -` become option **with password prompt** is not possible with the existing become methods (neither sudo nor su can be used) by abusing `become_exe` or `become_flags`.
This fixesansible/ansible#12686
* Fix all reported issues
* Add unit tests
* Apply suggestions from code review
* Update plugins/become/sudosu.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/unit/plugins/become/test_sudosu.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/unit/plugins/become/test_sudosu.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* add new module xcc_redfish_command to manage Lenovo servers using Redfish APIs
* Update plugins/modules/remote_management/lenovoxcc/xcc_redfish_command.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* fix some errors detected by ansible-test sanity
* end all descriptions (except short_description) with a period
* fix return definition problem and other errors detected by ansible-test sanity
* Always use true/false for booleans in YAML
* It is usually a good idea to leave away required: false
* fix errors detected by ansible-test sanity
* fix elements of command is not defined
* check whether resource_uri is specified for Raw commands
* if no Members property, return false; if empty array, return true
* get @odata.etag from patch body instead of getting again
* add request_body checking
* add unit test for the module
* fix errors detected by ansible-test sanity --test pep8
* update class name xcc_RedfishUtils to XCCRedfishUtils to follow convention; import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args, exit_json, fail_json from ansible_collections.community.general.tests.unit.plugins.modules.utils instead of inline them
* support using security token for auth
* fix line too long error
* As 2.3.0 got released yesterday, move to 2.4.0
* add maintainers for lenovoxcc
* update to make sure that it's sorted alphabetically
Co-authored-by: Felix Fontein <felix@fontein.de>
* Added from_csv filter and integration tests
* Cleaning up whitespace
* Adding changelog fragment
* Updated changelog fragment name
* Removed temp fragment
* Refactoring csv functions Part 1
* Syncing refactored csv modules/filters
* Adding unit tests for csv Module_Util
* Updating changelog fragment
* Correcting whitespace in unit test
* Improving changelog fragment
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/2037-add-from-csv-filter.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Improvements and fixes to ModuleHelper, with (some) tests.
* added changelog fragment
* adjusted changelog frag - get_bin_path() handling is actually a bugfix
* Included explicit parsing for proxmox guest tags and updated corresponding unit test with tags key
* Including changelog fragment for PR 1949
* Removed ellipsis from test
Proxmox only permits periods when surrounded by alphanumeric characters
* Corrected punctuation for changelog entry
Co-authored-by: Felix Fontein <felix@fontein.de>
* Allowing tags string to contain commas
* Incorporated new parsed tags fact with bugfix
* Correcting whitespace issues
* Update changelogs/fragments/1949-proxmox-inventory-tags.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/inventory/proxmox.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/1949-proxmox-inventory-tags.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Jenkins build module
A module for queuing and deleting jenkins builds.
* CI fixes
* More CI fixes.
* Even more CI fixes
* Fixing symlink
* Update plugins/modules/web_infrastructure/jenkins_build.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* removed ansible meta section
* Added unit tests.
* fix tests
* more test fixes.
* Completed tests.
Mocked jenkins api calls.
Fixed some logging.
* Update plugins/modules/web_infrastructure/jenkins_build.py
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Update plugins/modules/web_infrastructure/jenkins_build.py
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Update plugins/modules/web_infrastructure/jenkins_build.py
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Update plugins/modules/web_infrastructure/jenkins_build.py
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Cleaned up default items
And removed supports check mode flag.
* setting name param required
* Update plugins/modules/web_infrastructure/jenkins_build.py
Co-authored-by: Brett Milford <brettmilford@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Update targets for CI for devel branch; move some targets to stable-2.10.
* Skipping test on RHEL 8.3 (it is already skipped on RHEL 8.2).
* Linting.
* Shut 2.9/2.10 pylint complaints up.
* fixes various issues related to updating an ...
... existing gitlab user, in detail:
- fixes updating admin status not working
- fixes user passwords not updated
- fixes confirmation skipping param ignored for user updates
- added tests for code changes
* fixing sanity issues
* fixing sanity issues 02
* fixing sanity issues 03
* fixing sanity issues 04
* fixing unit test failures
* fixing unit test failures 02
* add changelog fragment
* fixing unit test failures 03
* forgot to add changelog fragment
* fix changelog sanity issues
* fix changelog sanity issues 02
* incorporate review suggestions
Co-authored-by: Mirko Wilhelmi <Mirko.Wilhelmi@sma.de>
* Fix 2 regex in parted related to parted version string and to parsing partition size output.
* Added changelog fragment.
* Updated changelog as per recommendation.
* Fix the regex matching the parted version. The space character at the end of the string may or may not be always present
* provided sample version output and corrected regex to match
* add/correct changelog fragment
* split parted_version function to allow creating a test unit
* test unit for parted version info
* ansible-test sanity fixes
* review fix
* Update changelogs/fragments/1695-parted-updatedregex.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* comment fixes
* better function name
* Update plugins/modules/system/parted.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* comment fixes
Co-authored-by: Claude Robitaille <claude@cbcr.me>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add tags filter to linode inventory plugin
* add tags to return tuple on line 66 in test_linode.py
* Add period in changelog fragment.
use if any() rather than for ... if list completion
* Clarify the description of the ``tags`` option
* Updated description to remove syntax error of line break.
* 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>
* 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>
* 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>
* 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>
* 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>
* 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
* Fix 2.9/2.10 cloud
* Fix splunk callback tests.
* ansible_virtualization_type on AZP can be one of container/containerd instead of docker for dockerized tests.
* Disable nomad tests.
* Work around AZP bugs.
* xfconf: add return values and expand test coverage
* fix pep8
* fix pylint
* fix returns yaml docs
* Add changelog fragemnt
* revert docts for `returned`
* Update changelogs/fragments/1419-xfconf-return-values.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/xfconf.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* update return values to raw for scalar/lists
* another doc tweak: None -> none
* Break newline for pep8
* Fix merge mistake
* Back to list of strings
* fix yaml syntax
* Fall back to old way, deprecate returns, add ingores for errors
* add a note about dprecating facts
* Add depracation messages and fix docstring error
* remove deprecation of return values.
* Update plugins/modules/system/xfconf.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* drop the deprecation message too
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add millisecond data to timestamp
* Add flag to control splunk milliseconds
* Update changelogs/fragments/1462-splunk-millisecond.yaml
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* Apply more suggestions from review
* Whitespace
Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Bump version to 2.0.0.
* Remove deprecated 2.0.0 features.
* Test for failure.
* Fix cache plugin unit tests.
* Accept direct import only for Ansible 2.9.
* Fix typo in redhat_subscription testcase
* Fix macports state=present matching against the wrong package name
Previous implementation returned true if the desired package name occurred anywhere in
the list of all installed packages. For example as a substring of another package name,
or even as a substring of a variant name for a different package.
Instead:
- request macports only list installed packages matching the desired package name, instead of all installed packages.
- Note `port` exits with 0 regardless of whether any packages match the requested name.
- pass `-q` flag: "Do not print the header line. This is useful when parsing the output of port installed in scripts for further processing."
- eliminate `use_unsafe_shell=True` by searching stdout contents natively in python
instead of using `grep`. This has the added benefit of eliminating any potential
misinterpretation of characters in the package name as regex special characters.
If there are zero matching installed packages, `out` is empty.
If there are one or more matches (due to multiple installed versions), the output format
is: ec8a2bc682/src/port/port.tcl (L3320-L3323)
Notably, two leading spaces, the package name, a space, and then other information.
According to blame via github, those lines haven't changed in 11 years.
* Update macports state=active to eliminate use_unsafe_shell
Similar to previous commit (for macports state=present):
- pass `-q` flag: "Do not print the header line. This is useful when parsing the output of port installed in scripts for further processing."
- search stdout contents natively in python instead of using `grep`.
- added parentheses to search string to eliminate false positives if the package name
or variants contain the word `active`. Still could fail if they contain `(active)`, but
that's less likely
If there are zero matching installed packages, `out` is empty.
If there are one or more matches (due to multiple installed versions), the output format
is: ec8a2bc682/src/port/port.tcl (L3320-L3323)
For "state=active", we're looking for a line that contains `(active)` in the output.
* Basic test case of query_port for present and active
* Attempt to fix lint errors in test
* Different mock module creation, changed test cases indentation/spacing
- picked the wrong mock code to cargo-cult. Thanks to felixfontein for this suggestion
- 4 space indentation on continuation line. I thought I had that originally, but it looks like my editor sabotaged me with mixed tabs/spaces
- Remove leading newline on multi-line test cases. I don't think it would make a difference, but I'd read up on how the python syntax works and want to more accurately represent macports output.
fingers crossed this addresses the known build errors
* Add changelog fragment
* Update tests/unit/plugins/modules/packaging/os/test_macports.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/1307-macports-fix-status-check.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* * pkgin query_package(..) understands now also package name with version (my-package-1.2nb123456). * pkgin query_package(..) will distinct between not-installed and not-found packages. * pkgin install_package(..) fails with proper error if a non-existing package is attempted to be installed.
* fixup ansibot comments
* add changelog fragment
* add example
* use more pythonic condition
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* remove extra dot between description and link to PR
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* fix file extension of changelog fragment
* add pkgin unit tests for query_package function
* fix pep8 issues
* use enum Flag instead mix of strings, bools and None as return value
* use IntEnum instead Flag to support Python versions >= 2.6
* fix pep8 and pylint errors
* use regular class instead enum to avoid issues with older Python releases
* fix comment
* remove the combined package state since without an IntFlag or Flag the usage of it would require to use logical operators
Co-authored-by: Erik van Nooijen <eric.vannooijen@tomtom.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Add ability to resize existing partition
* Add 'resize' flag to support backwards compatability, and allow partition reduction
* Add changelog fragment for #773
* Update changelogs/fragments/773-resize-partition.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/parted.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update resize flag with PR review comments
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Update plugins/modules/system/parted.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update default on resize flag in parted.py
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Big revamp in xfconf.py
- added plugin/module_utils/module_helper.py
- scaffold class for writing modules, beyond standard AnsibleModule
- automatic capture of exceptions
- easier dependency testing
- StateMixin to easily handle different behaviours for 'state' param
- CmdMixin to easily run external commands
- adapted test_xfconf.py
- the args for run_command are now lists instead of a string
- value and previous_value were not being tested before (because xfconf wasn't filling results - see below)
- added more tests: setting value to previous_value, getting non-existent property
- rewritten xfconf module, keeping the same results
- original module posted results as ansible_facts, this version still does it for compatibility, but also adds to the module result
* Added suggestions from the PR
* Added russoz as maintainer for the module_utils/module_helper.py file
* Formatting using printf-style requires special treatment
Strings not containing substitution tokens must work as well.
* Tidied up variables in module definition
* Tests with ArgFormat and DependencyCtxMgr
* pytest parameters must be in the same order, it seems
* improved testing for the DependencyCtxMgr
* fixed test for older pythons
* Moved changed property to improve readability
* Added testcase for state: absent and adjusted xfconf after it
* Fixed param name environ_update in run_command()
* added changelog fragment
* fixed tests after run_command param change
* Adjusted case in class names - transparent to users
* Adjustments to module code:
- No need to try/except everything, in fact it complicated debugging
- Replaced second call to xfconf.get() with xfconf.previous_value
* the actual test
* removed extraneous empty lines
* added changelog fragment
* rolled back removing the try/except around the main execution
* Update changelogs/fragments/1305-added-xfconf-tests.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/system/xfconf.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Removed extraneous import
Co-authored-by: Felix Fontein <felix@fontein.de>
* Adds a module for sending PagerDuty change events.
PagerDuty recently released a new feature called change events that behave similar to events that can trigger incidents, except they are used to track code/infrastrucure changes rather than triggering incidents. This change adds a module to easily allow creating change events from ansible deploys.
* Apply suggestions from code review
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Update copyright.
* Expand on example usage.
* Make API request with missing data when in check mode.
Just to ensure that we are hitting the correct API endpoint and it is responding as expected.
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* Clarify lack of idempotency.
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Felix Fontein <felix@fontein.de>
* added description parameter to create request
* added changelog fragment
* Update changelogs/fragments/1196-use_description-in-gitlab-group-creation.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* added integration test for description in gitlab_group
* per request in the PR, creating separate task for the description issue in the integration test
* replaced deprecated param names with new names
* description should be optional to keep backward compatibility
* Update plugins/modules/source_control/gitlab/gitlab_group.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* proxmox: ignore QEMU templates altogether
* add changelog fragment
* add test case
* Update changelogs/fragments/1185-proxmox-ignore-qemu-templates.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* refactor and test
* require version >= 5.21.0
Prior to this version the status output was different
* python version compatability
* use exception classes from utils
* modify monit to use 'status' output instead of 'summary' output
The summary output is a fixed width table which truncates the
contents and prevents us from parsing the actual status of the
program.
* add integration tests + fixes
* remove unused handlers in monit integration test
* fix lint
* add '__metaclass__ = type' to integration python files
* raise AttributeError
* simplify status
* lint: add type to parameter docs
* remove lint ignore
* move monit process config into main file
* specify path to monit PID file
* set config location based on os_family
* create required directories
* update aliases to set group and skips
* add changelog
* add author
* add types to docs
* add EPEL repo
* custom vars for centos-6
* uninstall EPEL
* support older versions
* wait for status to change before exiting
* use 'validate' to force status updates
* handle 'execution failed'
* better status output for errors
* add more context to failure + standardize
* don't check rc for validate
* legacy string format support
* add integration test for 'reloaded' and 'present'
* don't wait after reload
* lint
* Revert "uninstall EPEL"
This reverts commit 4d548718d0.
* make 'present' more robust
* Apply suggestions from code review
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* add license header
* drop daemon.py and use python-daemon instead
* skip python2.6 which is not supported by python-daemon
* refactor test tasks for reuse
* cleanup files after test
* lint
* start process before enabling monit
This shouldn't be necessary but I'm adding it in the hopes
it will make tests more robust.
* retry task
* attempt to rescue the task on failure
* fix indentation
* ignore check if rescue ran
* restart monit instead of reload
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* * Refactor `nmcli` module to use consistent parameters when creating/modifying connections and detecting changes.
* Keep DNS list arguments as lists internally.
* Remove duplicated code where practical.
* DBus and GObject dependencies are not necessary.
* Update changelog fragment.
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelog fragment.
Co-authored-by: Felix Fontein <felix@fontein.de>
* Use identity operator instead of equality for type comparison.
* Don't start changelog notes with a capital letter.
* * Have `settings_type` return `str` by default instead of `None`.
* Improve variable naming, use `convert_func` instead of `type_cast`.
* Revert new feature of allowing ethernet types as slaves.
* Bring back `list_connection_info` to list all connections with `nmcli con show`.
Co-authored-by: Felix Fontein <felix@fontein.de>
* move conversion of data to json in slack API handling
at one point in do_notify_slack, we do operations on the payload
variable assuming it's a dict, but it's not: it's a json encoded string.
it's useful to operate on the payload as a dict rather than a string, so
solve this problem by moving the jsonify call to right before sending
the payload to the slack API.
fixes#1097
* add changelog fragment
* Update changelogs/fragments/1101-slack-ts-fix.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* return payload as a json encoded string for backwards compatibility
Co-authored-by: Felix Fontein <felix@fontein.de>
* * Explicitly open up temporary file in text mode.
* Add test for `solaris_zone` creation.
* Update changelog fragment.
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add tests for zone deletion and invalid zone names.
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add inventory plugin for Stackpath Edge Compute
* Update comments from PR regarding general issues.
* Convert requests to ansible open_url
* Add types to documentation and replace stack ids with stack names
* Replace stack_ids with stack_slugs for easier readability, fix pagination and separate getting lists to a function
* create initial test
* fix test name
* fix test to look at class variable as that function doesn't return the value
* fix pep line length limit in line 149
* Add validation function for config options.
Add more testing for validation and population functions
* set correct indentation for tests
* fix validate config to expect KeyError,
fix testing to have inventory data,
fix testing to use correct authentication function
* import InventoryData from the correct location
* remove test_authenticate since there's no dns resolution in the CI,
rename some stack_slugs to a more generic name
fix missing hostname_key for populate test
* Fix typo in workloadslug name for testing
* fix group name in assertion
* debug failing test
* fix missing hosts in assertion for group hosts
* fixes for documentation formatting
add commas to last item in all dictionaries
* end documentation description with a period
* fix typo in documentation
* More documentation corrections, remove unused local variable
* parted: proper fix for change of partition label case
calling mkpart even when partition existed before mklabel call, fixes#522
* changelog fragment for parted fix#522
* Update changelogs/fragments/522-parted_change_label.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* typo in comment
Co-authored-by: Felix Fontein <felix@fontein.de>
* This commit adds proxmox inventory module and proxmox_snap for snapshot management
* Fixed pylint errors
* Missed this one..
* This should fix the doc errors
* Remove proxmox_snap to allow for single module per PR
* Changes as suggested by felixfontein in #535
* Reverted back to AnsibleError as module.fail_json broke it. Need to investigate further
* Made importerror behave similar to docker_swarm and gitlab_runner
* FALSE != False
* Added myself as author
* Added a requested feature from a colleague to also sort VMs based on their running state
* Prevent VM templates from being added to the inventory
* Processed feedback
* Updated my email and included version
* Processed doc feedback
* More feedback processed
* Shortened this line of documentation, it is a duplicate and it was causing a sanity error (> 160 characters)
* Added test from PR #736 to check what needs to be changed to make it work
* Changed some tests around
* Remove some tests, first get these working
* Disabled all tests, except the one I am hacking together now
* Added mocker, still trying to figure this out
* Am I looking in the right direction?
* Processed docs feedback
* Fixed bot feedback
* Removed all other tests, started with basic ones (borrowed from cobbler)
* Removed all other tests, started with basic ones (borrowed from cobbler)
* Removed all other tests, started with basic ones (borrowed from cobbler)
* Removed init_cache test as it is implemented on a different way in the original foreman/satellite inventory (and thus also this one)
* This actually passes! Need to check if I need to add asserts as well
* Made bot happy again?
* Added some assertions
* Added note about PVE API version
* Mocked only get_json, the rest functions as-is
* Fixed sanity errors
* Fixed version bump (again...) ;-)
* Processed feedback
* Adding types to sysupgrade documentation
* Apply suggestions from code review
* Adding installurl flag. Changing wording in example.
* Use None for installurl by default
* Changing word case in description
* sysupgrade: use module structure recommended by Ansible unit test docs
* Adding unit test for sysupgrade
Signed-off-by: Andrew Klaus <andrew@aklaus.ca>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Slack: add support for blocks
* Slack: drop unused validate_certs option
* Slack: update docs to reflect thread_id can be sent with tokens other than WebAPI
* Slack: drop escaping of quotes and apostrophes
* Slack: typo
* Revert "Slack: drop escaping of quotes and apostrophes"
This reverts commit bc6120907e.
* Revert "Slack: drop unused validate_certs option"
This reverts commit a981ee6bca.
* Slack: other/minor PR feedback
* Slack: add changelog fragment
* Slack: clean-up/clarify use of recursive escaping function
* Slack: PR feedback
Co-authored-by: Lee Goolsbee <lgoolsbee@atlassian.com>
* Add cobbler inventory plugin
* Add elements, caps
* Use fail_json if we cannot import xmlrpc_client
* [cobbler] Raise AnsibleError for errors
* [plugins/inventory/cobbler] Add cache_fallback option
* [inventory/cobbler] Use != for comparison
* [inventory/cobbler] Add very basic unit tests
* Update plugins/inventory/cobbler.py
Use full name
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Revert "Remove entries of modules that no longer exist." partially.
This reverts commit c1e1b37da4.
* Revert "The _info module is in google.cloud."
This reverts commit 26f5c84924.
* Revert "Remove modules that were moved to the google.cloud collection according to ansible/ansible's ansible_builtin_runtime.yml."
This reverts commit a1442ccc35.
* Fix FQCNs in examples and module references.
* Add changelog fragment.
* Update ignore.txt.
* Remove bad lines.
* Add the Thycotic Secret Server lookup plugin.
* Update plugins/lookup/tss.py
Co-Authored-By: Felix Fontein <felix@fontein.de>
* Fix import error check per code review.
* Apply suggestions from code review
Co-Authored-By: Felix Fontein <felix@fontein.de>
* Trivial changes based on suggestions from code review.
* Add a unittest for plugins/lookup/tss.py
* Add copyrights.
* Fixed formatting bug in test_tss.py
* Fix formatting bugs in tss.py and test_tss.py
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* - Redirecting to correct collection
- Removing the plugin and adding changelog and deprecation
* Making suggested changes
* Earlier version on leftovers
* Update changelogs/fragments/cyberarkconjur-removal.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* nmcli: add idemptent support for any kinds of connections
Fixes#481: nmcli reports changed status even if nothing needs to change
- Implement show_connection() to retrieve connection profile from command line
- Parse integer enumeration values in show_connection()
- Convert 'bond.options' to alias shortcuts
- Modify connection only if changes are detected
- Support generic alias in during the property comparison
* nmcli: add idemptent support for any kinds of connections
Add mock object for modification cases when connection state changes
* nmcli: add idempotent support for any kinds of connections
- Add more test cases to check idempotent for each type of connections
- Verify 'changed' and 'failed' in the result of each test
- Append prefixlen for 'ip4' values in test data
- Fix the incorrect 'return_value' of execute_command() in previous mockers
- Ignore the empty string in _compare_conn_params()
- Fix the property key mapping of 'bridge-port.hairpin-mode' for bridge-slave
- Add 'override_options' in the result output for playboot debug
* nmcli: add idempotent support for any kinds of connections
Fix pep8 issues in test_nmcli.py: Comparison to False should be 'not expr'
* nmcli: add idempotent support for any kinds of connections
Support setting 'ipv4.method' or 'ipv6.method' via nmcli if the configuration method changes
* nmcli: add idempotent support for any kinds of connections
Simplify the if statements in show_connection() according to vlours's advice
* nmcli: add idempotent support for any kinds of connections
Fix the list argument comparison method with multiple values.
* nmcli: add idempotent support for any kinds of connections
Use ansible --diff option output to show detailed changes instead of a private return value.
* nmcli: add idempotent support for any kinds of connections
Add changelog fragment for bugfix.
* Allow passing negative numbers to specify partition boundary relative to disk end
Fixes: https://github.com/ansible/ansible/issues/43369
* parted: unit test case, create partition with part_start: -1GiB
* fs_type parameter is not really optional for negative part_start parameter
* Revert "fs_type parameter is not really optional for negative part_start parameter"
This reverts commit 800b1cb00b.
Instead: added notes and documentation about netagive part_start and fs_type.
* include fs_type in negative part_start example
* Adjust deprecation versions.
* Remove redirects that are already made in ansible/ansible's ansible_builtin_runtime.yml
* Remove modules that were moved to the google.cloud collection according to ansible/ansible's ansible_builtin_runtime.yml.
* The _info module is in google.cloud.
* The gcp doc_fragment is a copy of the one in google.cloud and is only used by one lookup. Mark as deprecated/internal.
* Remove entries of modules that no longer exist.
* Update ignore.txt.
* Try to fix test.
* Remove debug output.
* This fixes (#275)
* Migrated PR from https://github.com/ansible/ansible/pull/47768
* Applied requested changes
* Fixed issue with load_file_common_arguments
* Using args list when calling run_commands
* Keytool now reads passwords from stdin
* Fixed PEP8 indentation issues
* parted: consider current partition state even in check_mode
* Update changelogs/fragments/183-parted_check_mode.yml
Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru>
* Test check_mode considers get_device_info
* fixed pep8 E302: expected 2 blank lines
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Add info command to redis module
* Fix sanity test
* Create a separate redis_info module
* Type of arguments in documentation was determined
* Add redis_info test
* Fix sanity test
* Add integration test
* Add integration platforms (centos7/8,fedora30/31,opensuse15+py2,ubuntu1604/1804)
* Add centos6 support
* Fix suggestions
* Add contact email
* Convert integrated simple fetch_url() checking framework from hetzner_firewall tests to proper framework which can also be used by other modules.
* Linting.
* One more.
* Use community.internal_test_tools collection.
* Slack: Add bot/user token support, correct thread_ts support
Add support for user/bot/application tokens (and Slack WebAPI).
Fix input type for thread_id, which needs to be string.
Return thread_ts/thread_id when user/bot tokens are used, so they can be reused later
* Slack: Add changelog fragment, fix YAML syntax
Co-authored-by: Middleton, Michal <Michal.Middleton@concur.com>
* Replace missing netapp parts with own copy.
* Localize final fragment.
* Mark netapps docs fragment as deprecated.
* Drop dependency on netapp.ontap.
* Remove all netapp_e_* modules.
* Remove docs fragment.
* Fix become plugins.
* Fix become unit tests to avoid play_context.make_become_cmd.
* Remove hack.
* Remove explicit defaults. Adjust tests to be more like Ansible itself.
* Forgot two lines.
* Rewrite tests (again).
* Rename play_context -> task, add possibility to pass var_options.
* Add var_options variants.
* Properly test overwriting.
* Fix ovirt collection name (ovirt.ovirt_collection, not ovirt.ovirt).
* Fix kubernetes module_utils references.
* Fix broken f5 imports on community.general side. The imports in that collection are still broken and will still cause failures.
* Fix Cisco ACI and MSO modules imports.
* Fix check_point.mgmt dependency, fix imports.
* Fix fortimanager imports.
* Fix cisco intersight imports.
* Fix ovirt module docs fragments.
* Fix usage of _ in unit tests to avoid sanity failures.
* Fix Cisco module docs fragments.
* Fix netapp.ontap module docs fragment name.
* Fix documentation.
* Fix some boilerplate (the ones not mentioned in ignore.txt).
* Fix Hetzner firewall unit test imports.
* Make sure tests can actually access collections.
* Fix more relative imports.
* Fix more relative imports.
* Fix more includes.
* Fix more tests.
* One more.
* Fix syntax error in sanity import tests (invalid escape sequence "\$" caused by non-raw docs block)
* Fix permissions of ansible-test parts for sanity tests.
* Revert "Fix permissions of ansible-test parts for sanity tests."
This reverts commit c2713f0a12.