* rhn_register: added force option to allow forced registering (#1454)
* rhn_register: added disable=bad-option-value to pylint disables for backwards compat
* rhn_register: including version_added for force parameter
Co-authored-by: Felix Fontein <felix@fontein.de>
* [1455] added changelog fragment
* removed unnecessary pylint disables
* Updated changelogs/fragments/1455-rhn-register-force.yml to have issue # instead of PR #
Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Fix#1435: mas : Fix "invalid literal" when no app
* Add changelog fragment
* Update changelogs/fragments/1436-mas-fix-no-app-installed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
jmespath library does not undestand custom string types
such as AnsibleUnicode, and AnsibleUnsafeText.
So user need to use ``to_json | from_json`` filter while using
functions like ``starts_with`` and ``contains`` etc.
This hack will allow user to get rid of this filter.
Fixes: #320
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* proxmox{,_kvm,_template}: import auth doc fragment
* proxmox{,_kvm}: new common doc_fragment
Share the parameters `pool`, `vmid` and `node`.
* proxmox_template: sync node description
* changelog_framgent
* [icinga2_host.py] Actually return codes instead of data
Currently the module tries to return the `data`, which can result in a blank message instead of the code being shown.
```
"msg": "bad return code creating host: "
```
* add changelog fragment
* Update changelogs/fragments/335-icinga2_host-return-error-code.yaml
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* return code and data on fail
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Deric Crago <deric.crago@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Remove and redirect oc module.
* Add changelog fragment for move of oc connection plugin to OKD collection.
* Update BOTMETA as well.
* Newer changelog fragment format.
* Update changelogs/fragments/oc-migration-removal.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fixed validate-modules:mutually_exclusive-unknown for plugins/modules/packaging/os/redhat_subscription.py
* fixed validation-modules for plugins/modules/cloud/lxd/lxd_container.py
* fixed validation-modules for plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address.py
* fixed validation-modules for plugins/modules/cloud/opennebula/one_host.py
* fixed validation-modules for plugins/modules/cloud/opennebula/one_image_info.py
* fixed validation-modules for plugins/modules/cloud/opennebula/one_image.py
* fixed validation-modules for plugins/modules/cloud/opennebula/one_service.py
* fixed validation-modules for plugins/modules/cloud/opennebula/one_vm.py
* fixed validation-modules for plugins/modules/net_tools/cloudflare_dns.py
* fixed validation-modules for plugins/modules/net_tools/ip_netns.py
* fixed validation-modules for plugins/modules/net_tools/ipinfoio_facts.py
* fixed validation-modules for plugins/modules/net_tools/netcup_dns.py
* fixed validation-modules for plugins/modules/remote_management/wakeonlan.py
* added types to plugins/modules/remote_management/stacki/stacki_host.py but still cannot remove ignore line
* added a couple of FIXME comments
* fixed validation-modules for plugins/modules/remote_management/manageiq/manageiq_provider.py
* fixed validation-modules for plugins/modules/notification/rocketchat.py
* fixed validation-modules for plugins/modules/monitoring/bigpanda.py
* fixed validation-modules for plugins/modules/identity/keycloak/keycloak_client.py
* fixed validation-modules for plugins/modules/identity/keycloak/keycloak_clienttemplate.py
* fixed validation-modules for plugins/modules/cloud/univention/udm_user.py
* fixed validation-modules for plugins/modules/cloud/univention/udm_group.py
* fixed validation-modules for plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py
* fixed validation-modules for plugins/modules/cloud/smartos/imgadm.py
* fixed validation-modules for plugins/modules/cloud/profitbricks/profitbricks_nic.py
* fixed validation-modules for plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py
* Tidy up validate-modules ignores no-default-for-required-parameter + couple of other cases
* Added changelog frag
* fixed validation-modules for plugins/modules/cloud/centurylink/clc_alert_policy.py
* fixed validation-modules for plugins/modules/cloud/centurylink/clc_firewall_policy.py
* fixed validation-modules for plugins/modules/cloud/lxd/lxd_profile.py
* Typos and small fixes
* fixed validation-modules for plugins/modules/net_tools/ldap/ldap_passwd.py
* Typos and small fixes, part 2
* Fixes from PR comments
* Update plugins/modules/cloud/profitbricks/profitbricks_nic.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Rolled back the mutually-exclusive-unknown in redhat_subscription
* Update changelogs/fragments/1423-valmod_multiple_cases.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Tidy up validate-modules ignores doc-required-mismatch
* Tidy up validate-modules ignores doc-required-mismatch - update on 2.11
* Fixed chengelog frag
* rolledback removal of parameter from cloud/smartos/vmadm.py
* removed changelog frag for the rollback
* Update plugins/modules/cloud/smartos/vmadm.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Revert "removed changelog frag for the rollback"
This reverts commit 56a02ead3b.
* suggestion from PR
* yet another PR suggestion
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.
* adding fix for packet_net.py
* adding changelog fragment
* squashing to fix cascading notifications
Apply suggestions from code review
thanks felixfontein for working with me!
Co-authored-by: Felix Fontein <felix@fontein.de>
adding suggestions from code review (accessing dict in a better way)
modified packet_net fragment to accurate description
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* 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>
* Datadog: Mark notification_message as no_log
This message field is often used to page people or teams inside
an organization when a monitor goes off, by using `@` mentions.
If Ansible is configured to use Datadog's callback plugin [1], an
unwanted interaction would happen:
When a monitor fails to create, the callback sends an error event
to Datadog which contains all the task's loggable fields in it.
If the message field contains `@` mentions, this event would page
the people on them.
[1] https://github.com/DataDog/ansible-datadog-callback
* Add changelog fragment
* Update changelogs/fragments/1338-datadog-mark-notification_message-no_log.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* proxmox: create a common base
Add a doc_fragment to share the documentation regarding authentication
parameters (api_host, api_user, api_password, api_token_id,
api_token_secret as well as the lone validate_certs).
Add a module_utils to hold common code such as the argument spec (again
related to authentication paramters), a helper function to convert from
Proxmox boolean representation to python and the base class
ProxmoxAnsible.
For now it only handles the connection to Proxmox VE API but more can be
added in the future.
To check if everything is well in place add three new modules:
proxmox_{domain,group,user}_info.
And finaly tests these new modules.
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add tests/integration/targets/proxmox/aliases
Co-authored-by: Felix Fontein <felix@fontein.de>
* Added umask option to passwordstore lookup plugin.
* Added umask documentation and changelog fragment.
* Added default values to paramvals within the run method.
* removed blank lines (PEP8)
* Update changelogs/fragments/lookup-passwordstore-umask.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/lookup/passwordstore.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/lookup-passwordstore-umask.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* passwordstore lookup plugin: changelog fragment update
* passing environment variables to subprocess.Popen()
* Update plugins/lookup/passwordstore.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* rm trailing whitespace
* Don't force default umask in the plugin, pass will take care of this.
* remove default from the documentation string
* remove trailing whitespaces
* prevent KeyErrors when checking if key exits in paramvals.
* Update plugins/lookup/passwordstore.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fix for TypeError
* revert back to old directory test
Co-authored-by: bratw0rst <c.chmiel@speakup.nl>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Remove deprecated modules and plugins.
* Clean up BOTMETA.
* Re-add _netapp doc fragment and module utils. This is needed by the remaining na_ontap_gather_facts module scheduled for removal in 3.0.0.
* * 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
* [pkgng] introduce IGNORE_OSVERSION to pkgng
* [pkgng] add small description about IGNORE_OSVERSION
- source: https://www.freebsd.org/cgi/man.cgi?query=pkg.conf&sektion=5
* [pkgng] initialize default value of 'ignoreosver' as False
* [pkgng] replace double quotes by single ones, when setting 'ignoreosver'
* [pkgng] do not make 'ignoreosver' a required option for this module
* [pkgng] mode the point we set IGNORE_OSVER into install_packages()
* [pkgng] restrict the use of 'ignoreosver' to pkg versions >= 1.11
- https://github.com/freebsd/pkg/blob/release-1.11/NEWS#L51
* [pkgng] value of 'ignoreosver' passed to install_packages
- install_packages() contains a taks to update local pkgs cache;
- should that update be triggered, AND 'ignoreosver' is set to True,
we must change existing "batch_var" and add the IGNORE_OSVERSION=yes
to the environment;
- there pkg running on STABLE or CURRENT FreeBSD machines will have a
chance to proceed with the "update" action
* [pkgng] create option description for "ignoreosver" and its defaults
* [pkgng] make sure we do use IGNORE_OSVERSION when action is "update"
* [pkgng] add more information on how 'ignoreosver' works
Signed-off-by: Vinicius Zavam <egypcio@googlemail.com>
* [pkgng] create changelog fragment for PR #1243
Signed-off-by: Vinicius Zavam <egypcio@googlemail.com>
* [pkgng] add information about when we start to offer 'ignoreosver'
Signed-off-by: Vinicius Zavam <egypcio@googlemail.com>
* [pkgng] rename 'ignoreosver' -> 'ignore_osver'
Signed-off-by: Vinicius Zavam <egypcio@googlemail.com>
* [pkgng] remove unnecessary backslashes for install_packages() call
Signed-off-by: Vinicius Zavam <egypcio@googlemail.com>
* [pkgng] fix changelog fragment's formating
Signed-off-by: Vinicius Zavam <egypcio@googlemail.com>
* Adjust path for time stamped SNAPSHOT versions
Test the version string for the timestamp SNAPSHOT pattern. If it matches, substitute the SNAPSHOT version in the artifact path rather than the timestamped version string.
* Add changelog fragment for PR 713
* Update changelogs/fragments/713-maven-timestamp-snapshot.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* C
Fix problems reported by shippable
Fix problems reported by pull request checks
* Resolve additional shipping errors
Co-authored-by: jweber <jweber@seastreet.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Provides an alternative authentication method to the password.
The token validity is only tested during the first request after the
instantiation of `ProxmoxAPI`, thus the presence of a call to
`proxmox.version.get()` in `proxmox_template`.
Example:
- name: Ensure test-vm is created
proxmox_kvm:
api_host: prx-test
api_user: tleguern@pve
api_token_id: api-pve-test
api_token_secret: fad3db3d-b335-ee15-9fb0-ea1bf70128db
node: prx-test-01
name: test-vm
...
As per the plugin documentation and the Hashicorp Vault documentation (https://www.vaultproject.io/docs/auth/approle#secretid)
secret_id is not mandatory.
Moreover, using this lookup plugin without a secret_id used to work in
Ansible 2.9.
Co-authored-by: Jonathan Piron <jonathanpiron@gmail.com>
* 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>
* Add support for Hashicorp Vault JWT auth
* Add support for HashiCorp Vault JWT auth (continued)
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Mike Brancato <mike@mikebrancato.com>
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
* proxmox_kvm: pool parameter not supported by API on update
* added changelog fragment
* format fix and pull request link added
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>