Compare commits

...

50 Commits
2.0.0 ... 2.1.0

Author SHA1 Message Date
Felix Fontein
331d2c7651 Release 2.1.0. 2021-02-16 12:13:27 +01:00
patchback[bot]
b35a262378 StatsD Module (#1793) (#1842)
* Pushing my WIP

* Update DOCUMENTATION

* Update EXAMPLES

* More friendly name

* Finish up the counter and gauge logic

* Cleanup DOCUMENTATION and add metric_type

* Apply autopep8

* Fixup the exits

* Stubbing out unit tests

* Whitespace

* Whitespace

* Removing unused modules

* Remove unused modules

* Might have have a prefix

* Rearrange imported modules

* Cleanup the if/elif blob

* Require python >= 2.7

* Update DOCUMENTATION

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

* Update DOCUMENTATION

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

* Add import guarding on statsd

* Add missing future import

* Include missing_required_lib

* Fixing sanity tests

* Fixing delta default and choices

* Formatting

* Close tcp connection

* Refactoring and unit tests

* Fix pep8 sanity tests

* Putting requirements.txt back to main

* Apply suggestions from code review

Co-authored-by: Mark Mercado <mmercado@digitalocean.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 6165438689)

Co-authored-by: Mark Mercado <mamercad@gmail.com>
2021-02-16 12:09:58 +01:00
patchback[bot]
7d400663b6 Previously LXD profiles were overwritten, now these are merged. (#1813) (#1836)
* added ``merge_profile`` parameter to merge configurations from the play to an existing profile

* add fragment

* cosmetic changes

Co-authored-by: Frank Dornheim <“dornheim@posteo.de@users.noreply.github.com”>
(cherry picked from commit 6dd4cd0eb7)

Co-authored-by: Frank Dornheim <524257+conloos@users.noreply.github.com>
2021-02-16 10:58:34 +01:00
patchback[bot]
0d0884b069 Tidy up validations + bug fixes + deprecations (#1830) (#1841)
* fixed validation-modules for plugins/modules/database/misc/elasticsearch_plugin.py

* fixed validation-modules for plugins/modules/database/misc/kibana_plugin.py

* fixed validation-modules for plugins/modules/database/misc/riak.py

* fixed validation-modules for plugins/modules/database/vertica/vertica_info.py

* fixed validation-modules for plugins/modules/database/vertica/vertica_role.py

* fixed validation-modules for plugins/modules/database/vertica/vertica_schema.py

* fixed validation-modules for plugins/modules/database/vertica/vertica_user.py

* fixed validation-modules for plugins/modules/storage/ibm/ibm_sa_domain.py

* fixed validation-modules for plugins/modules/storage/ibm/ibm_sa_host_ports.py

* fixed validation-modules for plugins/modules/storage/ibm/ibm_sa_host.py

* fixed validation-modules for plugins/modules/storage/ibm/ibm_sa_pool.py

* fixed validation-modules for plugins/modules/storage/ibm/ibm_sa_vol.py

* fixed validation-modules for plugins/modules/storage/ibm/ibm_sa_vol_map.py

* fixed validation-modules for plugins/modules/storage/ibm/ibm_sa_host_ports.py

* fixed validation-modules for plugins/modules/system/runit.py

* fixed validation-modules for plugins/modules/source_control/bzr.py

* fixed validation-modules for plugins/modules/source_control/hg.py

* fixed validation-modules for plugins/modules/storage/emc/emc_vnx_sg_member.py

* fixed validation-modules for plugins/modules/identity/opendj/opendj_backendprop.py

* fixed validation-modules for plugins/modules/files/iso_extract.py

* fixed validation-modules for plugins/modules/monitoring/logstash_plugin.py

* fixed validation-modules for plugins/modules/database/aerospike/aerospike_migrations.py

* Tidy up a number of sanity checks for some modules

* added changelog fragment

* Some parameters in vertica_* had their aliases documented as the name, and sometimes vice-versa as well

* Adjustments per PR

* Rolled back sanity ignores for runit

* Update changelogs/fragments/1830-valmod_docmissingtype_batch1.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 3778eac1ba)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-16 09:10:13 +00:00
patchback[bot]
dd400e8c21 Tidy up all pylint:blacklisted-name ignore lines (#1819) (#1839)
* fixed validation-modules for plugins/callback/hipchat.py

* fixed validation-modules for plugins/connection/lxc.py

* fixed validation-modules for plugins/modules/cloud/lxc/lxc_container.py

* fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py

* fixed validation-modules for plugins/modules/system/alternatives.py

* fixed validation-modules for plugins/modules/system/beadm.py

* fixed validation-modules for plugins/modules/system/cronvar.py

* fixed validation-modules for plugins/modules/system/dconf.py

* fixed validation-modules for plugins/modules/system/interfaces_file.py

* fixed validation-modules for plugins/modules/system/java_cert.py

* fixed validation-modules for plugins/modules/system/lvg.py

* fixed validation-modules for plugins/modules/system/lvol.py

* fixed validation-modules for plugins/modules/system/parted.py

* fixed validation-modules for plugins/modules/system/timezone.py

* fixed validation-modules for plugins/modules/web_infrastructure/rundeck_acl_policy.py

* Tidy up all pylint:blacklisted-name sanity checks ignore lines

* Missed one in statusio_maintenace.py

* fixed validation-modules for plugins/modules/system/filesystem.py

* Missed one in gconftool2.py

* Missed one in alternatives.py

* Using dummies now

* fixed indentation

* Made all the changes about replacing _ with dummy

* Rollback bug fixed

* Rollback bug fixed, part II

* added changelog fragment

* Improved changelog frag message per PR

(cherry picked from commit 03b7b39424)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-16 08:46:20 +01:00
patchback[bot]
a60f9bc78b dnsimple: Add support for CAA records (#1814) (#1835)
(cherry picked from commit 03fd6bd008)

Co-authored-by: Craig Roberts <github@craig.craig0990.co.uk>
2021-02-16 07:55:35 +01:00
Felix Fontein
47714ecf79 Add release summary for 1.2.0. 2021-02-16 07:48:13 +01:00
patchback[bot]
d15ed4135b Tidy up validate-modules:parameter-list-no-elements (batch 1) (#1795) (#1834)
* fixed validation-modules for plugins/modules/storage/netapp/na_ontap_gather_facts.py

* fixed validation-modules for plugins/modules/source_control/gitlab/gitlab_runner.py

* fixed validation-modules for plugins/modules/packaging/os/redhat_subscription.py

* fixed validation-modules for plugins/modules/notification/twilio.py

* fixed validation-modules for plugins/modules/notification/slack.py

* fixed validation-modules for plugins/modules/notification/sendgrid.py

* fixed validation-modules for plugins/modules/notification/rocketchat.py

* fixed validation-modules for plugins/modules/notification/office_365_connector_card.py

* fixed validation-modules for plugins/modules/notification/nexmo.py

* fixed validation-modules for plugins/modules/notification/mail.py

* fixed validation-modules for plugins/modules/net_tools/omapi_host.py

* fixed validation-modules for plugins/modules/net_tools/nsupdate.py

* fixed validation-modules for plugins/modules/net_tools/dnsimple.py

* fixed validation-modules for plugins/modules/monitoring/pagerduty.py

* fixed validation-modules for plugins/modules/monitoring/librato_annotation.py

* fixed validation-modules for plugins/modules/identity/onepassword_info.py

* fixed validation-modules for plugins/modules/identity/keycloak/keycloak_client.py

* fixed validation-modules for plugins/modules/files/xml.py

* fixed validation-modules for plugins/modules/cloud/softlayer/sl_vm.py

* fixed validation-modules for plugins/modules/cloud/smartos/vmadm.py

* fixed validation-modules for plugins/modules/cloud/pubnub/pubnub_blocks.py

* fixed validation-modules for plugins/modules/cloud/packet/packet_device.py

* fixed validation-modules for plugins/modules/cloud/lxd/lxd_container.py

* fixed validation-modules for plugins/module_utils/oracle/oci_utils.py

* fixed validation-modules for plugins/doc_fragments/oracle_creatable_resource.py

* Tidy up validate-modules:parameter-list-no-elements for some modules

* fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py

* Fixed pending issues from CI validation

* Fixed xml module elements for add_children & set_children

* added changelog fragment

* typo

* fix wording in changelog frag

(cherry picked from commit f33323ca89)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-16 07:38:50 +01:00
patchback[bot]
bd61228e40 proxmox_kvm: 500 error args parameter (#1783) (#1832)
* don't add args if set to 'no_defaults'

* never add force even if false, will require archive parameter other which is not implemented

* remove trailing whitespace

* add changelog fragment

* Update changelogs/fragments/1783-proxmox-kvm-fix-args-500-error.yaml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5aac81bdd1)

Co-authored-by: almdudler777 <43605831+almdudler777@users.noreply.github.com>
2021-02-16 07:10:40 +01:00
patchback[bot]
26d7c28b33 ease limitation for nios_host_record DNS Bypass (#1788) (#1826)
* ease limitation for nios_host_record DNS Bypass, the bypass should be allowed when configure_dns is disabled and view is set other than default

* add changelog fragment

Co-authored-by: Nils <ext-nils.haglund@elisa.fi>
(cherry picked from commit 8fae693d9c)

Co-authored-by: shieni <shieni@users.noreply.github.com>
2021-02-15 09:10:18 +01:00
patchback[bot]
2e533daffa Fix undeclared result for nomad_job_info module (#1721) (#1823)
* Fix unassigned variable

* Create 1721-fix-nomad_job_info-no-jobs-failure.yml

* refactor usage of variables in nomad_job_info

* Update changelogs/fragments/1721-fix-nomad_job_info-no-jobs-failure.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit d09a558fda)

Co-authored-by: Víctor Suárez Fernández <15276132+vicsufer@users.noreply.github.com>
2021-02-15 09:04:44 +01:00
patchback[bot]
6c50119eab Added VMID to all returns (#1715) (#1824)
* Added VMID to all returns

Also added in the docs promised return of MAC and devices when state ==
current.

Fixes: #1641

* Revert devices and mac as get_vminfo works differently then I expected

* Added status output to a few more calls

* Update RETURNS docs

* Remove vmid where it is not available

* Added changelog fragment

* Update changelogs/fragments/1715-proxmox_kvm-add-vmid-to-returns.yml

You're right, this message is way better then mine.. :-)

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 1cce279424)

Co-authored-by: Jeffrey van Pelt <jeff@vanpelt.one>
2021-02-15 08:57:38 +01:00
patchback[bot]
bc3435b993 Tidy up validation for storage/zfs modules (#1766) (#1821)
* fixed validation-modules for plugins/modules/storage/zfs/zfs.py

* fixed validation-modules for plugins/modules/storage/zfs/zfs_delegate_admin.py

* fixed validation-modules for plugins/modules/storage/zfs/zfs_facts.py

* fixed validation-modules for plugins/modules/storage/zfs/zpool_facts.py

* Tidy up validate-modules ignores for storage/zfs modules

* removed ignore lines in 2.11 files as well

* added changelog fragment per PR

* Update changelogs/fragments/1766-zfs-fixed-sanity.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit bd372939bc)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-15 07:27:23 +00:00
patchback[bot]
370f5d8082 Implemented fix pointed in issue (#1760) (#1818)
(cherry picked from commit 41bc7816f3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-14 16:05:59 +01:00
patchback[bot]
e77c5413c9 Adjusted django_manage integration test files to reduce ignore lines in sanity tests (#1805) (#1810)
(cherry picked from commit e247300523)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-13 12:49:36 +01:00
patchback[bot]
800ee1bae0 Tidy up validate-modules ignores for cloud/centurylink modules (#1771) (#1811)
* fixed validation-modules for plugins/modules/cloud/centurylink/clc_alert_policy.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_blueprint_package.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_firewall_policy.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_loadbalancer.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_modify_server.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_publicip.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_server_snapshot.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_server.py

* Tidy up validate-modules ignores for cloud/centurylink modules

* added changelog fragment per PR

(cherry picked from commit 865acdd4cf)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-13 12:35:18 +01:00
patchback[bot]
8de8d21062 Make selective callback work with ansible-core 2.11. (#1807) (#1809)
(cherry picked from commit 367c3c43ff)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-13 12:24:10 +01:00
patchback[bot]
81e71b5034 Improved parameter handling on proxmox modules (#1765) (#1801)
* Improved parameter handling on proxmox modules

* removed unused imports

* rollback change in plugins/modules/cloud/misc/proxmox_user_info.py

* added changelog fragment

* Update changelogs/fragments/1765-proxmox-params.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 0a5f79724c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-12 17:08:14 +01:00
patchback[bot]
44ce63ed85 Change type str -> path in argspec. (#1741) (#1800)
(cherry picked from commit f12df1d21b)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-12 08:23:40 +01:00
patchback[bot]
a3c9c688b9 Removed parameter-list-no-elements validation errors from redfish modules (#1761) (#1799)
* Removed parameter-list-no-elements validation errors from redfish modules

* added changelog fragment per PR

* Update changelogs/fragments/1761-redfish-tidy-up-validation.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit ba4a98b1be)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-12 07:14:07 +01:00
patchback[bot]
a332ed4429 Prevented the expansion of parameters in run_command() (#1794) (#1796)
(cherry picked from commit 436bbb0077)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-12 06:38:37 +01:00
patchback[bot]
91571f8bff Update CI (#1782) (#1787)
* 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.

(cherry picked from commit e9551df5ed)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-11 11:10:42 +01:00
patchback[bot]
43856eaa6f Fix typo in aerospike_migration module. (#1740) (#1785)
(cherry picked from commit 9a6031ab4e)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-11 07:31:05 +01:00
patchback[bot]
ae87b5479a only set param features when variable is not empty (#1763) (#1781)
* only set param features when variable is not empty

* Apply suggestions from code review

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

Co-authored-by: Topper Harly <topperharly@gmx.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 562ff7efb7)

Co-authored-by: topperharly <topperharly@users.noreply.github.com>
2021-02-10 22:32:01 +01:00
patchback[bot]
42cd462780 redfish module_utils: case insesitive search for situations where the hostname/FQDN on iLO is in caps (#1744) (#1780)
* case insesitive search for situations where the hostname/FQDN on iLO is in caps

* handle explicit and implicit nic_addr variable, added changelog fragment

* changelog linter fix

* changelog typo fix

Co-authored-by: Łukasz Kurdziel <Lukasz.Kurdziel@GAINCapital.com>
(cherry picked from commit 93e0aa7557)

Co-authored-by: lukurde <47138492+lukurde@users.noreply.github.com>
2021-02-10 20:37:49 +01:00
patchback[bot]
d871378574 xfconf: feature flag to disable facts and deprecation warning (#1747) (#1778)
* Added feature flag to disable facts and its associated deprecatoin warning

* added changelog fragment

* Update plugins/modules/system/xfconf.py

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

* Update plugins/modules/system/xfconf.py

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

* Update plugins/modules/system/xfconf.py

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

* Fixed deprecation message

* Fixed changelog frag

* Update changelogs/fragments/1475-xfconf-facts.yml

* Update plugins/modules/system/xfconf.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit af64c9a432)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-10 20:37:31 +01:00
patchback[bot]
983b292399 timezone: add gentoo and alpine linux support (#1722) (#1779)
* add alpine linux as NosystemdTimezone

* syntax error fix and more self variables, so it works now...

* use timezone name instead of timezone path for setup-timezone command

* alpine linux zoneinfo links to /etc/zoneinfo instead of /usr/share/zoneinfo, so correct re.search() pattern

* add changelog fragment

* add gentoo linux support

* Update 1722_timezone.yml

* refactor code

(cherry picked from commit 9aef0ed17e)

Co-authored-by: Anatoly Pugachev <matorola@gmail.com>
2021-02-10 20:37:15 +01:00
patchback[bot]
6831aa5501 document what filesystem types are supported by 'resizefs' option (#1753) (#1775)
* document what filesystem types are supported by 'resizefs' option

* add changelog fragment

* remove info about lvol documentation changes in changelog fragment

(cherry picked from commit d1e54d2fd1)

Co-authored-by: quidame <quidame@poivron.org>
2021-02-10 13:09:33 +01:00
patchback[bot]
2d8a94a459 azure-pipelines: update container version (#1770) (#1773)
(cherry picked from commit e898e52d1b)

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2021-02-10 10:12:56 +01:00
patchback[bot]
f721e76fdc Tidy up validate-modules ignores for remote_management/ipmi modules (#1767) (#1769)
* fixed validation-modules for plugins/modules/remote_management/ipmi/ipmi_boot.py

* fixed validation-modules for plugins/modules/remote_management/ipmi/ipmi_power.py

* Tidy up validate-modules ignores for remote_management/ipmi modules

(cherry picked from commit 89ffb04dff)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-02-10 08:24:33 +01:00
Felix Fontein
3eadb9d637 Revert "Revert new features since the 2.0.0 release so we can release 2.0.1 from this branch."
This reverts commit 1d90e91528.
2021-02-09 15:42:39 +01:00
Felix Fontein
033582b696 Next expected release is 2.1.0. 2021-02-09 15:42:39 +01:00
Felix Fontein
974997594f Release 2.0.1. 2021-02-09 13:34:53 +01:00
Felix Fontein
fa8ce6dea8 Add 2.0.1 relesae summary. 2021-02-09 13:32:06 +01:00
Felix Fontein
1d90e91528 Revert new features since the 2.0.0 release so we can release 2.0.1 from this branch.
Revert "datadog_monitor: Add missing monitor types query alert, trace-analytics alert, rum alert (#1723) (#1733)"
Revert "homebrew_tap: Add support for brew search path (#1708) (#1709)"

This reverts commits f613983cb4 and 646ca74810.
2021-02-09 13:30:39 +01:00
patchback[bot]
a90e2c8002 Various fixes for updating existing gitlab users (#1724) (#1757)
* 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>
(cherry picked from commit c03ae754d2)

Co-authored-by: morco <thegreatwiper@web.de>
2021-02-09 12:02:03 +01:00
patchback[bot]
c506375f2a Fix CI (#1752) (#1754)
* Limit cryptography to < 3.4 for Python < 3.6.

* Work around old pip versions.

* Use constraints file when installing stormssh.

* Work around old pip in RHEL8.2, CentOS 8, Ubuntu 18.04, and OpenSuSE 15

(cherry picked from commit 909ac92fe2)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-09 10:28:39 +01:00
patchback[bot]
4def9439bd Fix a bunch of potential security issues (secret leaking) (#1736) (#1751)
* Fix a bunch of potential security issues (secret leaking).

* oneandone_server was already ok.

* Add more parameters for pagerduty_alert.

* Add more no_log=True.

(cherry picked from commit 29bd5a9486)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-08 17:04:38 +01:00
patchback[bot]
023654473b Make sure mercurial is also installed on OpenSuSE. (#1734) (#1738)
(cherry picked from commit 701a89eb1c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-05 08:29:28 +01:00
patchback[bot]
a216f15dd9 parted: fix regex for version match and partition size output (#1695) (#1732)
* 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>
(cherry picked from commit 43da5b88db)

Co-authored-by: Anatoly Pugachev <matorola@gmail.com>
2021-02-05 07:51:43 +01:00
patchback[bot]
f613983cb4 datadog_monitor: Add missing monitor types query alert, trace-analytics alert, rum alert (#1723) (#1733)
* Add missing Datadog monitor types
This commit adds the following monitor types: query alert, trace-analytics alert, rum alert

* changelog PR1723 datadog_monitor types

* datadog_monitor 1723 Apply suggestions from code review

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f509f2c896)

Co-authored-by: Rick Sherman <rick@shermdog.com>
2021-02-05 06:51:27 +00:00
patchback[bot]
c22199794d Add no_log to some module arguments (#1725) (#1730)
* Add no_log to some module arguments

This will prevent potentially sensitive information from being printed to
the console.

See: CVE-2021-20191

* Update changelogs/fragments/CVE-2021-20191_no_log.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit ae8edc02e1)

Co-authored-by: David Moreau Simard <dmsimard@redhat.com>
2021-02-04 21:54:11 +01:00
patchback[bot]
24b1d92e84 module filesystem: partially fix idempotency issue #1457 (resizefs) (#1478) (#1720)
* Use 'xfs_info' to query fs size, that doesn't always require the device be
  mounted. Although still query mountpoint first for backward compatibility.
* Do not fail whith fstype=xfs and resizefs=yes if filesystem already fills
  its underlying device.
* Include xfs in the tasks that test idempotency of resizefs option
* Add changelogs/fragments/1478-filesystem-fix-1457-resizefs-idempotency.yml

(cherry picked from commit aa95d8a5b7)

Co-authored-by: quidame <quidame@poivron.org>
2021-02-03 10:42:29 +01:00
patchback[bot]
4bc44e4062 sensu-silence: fix json parsing of sensu API response (#1703) (#1718)
* sensu-silence: fix json parsing of sensu API response

* use ansible helper function to decode bytestream

* add changelog fragment

* Update changelogs, link to PR

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit b40a5ef09a)

Co-authored-by: Stefan Walluhn <stefan.walluhn@aboutsource.net>
2021-02-03 07:52:59 +01:00
patchback[bot]
06fd6d8742 Fedora 30 and 31 are EOL and will eventually be removed from devel. (#1705) (#1711)
(cherry picked from commit 6af3c96d8e)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-01 18:30:45 +01:00
Felix Fontein
dd0ae4a003 Announce DellEMC migration. (#1706) 2021-02-01 18:29:56 +01:00
patchback[bot]
646ca74810 homebrew_tap: Add support for brew search path (#1708) (#1709)
* homebrew_tap: Add support for brew search path

User can specify search path for brew executable.

Fixes: #1702

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Change version

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

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit d0f097c871)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-02-01 11:32:50 +01:00
patchback[bot]
d60c107818 BOTMETA.yml: add logstash plugin maintainer (#1700) (#1701)
Co-authored-by: Andrew Klychkov <andrew.klychkov@gmail.com>
(cherry picked from commit 9c648c8e3a)

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2021-01-29 11:01:21 +01:00
patchback[bot]
ef2d14f24e Add Name and/or Id properties to resource inventory output (#1691) (#1698)
* add Name and/or Id properties to resource inventory output

* add changelog fragment

(cherry picked from commit 00f5f7dfe7)

Co-authored-by: Bill Dodd <billdodd@gmail.com>
2021-01-29 07:40:22 +01:00
Felix Fontein
b3cde9b8a4 Next expected release is 2.1.0. 2021-01-28 15:01:39 +01:00
164 changed files with 1948 additions and 795 deletions

View File

@@ -36,7 +36,7 @@ variables:
resources:
containers:
- container: default
image: quay.io/ansible/azure-pipelines-test-container:1.7.1
image: quay.io/ansible/azure-pipelines-test-container:1.8.0
pool: Standard
@@ -140,16 +140,12 @@ stages:
parameters:
testFormat: devel/{0}
targets:
- name: OS X 10.11
test: osx/10.11
- name: macOS 10.15
test: macos/10.15
- name: macOS 11.1
test: macos/11.1
- name: RHEL 7.8
test: rhel/7.8
- name: RHEL 8.2
test: rhel/8.2
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.3
test: rhel/8.3
- name: FreeBSD 11.4
test: freebsd/11.4
- name: FreeBSD 12.2
@@ -166,8 +162,14 @@ stages:
parameters:
testFormat: 2.10/{0}
targets:
- name: OS X 10.11
test: osx/10.11
- name: macOS 10.15
test: macos/10.15
- name: macOS 11.1
test: macos/11.1
- name: RHEL 7.8
test: rhel/7.8
- name: RHEL 8.2
test: rhel/8.2
- name: FreeBSD 12.1
@@ -206,16 +208,14 @@ stages:
test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 31
test: fedora31
- name: Fedora 32
test: fedora32
- name: Fedora 33
test: fedora33
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 16.04
test: ubuntu1604
- name: Ubuntu 18.04
test: ubuntu1804
- name: Ubuntu 20.04
@@ -238,6 +238,8 @@ stages:
test: fedora32
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 16.04
test: ubuntu1604
groups:
- 2
- 3

4
.github/BOTMETA.yml vendored
View File

@@ -15,6 +15,8 @@ files:
labels: become
$callbacks/:
labels: callbacks
$callbacks/logstash.py:
maintainers: ujenmr
$callbacks/say.py:
notify: chris-short
maintainers: $team_macos
@@ -417,6 +419,8 @@ files:
maintainers: orgito
$modules/monitoring/stackdriver.py:
maintainers: bwhaley
$modules/monitoring/statsd.py:
maintainers: mamercad
$modules/monitoring/statusio_maintenance.py:
maintainers: bhcopeland
$modules/monitoring/uptimerobot.py:

View File

@@ -6,6 +6,170 @@ Community General Release Notes
This changelog describes changes after version 1.0.0.
v2.1.0
======
Release Summary
---------------
Regular feature and bugfix release.
Minor Changes
-------------
- clc_* modules - elements of list parameters are now validated (https://github.com/ansible-collections/community.general/pull/1771).
- datadog_monitor - add missing monitor types ``query alert``, ``trace-analytics alert``, ``rum alert`` (https://github.com/ansible-collections/community.general/pull/1723).
- dnsimple - add CAA records to the whitelist of valid record types (https://github.com/ansible-collections/community.general/pull/1814).
- dnsimple - elements of list parameters ``record_ids`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- gitlab_runner - elements of list parameters ``tag_list`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- homebrew_tap - add support to specify search path for ``brew`` executable (https://github.com/ansible-collections/community.general/issues/1702).
- keycloak_client - elements of list parameters ``default_roles``, ``redirect_uris``, ``web_origins`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- librato_annotation - elements of list parameters ``links`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- lxd_container - ``client_key`` and ``client_cert`` are now of type ``path`` and no longer ``str``. A side effect is that certain expansions are made, like ``~`` is replaced by the user's home directory, and environment variables like ``$HOME`` or ``$TEMP`` are evaluated (https://github.com/ansible-collections/community.general/pull/1741).
- lxd_container - elements of list parameter ``profiles`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- lxd_profile - ``client_key`` and ``client_cert`` are now of type ``path`` and no longer ``str``. A side effect is that certain expansions are made, like ``~`` is replaced by the user's home directory, and environment variables like ``$HOME`` or ``$TEMP`` are evaluated (https://github.com/ansible-collections/community.general/pull/1741).
- lxd_profile - added ``merge_profile`` parameter to merge configurations from the play to an existing profile (https://github.com/ansible-collections/community.general/pull/1813).
- mail - elements of list parameters ``to``, ``cc``, ``bcc``, ``attach``, ``headers`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- na_ontap_gather_facts - elements of list parameters ``gather_subset`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- nexmo - elements of list parameters ``dest`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- nsupdate - elements of list parameters ``value`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- oci_vcn - ``api_user_key_file`` is now of type ``path`` and no longer ``str``. A side effect is that certain expansions are made, like ``~`` is replaced by the user's home directory, and environment variables like ``$HOME`` or ``$TEMP`` are evaluated (https://github.com/ansible-collections/community.general/pull/1741).
- omapi_host - elements of list parameters ``statements`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- onepassword_info - elements of list parameters ``search_terms`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- packet_device - elements of list parameters ``device_ids``, ``hostnames`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- pagerduty - elements of list parameters ``service`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- plugins/module_utils/oracle/oci_utils.py - elements of list parameter ``key_by`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- proxmox_kvm module - actually implemented ``vmid`` and ``status`` return values. Updated documentation to reflect current situation (https://github.com/ansible-collections/community.general/issues/1410, https://github.com/ansible-collections/community.general/pull/1715).
- pubnub_blocks - elements of list parameters ``event_handlers`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- redfish modules - explicitly setting lists' elements to ``str`` (https://github.com/ansible-collections/community.general/pull/1761).
- redfish_config - case insensitive search for situations where the hostname/FQDN case on iLO doesn't match variable's case (https://github.com/ansible-collections/community.general/pull/1744).
- redhat_subscription - elements of list parameters ``pool_ids``, ``addons`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- rocketchat - elements of list parameters ``attachments`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- sendgrid - elements of list parameters ``to_addresses``, ``cc``, ``bcc``, ``attachments`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- sl_vm - elements of list parameters ``disks``, ``ssh_keys`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- slack - elements of list parameters ``attachments`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- statusio_maintenance - elements of list parameters ``components``, ``containers`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- timezone - add Gentoo and Alpine Linux support (https://github.com/ansible-collections/community.general/issues/781).
- twilio - elements of list parameters ``to_numbers`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- vmadm - elements of list parameters ``disks``, ``nics``, ``resolvers``, ``filesystems`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- xfconf - added option ``disable_facts`` to disable facts and its associated deprecation warning (https://github.com/ansible-collections/community.general/issues/1475).
- xml - elements of list parameters ``add_children``, ``set_children`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
Deprecated Features
-------------------
- xfconf - returning output as facts is deprecated, this will be removed in community.general 4.0.0. Please register the task output in a variable and use it instead. You can already switch to the new behavior now by using the new ``disable_facts`` option (https://github.com/ansible-collections/community.general/pull/1747).
Bugfixes
--------
- aerospike_migration - fix typo that caused ``migrate_tx_key`` instead of ``migrate_rx_key`` being used (https://github.com/ansible-collections/community.general/pull/1739).
- alternatives - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- beadm - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- cronvar - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- dconf - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- elasticsearch_plugin - ``state`` parameter choices must use ``list()`` in python3 (https://github.com/ansible-collections/community.general/pull/1830).
- filesystem - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- filesystem - remove ``swap`` from list of FS supported by ``resizefs=yes`` (https://github.com/ansible-collections/community.general/issues/790).
- git_config - prevent ``run_command`` from expanding values (https://github.com/ansible-collections/community.general/issues/1776).
- gitlab_runner - parameter ``registration_token`` was required but is used only when ``state`` is ``present`` (https://github.com/ansible-collections/community.general/issues/1714).
- hipchat - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- interfaces_file - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- iso_extract - use proper alias deprecation mechanism for ``thirsty`` alias of ``force`` (https://github.com/ansible-collections/community.general/pull/1830).
- java_cert - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- kibana_plugin - ``state`` parameter choices must use ``list()`` in python3 (https://github.com/ansible-collections/community.general/pull/1830).
- logstash_plugin - wrapped ``dict.keys()`` with ``list`` for use in ``choices`` setting (https://github.com/ansible-collections/community.general/pull/1830).
- lvg - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- lvol - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- lxc - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- lxc_container - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- nios_host_record - allow DNS Bypass for views other than default (https://github.com/ansible-collections/community.general/issues/1786).
- nomad_job_info - fix module failure when nomad client returns no jobs (https://github.com/ansible-collections/community.general/pull/1721).
- parted - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- proxmox lxc - only add the features flag when module parameter ``features`` is set. Before an empty string was send to proxmox in case the parameter was not used, which required to use ``root@pam`` for module execution (https://github.com/ansible-collections/community.general/pull/1763).
- proxmox* modules - refactored some parameter validation code into use of ``env_fallback``, ``required_if``, ``required_together``, ``required_one_of`` (https://github.com/ansible-collections/community.general/pull/1765).
- proxmox_kvm - do not add ``args`` if ``proxmox_default_behavior`` is set to no_defaults (https://github.com/ansible-collections/community.general/issues/1641).
- proxmox_kvm - stop implicitly adding ``force`` equal to ``false``. Proxmox API requires not implemented parameters otherwise, and assumes ``force`` to be ``false`` by default anyways (https://github.com/ansible-collections/community.general/pull/1783).
- redhat_subscription - ``mutually_exclusive`` was referring to parameter alias instead of name (https://github.com/ansible-collections/community.general/pull/1795).
- riak - parameters ``wait_for_handoffs`` and ``wait_for_ring`` are ``int`` but the default value was ``false`` (https://github.com/ansible-collections/community.general/pull/1830).
- rundeck_acl_policy - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- runit - removed unused code, and passing command as ``list`` instead of ``str`` to ``run_command()`` (https://github.com/ansible-collections/community.general/pull/1830).
- selective callback plugin - adjust import so that the plugin also works with ansible-core 2.11 (https://github.com/ansible-collections/community.general/pull/1807).
- statusio_maintenance - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- timezone - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).
- zfs_delegate_admin - the elements of ``users``, ``groups`` and ``permissions`` are now enforced to be strings (https://github.com/ansible-collections/community.general/pull/1766).
New Modules
-----------
Monitoring
~~~~~~~~~~
- statsd - Send metrics to StatsD
v2.0.1
======
Release Summary
---------------
Bugfix and security bugfix (potential information leaks in multiple modules, CVE-2021-20191) release.
Major Changes
-------------
- For community.general 3.0.0, the ``ome_device_info``, ``idrac_firmware`` and ``idrac_server_config_profile`` modules will be moved to the `dellemc.openmanage <https://galaxy.ansible.com/dellemc/openmanage>`_ collection.
A redirection will be inserted so that users using ansible-base 2.10 or newer do not have to change anything.
If you use Ansible 2.9 and explicitly use the DellEMC modules mentioned above from this collection, you will need to adjust your playbooks and roles to use FQCNs starting with ``dellemc.openmanage.`` instead of ``community.general.``,
for example replace ``community.general.ome_device_info`` in a task by ``dellemc.openmanage.ome_device_info``.
If you use ansible-base and installed ``community.general`` manually and rely on the DellEMC modules mentioned above, you have to make sure to install the ``dellemc.openmanage`` collection as well.
If you are using FQCNs, for example ``community.general.ome_device_info`` instead of ``ome_device_info``, it will continue working, but we still recommend to adjust the FQCNs as well.
Breaking Changes / Porting Guide
--------------------------------
- utm_proxy_auth_profile - the ``frontend_cookie_secret`` return value now contains a placeholder string instead of the module's ``frontend_cookie_secret`` parameter (https://github.com/ansible-collections/community.general/pull/1736).
Security Fixes
--------------
- dnsmadeeasy - mark the ``account_key`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- gitlab_runner - mark the ``registration_token`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- hwc_ecs_instance - mark the ``admin_pass`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- ibm_sa_host - mark the ``iscsi_chap_secret`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- keycloak_* modules - mark the ``auth_client_secret`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- keycloak_client - mark the ``registration_access_token`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- librato_annotation - mark the ``api_key`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- logentries_msg - mark the ``token`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- module_utils/_netapp, na_ontap_gather_facts - enabled ``no_log`` for the options ``api_key`` and ``secret_key`` to prevent accidental disclosure (CVE-2021-20191, https://github.com/ansible-collections/community.general/pull/1725).
- module_utils/identity/keycloak, keycloak_client, keycloak_clienttemplate, keycloak_group - enabled ``no_log`` for the option ``auth_client_secret`` to prevent accidental disclosure (CVE-2021-20191, https://github.com/ansible-collections/community.general/pull/1725).
- nios_nsgroup - mark the ``tsig_key`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- oneandone_firewall_policy, oneandone_load_balancer, oneandone_monitoring_policy, oneandone_private_network, oneandone_public_ip - mark the ``auth_token`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- ovirt - mark the ``instance_key`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- ovirt - mark the ``instance_rootpw`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- pagerduty_alert - mark the ``api_key``, ``service_key`` and ``integration_key`` parameters as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- pagerduty_change - mark the ``integration_key`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- pingdom - mark the ``key`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- pulp_repo - mark the ``feed_client_key`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- rax_clb_ssl - mark the ``private_key`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- redfish_command - mark the ``update_creds.password`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- rollbar_deployment - mark the ``token`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- spotinst_aws_elastigroup - mark the ``multai_token`` and ``token`` parameters as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- stackdriver - mark the ``key`` parameter as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- utm_proxy_auth_profile - enabled ``no_log`` for the option ``frontend_cookie_secret`` to prevent accidental disclosure (CVE-2021-20191, https://github.com/ansible-collections/community.general/pull/1725).
- utm_proxy_auth_profile - mark the ``frontend_cookie_secret`` parameter as ``no_log`` to avoid leakage of secrets. This causes the ``utm_proxy_auth_profile`` return value to no longer containing the correct value, but a placeholder (https://github.com/ansible-collections/community.general/pull/1736).
Bugfixes
--------
- filesystem - do not fail when ``resizefs=yes`` and ``fstype=xfs`` if there is nothing to do, even if the filesystem is not mounted. This only covers systems supporting access to unmounted XFS filesystems. Others will still fail (https://github.com/ansible-collections/community.general/issues/1457, https://github.com/ansible-collections/community.general/pull/1478).
- gitlab_user - make updates to the ``isadmin``, ``password`` and ``confirm`` options of an already existing GitLab user work (https://github.com/ansible-collections/community.general/pull/1724).
- parted - change the regex that decodes the partition size to better support different formats that parted uses. Change the regex that validates parted's version string (https://github.com/ansible-collections/community.general/pull/1695).
- redfish_info module, redfish_utils module utils - add ``Name`` and ``Id`` properties to output of Redfish inventory commands (https://github.com/ansible-collections/community.general/issues/1650).
- sensu-silence module - fix json parsing of sensu API responses on Python 3.5 (https://github.com/ansible-collections/community.general/pull/1703).
v2.0.0
======

View File

@@ -1000,3 +1000,290 @@ releases:
name: yum_versionlock
namespace: packaging.os
release_date: '2021-01-28'
2.0.1:
changes:
breaking_changes:
- utm_proxy_auth_profile - the ``frontend_cookie_secret`` return value now contains
a placeholder string instead of the module's ``frontend_cookie_secret`` parameter
(https://github.com/ansible-collections/community.general/pull/1736).
bugfixes:
- filesystem - do not fail when ``resizefs=yes`` and ``fstype=xfs`` if there
is nothing to do, even if the filesystem is not mounted. This only covers
systems supporting access to unmounted XFS filesystems. Others will still
fail (https://github.com/ansible-collections/community.general/issues/1457,
https://github.com/ansible-collections/community.general/pull/1478).
- gitlab_user - make updates to the ``isadmin``, ``password`` and ``confirm``
options of an already existing GitLab user work (https://github.com/ansible-collections/community.general/pull/1724).
- parted - change the regex that decodes the partition size to better support
different formats that parted uses. Change the regex that validates parted's
version string (https://github.com/ansible-collections/community.general/pull/1695).
- redfish_info module, redfish_utils module utils - add ``Name`` and ``Id``
properties to output of Redfish inventory commands (https://github.com/ansible-collections/community.general/issues/1650).
- sensu-silence module - fix json parsing of sensu API responses on Python 3.5
(https://github.com/ansible-collections/community.general/pull/1703).
major_changes:
- 'For community.general 3.0.0, the ``ome_device_info``, ``idrac_firmware``
and ``idrac_server_config_profile`` modules will be moved to the `dellemc.openmanage
<https://galaxy.ansible.com/dellemc/openmanage>`_ collection.
A redirection will be inserted so that users using ansible-base 2.10 or newer
do not have to change anything.
If you use Ansible 2.9 and explicitly use the DellEMC modules mentioned above
from this collection, you will need to adjust your playbooks and roles to
use FQCNs starting with ``dellemc.openmanage.`` instead of ``community.general.``,
for example replace ``community.general.ome_device_info`` in a task by ``dellemc.openmanage.ome_device_info``.
If you use ansible-base and installed ``community.general`` manually and rely
on the DellEMC modules mentioned above, you have to make sure to install the
``dellemc.openmanage`` collection as well.
If you are using FQCNs, for example ``community.general.ome_device_info``
instead of ``ome_device_info``, it will continue working, but we still recommend
to adjust the FQCNs as well.
'
release_summary: Bugfix and security bugfix (potential information leaks in
multiple modules, CVE-2021-20191) release.
security_fixes:
- dnsmadeeasy - mark the ``account_key`` parameter as ``no_log`` to avoid leakage
of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- gitlab_runner - mark the ``registration_token`` parameter as ``no_log`` to
avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- hwc_ecs_instance - mark the ``admin_pass`` parameter as ``no_log`` to avoid
leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- ibm_sa_host - mark the ``iscsi_chap_secret`` parameter as ``no_log`` to avoid
leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- keycloak_* modules - mark the ``auth_client_secret`` parameter as ``no_log``
to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- keycloak_client - mark the ``registration_access_token`` parameter as ``no_log``
to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- librato_annotation - mark the ``api_key`` parameter as ``no_log`` to avoid
leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- logentries_msg - mark the ``token`` parameter as ``no_log`` to avoid leakage
of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- module_utils/_netapp, na_ontap_gather_facts - enabled ``no_log`` for the options
``api_key`` and ``secret_key`` to prevent accidental disclosure (CVE-2021-20191,
https://github.com/ansible-collections/community.general/pull/1725).
- module_utils/identity/keycloak, keycloak_client, keycloak_clienttemplate,
keycloak_group - enabled ``no_log`` for the option ``auth_client_secret``
to prevent accidental disclosure (CVE-2021-20191, https://github.com/ansible-collections/community.general/pull/1725).
- nios_nsgroup - mark the ``tsig_key`` parameter as ``no_log`` to avoid leakage
of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- oneandone_firewall_policy, oneandone_load_balancer, oneandone_monitoring_policy,
oneandone_private_network, oneandone_public_ip - mark the ``auth_token`` parameter
as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- ovirt - mark the ``instance_key`` parameter as ``no_log`` to avoid leakage
of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- ovirt - mark the ``instance_rootpw`` parameter as ``no_log`` to avoid leakage
of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- pagerduty_alert - mark the ``api_key``, ``service_key`` and ``integration_key``
parameters as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- pagerduty_change - mark the ``integration_key`` parameter as ``no_log`` to
avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- pingdom - mark the ``key`` parameter as ``no_log`` to avoid leakage of secrets
(https://github.com/ansible-collections/community.general/pull/1736).
- pulp_repo - mark the ``feed_client_key`` parameter as ``no_log`` to avoid
leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- rax_clb_ssl - mark the ``private_key`` parameter as ``no_log`` to avoid leakage
of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- redfish_command - mark the ``update_creds.password`` parameter as ``no_log``
to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- rollbar_deployment - mark the ``token`` parameter as ``no_log`` to avoid leakage
of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- spotinst_aws_elastigroup - mark the ``multai_token`` and ``token`` parameters
as ``no_log`` to avoid leakage of secrets (https://github.com/ansible-collections/community.general/pull/1736).
- stackdriver - mark the ``key`` parameter as ``no_log`` to avoid leakage of
secrets (https://github.com/ansible-collections/community.general/pull/1736).
- utm_proxy_auth_profile - enabled ``no_log`` for the option ``frontend_cookie_secret``
to prevent accidental disclosure (CVE-2021-20191, https://github.com/ansible-collections/community.general/pull/1725).
- utm_proxy_auth_profile - mark the ``frontend_cookie_secret`` parameter as
``no_log`` to avoid leakage of secrets. This causes the ``utm_proxy_auth_profile``
return value to no longer containing the correct value, but a placeholder
(https://github.com/ansible-collections/community.general/pull/1736).
fragments:
- 1478-filesystem-fix-1457-resizefs-idempotency.yml
- 1691-add-name-and-id-props-to-redfish-inventory-output.yml
- 1695-parted-updatedregex.yaml
- 1703-sensu_silence-fix_json_parsing.yml
- 1724-various-fixes-for-updating-existing-gitlab-user.yml
- 2.0.1.yml
- CVE-2021-20191_no_log.yml
- dellemc-migration.yml
- no_log-fixes.yml
release_date: '2021-02-09'
2.1.0:
changes:
bugfixes:
- aerospike_migration - fix typo that caused ``migrate_tx_key`` instead of ``migrate_rx_key``
being used (https://github.com/ansible-collections/community.general/pull/1739).
- 'alternatives - internal refactoring: replaced uses of ``_`` with ``dummy``
(https://github.com/ansible-collections/community.general/pull/1819).'
- 'beadm - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- 'cronvar - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- 'dconf - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- elasticsearch_plugin - ``state`` parameter choices must use ``list()`` in
python3 (https://github.com/ansible-collections/community.general/pull/1830).
- 'filesystem - internal refactoring: replaced uses of ``_`` with ``dummy``
(https://github.com/ansible-collections/community.general/pull/1819).'
- filesystem - remove ``swap`` from list of FS supported by ``resizefs=yes``
(https://github.com/ansible-collections/community.general/issues/790).
- git_config - prevent ``run_command`` from expanding values (https://github.com/ansible-collections/community.general/issues/1776).
- gitlab_runner - parameter ``registration_token`` was required but is used
only when ``state`` is ``present`` (https://github.com/ansible-collections/community.general/issues/1714).
- 'hipchat - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- 'interfaces_file - internal refactoring: replaced uses of ``_`` with ``dummy``
(https://github.com/ansible-collections/community.general/pull/1819).'
- iso_extract - use proper alias deprecation mechanism for ``thirsty`` alias
of ``force`` (https://github.com/ansible-collections/community.general/pull/1830).
- 'java_cert - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- kibana_plugin - ``state`` parameter choices must use ``list()`` in python3
(https://github.com/ansible-collections/community.general/pull/1830).
- logstash_plugin - wrapped ``dict.keys()`` with ``list`` for use in ``choices``
setting (https://github.com/ansible-collections/community.general/pull/1830).
- 'lvg - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- 'lvol - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- 'lxc - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- 'lxc_container - internal refactoring: replaced uses of ``_`` with ``dummy``
(https://github.com/ansible-collections/community.general/pull/1819).'
- nios_host_record - allow DNS Bypass for views other than default (https://github.com/ansible-collections/community.general/issues/1786).
- nomad_job_info - fix module failure when nomad client returns no jobs (https://github.com/ansible-collections/community.general/pull/1721).
- 'parted - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- proxmox lxc - only add the features flag when module parameter ``features``
is set. Before an empty string was send to proxmox in case the parameter was
not used, which required to use ``root@pam`` for module execution (https://github.com/ansible-collections/community.general/pull/1763).
- proxmox* modules - refactored some parameter validation code into use of ``env_fallback``,
``required_if``, ``required_together``, ``required_one_of`` (https://github.com/ansible-collections/community.general/pull/1765).
- proxmox_kvm - do not add ``args`` if ``proxmox_default_behavior`` is set to
no_defaults (https://github.com/ansible-collections/community.general/issues/1641).
- proxmox_kvm - stop implicitly adding ``force`` equal to ``false``. Proxmox
API requires not implemented parameters otherwise, and assumes ``force`` to
be ``false`` by default anyways (https://github.com/ansible-collections/community.general/pull/1783).
- redhat_subscription - ``mutually_exclusive`` was referring to parameter alias
instead of name (https://github.com/ansible-collections/community.general/pull/1795).
- riak - parameters ``wait_for_handoffs`` and ``wait_for_ring`` are ``int``
but the default value was ``false`` (https://github.com/ansible-collections/community.general/pull/1830).
- 'rundeck_acl_policy - internal refactoring: replaced uses of ``_`` with ``dummy``
(https://github.com/ansible-collections/community.general/pull/1819).'
- runit - removed unused code, and passing command as ``list`` instead of ``str``
to ``run_command()`` (https://github.com/ansible-collections/community.general/pull/1830).
- selective callback plugin - adjust import so that the plugin also works with
ansible-core 2.11 (https://github.com/ansible-collections/community.general/pull/1807).
- 'statusio_maintenance - internal refactoring: replaced uses of ``_`` with
``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- 'timezone - internal refactoring: replaced uses of ``_`` with ``dummy`` (https://github.com/ansible-collections/community.general/pull/1819).'
- zfs_delegate_admin - the elements of ``users``, ``groups`` and ``permissions``
are now enforced to be strings (https://github.com/ansible-collections/community.general/pull/1766).
deprecated_features:
- xfconf - returning output as facts is deprecated, this will be removed in
community.general 4.0.0. Please register the task output in a variable and
use it instead. You can already switch to the new behavior now by using the
new ``disable_facts`` option (https://github.com/ansible-collections/community.general/pull/1747).
minor_changes:
- clc_* modules - elements of list parameters are now validated (https://github.com/ansible-collections/community.general/pull/1771).
- datadog_monitor - add missing monitor types ``query alert``, ``trace-analytics
alert``, ``rum alert`` (https://github.com/ansible-collections/community.general/pull/1723).
- dnsimple - add CAA records to the whitelist of valid record types (https://github.com/ansible-collections/community.general/pull/1814).
- dnsimple - elements of list parameters ``record_ids`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- gitlab_runner - elements of list parameters ``tag_list`` are now validated
(https://github.com/ansible-collections/community.general/pull/1795).
- homebrew_tap - add support to specify search path for ``brew`` executable
(https://github.com/ansible-collections/community.general/issues/1702).
- keycloak_client - elements of list parameters ``default_roles``, ``redirect_uris``,
``web_origins`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- librato_annotation - elements of list parameters ``links`` are now validated
(https://github.com/ansible-collections/community.general/pull/1795).
- lxd_container - ``client_key`` and ``client_cert`` are now of type ``path``
and no longer ``str``. A side effect is that certain expansions are made,
like ``~`` is replaced by the user's home directory, and environment variables
like ``$HOME`` or ``$TEMP`` are evaluated (https://github.com/ansible-collections/community.general/pull/1741).
- lxd_container - elements of list parameter ``profiles`` are now validated
(https://github.com/ansible-collections/community.general/pull/1795).
- lxd_profile - ``client_key`` and ``client_cert`` are now of type ``path``
and no longer ``str``. A side effect is that certain expansions are made,
like ``~`` is replaced by the user's home directory, and environment variables
like ``$HOME`` or ``$TEMP`` are evaluated (https://github.com/ansible-collections/community.general/pull/1741).
- lxd_profile - added ``merge_profile`` parameter to merge configurations from
the play to an existing profile (https://github.com/ansible-collections/community.general/pull/1813).
- mail - elements of list parameters ``to``, ``cc``, ``bcc``, ``attach``, ``headers``
are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- na_ontap_gather_facts - elements of list parameters ``gather_subset`` are
now validated (https://github.com/ansible-collections/community.general/pull/1795).
- nexmo - elements of list parameters ``dest`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- nsupdate - elements of list parameters ``value`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- oci_vcn - ``api_user_key_file`` is now of type ``path`` and no longer ``str``.
A side effect is that certain expansions are made, like ``~`` is replaced
by the user's home directory, and environment variables like ``$HOME`` or
``$TEMP`` are evaluated (https://github.com/ansible-collections/community.general/pull/1741).
- omapi_host - elements of list parameters ``statements`` are now validated
(https://github.com/ansible-collections/community.general/pull/1795).
- onepassword_info - elements of list parameters ``search_terms`` are now validated
(https://github.com/ansible-collections/community.general/pull/1795).
- packet_device - elements of list parameters ``device_ids``, ``hostnames``
are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- pagerduty - elements of list parameters ``service`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- plugins/module_utils/oracle/oci_utils.py - elements of list parameter ``key_by``
are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- proxmox_kvm module - actually implemented ``vmid`` and ``status`` return values.
Updated documentation to reflect current situation (https://github.com/ansible-collections/community.general/issues/1410,
https://github.com/ansible-collections/community.general/pull/1715).
- pubnub_blocks - elements of list parameters ``event_handlers`` are now validated
(https://github.com/ansible-collections/community.general/pull/1795).
- redfish modules - explicitly setting lists' elements to ``str`` (https://github.com/ansible-collections/community.general/pull/1761).
- redfish_config - case insensitive search for situations where the hostname/FQDN
case on iLO doesn't match variable's case (https://github.com/ansible-collections/community.general/pull/1744).
- redhat_subscription - elements of list parameters ``pool_ids``, ``addons``
are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- rocketchat - elements of list parameters ``attachments`` are now validated
(https://github.com/ansible-collections/community.general/pull/1795).
- sendgrid - elements of list parameters ``to_addresses``, ``cc``, ``bcc``,
``attachments`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- sl_vm - elements of list parameters ``disks``, ``ssh_keys`` are now validated
(https://github.com/ansible-collections/community.general/pull/1795).
- slack - elements of list parameters ``attachments`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- statusio_maintenance - elements of list parameters ``components``, ``containers``
are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- timezone - add Gentoo and Alpine Linux support (https://github.com/ansible-collections/community.general/issues/781).
- twilio - elements of list parameters ``to_numbers`` are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- vmadm - elements of list parameters ``disks``, ``nics``, ``resolvers``, ``filesystems``
are now validated (https://github.com/ansible-collections/community.general/pull/1795).
- xfconf - added option ``disable_facts`` to disable facts and its associated
deprecation warning (https://github.com/ansible-collections/community.general/issues/1475).
- xml - elements of list parameters ``add_children``, ``set_children`` are now
validated (https://github.com/ansible-collections/community.general/pull/1795).
release_summary: Regular feature and bugfix release.
fragments:
- 1475-xfconf-facts.yml
- 1702_homebrew_tap.yml
- 1714-gitlab_runner-required-reg-token.yml
- 1715-proxmox_kvm-add-vmid-to-returns.yml
- 1721-fix-nomad_job_info-no-jobs-failure.yml
- 1722_timezone.yml
- 1723-datadog_monitor-add-missing-monitor-types.yml
- 1740-aerospike_migration.yml
- 1741-use-path-argspec.yml
- 1744-case-insensitive-hostname-fqdn-matching.yml
- 1753-document-fstypes-supported-by-resizefs.yml
- 1761-redfish-tidy-up-validation.yml
- 1765-proxmox-params.yml
- 1766-zfs-fixed-sanity.yml
- 1771-centurylink-validation-elements.yml
- 1776-git_config-tilde_value.yml
- 1783-proxmox-kvm-fix-args-500-error.yaml
- 1788-ease-nios_host_record-dns-bypass-check.yml
- 1795-list-elements-batch1.yml
- 1813-lxd_profile-merge-profiles.yml
- 1814-dnsimple-add-support-for-caa-records.yml
- 1819-tidyup-pylint-blacklistnames.yml
- 1830-valmod_docmissingtype_batch1.yml
- 2.1.0.yml
- 816-only-invocate-feature-when-variable-is-set.yml
- selective-core-2.11.yml
modules:
- description: Send metrics to StatsD
name: statsd
namespace: monitoring
release_date: '2021-02-16'

View File

@@ -1,6 +1,6 @@
namespace: community
name: general
version: 2.0.0
version: 2.1.0
readme: README.md
authors:
- Ansible (https://github.com/ansible)

View File

@@ -173,8 +173,7 @@ class CallbackModule(CallbackBase):
# Displays info about playbook being started by a person on an
# inventory, as well as Tags, Skip Tags and Limits
if not self.printed_playbook:
self.playbook_name, _ = os.path.splitext(
os.path.basename(self.play.playbook.filename))
self.playbook_name, dummy = os.path.splitext(os.path.basename(self.play.playbook.filename))
host_list = self.play.playbook.inventory.host_list
inventory = os.path.basename(os.path.realpath(host_list))
self.send_msg("%s: Playbook initiated by %s against %s" %

View File

@@ -41,7 +41,16 @@ import difflib
from ansible import constants as C
from ansible.plugins.callback import CallbackBase
from ansible.module_utils._text import to_text
from ansible.utils.color import codeCodes
try:
codeCodes = C.COLOR_CODES
except AttributeError:
# This constant was moved to ansible.constants in
# https://github.com/ansible/ansible/commit/1202dd000f10b0e8959019484f1c3b3f9628fc67
# (will be included in ansible-core 2.11.0). For older Ansible/ansible-base versions,
# we include from the original location.
from ansible.utils.color import codeCodes
DONT_COLORIZE = False
COLORS = {

View File

@@ -86,7 +86,7 @@ class Connection(ConnectionBase):
write_fds = []
while len(read_fds) > 0 or len(write_fds) > 0:
try:
ready_reads, ready_writes, _ = select.select(read_fds, write_fds, [])
ready_reads, ready_writes, dummy = select.select(read_fds, write_fds, [])
except select.error as e:
if e.args[0] == errno.EINTR:
continue

View File

@@ -47,7 +47,7 @@ class ModuleDocFragment(object):
OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is
not specified through a configuration file (See C(config_file_location)). If the key is encrypted
with a pass-phrase, the C(api_user_key_pass_phrase) option must also be provided.
type: str
type: path
api_user_key_pass_phrase:
description:
- Passphrase used by the key referenced in C(api_user_key_file), if it is encrypted. If not set, then

View File

@@ -20,4 +20,5 @@ class ModuleDocFragment(object):
identify an instance of the resource. By default, all the attributes of a resource except
I(freeform_tags) are used to uniquely identify a resource.
type: list
elements: str
"""

View File

@@ -226,10 +226,8 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
if config == 'rootfs' or config.startswith(('virtio', 'sata', 'ide', 'scsi')):
value = ('disk_image=' + value)
if isinstance(value, int) or ',' not in value:
value = value
# split off strings with commas to a dict
else:
if not (isinstance(value, int) or ',' not in value):
# split off strings with commas to a dict
# skip over any keys that cannot be processed
try:
value = dict(key.split("=") for key in value.split(","))

View File

@@ -216,7 +216,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
yield host not in v
yield True
return all([found_host for found_host in find_host(host, inventory)])
return all(find_host(host, inventory))
def verify_file(self, path):

View File

@@ -142,8 +142,8 @@ def aws_cvs_host_argument_spec():
return dict(
api_url=dict(required=True, type='str'),
validate_certs=dict(required=False, type='bool', default=True),
api_key=dict(required=True, type='str'),
secret_key=dict(required=True, type='str')
api_key=dict(required=True, type='str', no_log=True),
secret_key=dict(required=True, type='str', no_log=True)
)

View File

@@ -130,7 +130,7 @@ class CloudRetry(object):
try:
return f(*args, **kwargs)
except Exception as e:
if isinstance(e, cls.base_class):
if isinstance(e, cls.base_class): # pylint: disable=isinstance-second-argument-not-valid-type
response_code = cls.status_code_from_exception(e)
if cls.found(response_code, catch_extra_error_codes):
msg = "{0}: Retrying in {1} seconds...".format(str(e), delay)

View File

@@ -58,7 +58,7 @@ def keycloak_argument_spec():
auth_keycloak_url=dict(type='str', aliases=['url'], required=True),
auth_client_id=dict(type='str', default='admin-cli'),
auth_realm=dict(type='str', required=True),
auth_client_secret=dict(type='str', default=None),
auth_client_secret=dict(type='str', default=None, no_log=True),
auth_username=dict(type='str', aliases=['username'], required=True),
auth_password=dict(type='str', aliases=['password'], required=True, no_log=True),
validate_certs=dict(type='bool', default=True)

View File

@@ -284,7 +284,7 @@ class CmdMixin(object):
def _calculate_args(self, extra_params=None, params=None):
def add_arg_formatted_param(_cmd_args, arg_format, _value):
args = [x for x in arg_format.to_text(_value)]
args = list(arg_format.to_text(_value))
return _cmd_args + args
def find_format(_param):

View File

@@ -260,13 +260,10 @@ class WapiModule(WapiBase):
else:
proposed_object[key] = self.module.params[key]
# If configure_by_dns is set to False, then delete the default dns set in the param else throw exception
# If configure_by_dns is set to False and view is 'default', then delete the default dns
if not proposed_object.get('configure_for_dns') and proposed_object.get('view') == 'default'\
and ib_obj_type == NIOS_HOST_RECORD:
del proposed_object['view']
elif not proposed_object.get('configure_for_dns') and proposed_object.get('view') != 'default'\
and ib_obj_type == NIOS_HOST_RECORD:
self.module.fail_json(msg='DNS Bypass is not allowed if DNS view is set other than \'default\'')
if ib_obj_ref:
if len(ib_obj_ref) > 1:

View File

@@ -90,7 +90,7 @@ def get_common_arg_spec(supports_create=False, supports_wait=False):
config_profile_name=dict(type="str", default="DEFAULT"),
api_user=dict(type="str"),
api_user_fingerprint=dict(type="str", no_log=True),
api_user_key_file=dict(type="str"),
api_user_key_file=dict(type="path"),
api_user_key_pass_phrase=dict(type="str", no_log=True),
auth_type=dict(
type="str",
@@ -104,7 +104,7 @@ def get_common_arg_spec(supports_create=False, supports_wait=False):
if supports_create:
common_args.update(
key_by=dict(type="list"),
key_by=dict(type="list", elements="str"),
force_create=dict(type="bool", default=False),
)

View File

@@ -469,7 +469,7 @@ class RedfishUtils(object):
controller_results = []
# Get these entries, but does not fail if not found
properties = ['CacheSummary', 'FirmwareVersion', 'Identifiers',
'Location', 'Manufacturer', 'Model', 'Name',
'Location', 'Manufacturer', 'Model', 'Name', 'Id',
'PartNumber', 'SerialNumber', 'SpeedGbps', 'Status']
key = "StorageControllers"
@@ -1700,7 +1700,7 @@ class RedfishUtils(object):
chassis_results = []
# Get these entries, but does not fail if not found
properties = ['ChassisType', 'PartNumber', 'AssetTag',
properties = ['Name', 'Id', 'ChassisType', 'PartNumber', 'AssetTag',
'Manufacturer', 'IndicatorLED', 'SerialNumber', 'Model']
# Go through list
@@ -1724,7 +1724,7 @@ class RedfishUtils(object):
fan_results = []
key = "Thermal"
# Get these entries, but does not fail if not found
properties = ['FanName', 'Reading', 'ReadingUnits', 'Status']
properties = ['Name', 'FanName', 'Reading', 'ReadingUnits', 'Status']
# Go through list
for chassis_uri in self.chassis_uris:
@@ -1836,8 +1836,8 @@ class RedfishUtils(object):
cpu_results = []
key = "Processors"
# Get these entries, but does not fail if not found
properties = ['Id', 'Manufacturer', 'Model', 'MaxSpeedMHz', 'TotalCores',
'TotalThreads', 'Status']
properties = ['Id', 'Name', 'Manufacturer', 'Model', 'MaxSpeedMHz',
'TotalCores', 'TotalThreads', 'Status']
# Search for 'key' entry and extract URI from it
response = self.get_request(self.root_uri + systems_uri)
@@ -1886,7 +1886,7 @@ class RedfishUtils(object):
memory_results = []
key = "Memory"
# Get these entries, but does not fail if not found
properties = ['SerialNumber', 'MemoryDeviceType', 'PartNumber',
properties = ['Id', 'SerialNumber', 'MemoryDeviceType', 'PartNumber',
'MemoryLocation', 'RankCount', 'CapacityMiB', 'OperatingMemoryModes', 'Status', 'Manufacturer', 'Name']
# Search for 'key' entry and extract URI from it
@@ -1943,7 +1943,7 @@ class RedfishUtils(object):
nic_results = []
key = "EthernetInterfaces"
# Get these entries, but does not fail if not found
properties = ['Description', 'FQDN', 'IPv4Addresses', 'IPv6Addresses',
properties = ['Name', 'Id', 'Description', 'FQDN', 'IPv4Addresses', 'IPv6Addresses',
'NameServers', 'MACAddress', 'PermanentMACAddress',
'SpeedMbps', 'MTUSize', 'AutoNeg', 'Status']
@@ -2368,7 +2368,7 @@ class RedfishUtils(object):
properties = ['Status', 'HostName', 'PowerState', 'Model', 'Manufacturer',
'PartNumber', 'SystemType', 'AssetTag', 'ServiceTag',
'SerialNumber', 'SKU', 'BiosVersion', 'MemorySummary',
'ProcessorSummary', 'TrustedModules']
'ProcessorSummary', 'TrustedModules', 'Name', 'Id']
response = self.get_request(self.root_uri + systems_uri)
if response['ret'] is False:
@@ -2632,7 +2632,7 @@ class RedfishUtils(object):
if response['ret'] is False:
return response
data = response['data']
if '"' + nic_addr + '"' in str(data) or "'" + nic_addr + "'" in str(data):
if '"' + nic_addr.lower() + '"' in str(data).lower() or "'" + nic_addr.lower() + "'" in str(data).lower():
target_ethernet_uri = uri
target_ethernet_current_setting = data
break

View File

@@ -32,6 +32,7 @@ options:
- A list of recipient email ids to notify the alert.
This is required for state 'present'
type: list
elements: str
metric:
description:
- The metric on which to measure the condition that will trigger the alert.
@@ -220,7 +221,7 @@ class ClcAlertPolicy:
name=dict(),
id=dict(),
alias=dict(required=True),
alert_recipients=dict(type='list'),
alert_recipients=dict(type='list', elements='str'),
metric=dict(
choices=[
'cpu',

View File

@@ -18,6 +18,7 @@ options:
- A list of server Ids to deploy the blue print package.
type: list
required: True
elements: str
package_id:
description:
- The package id of the blue print.
@@ -164,7 +165,7 @@ class ClcBlueprintPackage:
:return: the package dictionary object
"""
argument_spec = dict(
server_ids=dict(type='list', required=True),
server_ids=dict(type='list', elements='str', required=True),
package_id=dict(required=True),
package_params=dict(type='dict', default={}),
wait=dict(default=True), # @FIXME should be bool?

View File

@@ -29,17 +29,20 @@ options:
- The list of source addresses for traffic on the originating firewall.
This is required when state is 'present'
type: list
elements: str
destination:
description:
- The list of destination addresses for traffic on the terminating firewall.
This is required when state is 'present'
type: list
elements: str
ports:
description:
- The list of ports associated with the policy.
TCP and UDP can take in single ports or port ranges.
- "Example: C(['any', 'icmp', 'TCP/123', 'UDP/123', 'TCP/123-456', 'UDP/123-456'])."
type: list
elements: str
firewall_policy_id:
description:
- Id of the firewall policy. This is required to update or delete an existing firewall policy
@@ -217,9 +220,9 @@ class ClcFirewallPolicy:
source_account_alias=dict(required=True),
destination_account_alias=dict(),
firewall_policy_id=dict(),
ports=dict(type='list'),
source=dict(type='list'),
destination=dict(type='list'),
ports=dict(type='list', elements='str'),
source=dict(type='list', elements='str'),
destination=dict(type='list', elements='str'),
wait=dict(default=True), # @FIXME type=bool
state=dict(default='present', choices=['present', 'absent']),
enabled=dict(default=True, choices=[True, False])

View File

@@ -53,6 +53,7 @@ options:
- A list of nodes that needs to be added to the load balancer pool
type: list
default: []
elements: dict
status:
description:
- The status of the loadbalancer
@@ -869,7 +870,7 @@ class ClcLoadBalancer:
port=dict(choices=[80, 443]),
method=dict(choices=['leastConnection', 'roundRobin']),
persistence=dict(choices=['standard', 'sticky']),
nodes=dict(type='list', default=[]),
nodes=dict(type='list', default=[], elements='dict'),
status=dict(default='enabled', choices=['enabled', 'disabled']),
state=dict(
default='present',

View File

@@ -18,6 +18,7 @@ options:
- A list of server Ids to modify.
type: list
required: True
elements: str
cpu:
description:
- How many CPUs to update on the server
@@ -396,7 +397,7 @@ class ClcModifyServer:
:return: argument spec dictionary
"""
argument_spec = dict(
server_ids=dict(type='list', required=True),
server_ids=dict(type='list', required=True, elements='str'),
state=dict(default='present', choices=['present', 'absent']),
cpu=dict(),
memory=dict(),

View File

@@ -23,11 +23,13 @@ options:
description:
- A list of ports to expose. This is required when state is 'present'
type: list
elements: int
server_ids:
description:
- A list of servers to create public ips on.
type: list
required: True
elements: str
state:
description:
- Determine whether to create or delete public IPs. If present module will not create a second public ip if one
@@ -193,9 +195,9 @@ class ClcPublicIp(object):
:return: argument spec dictionary
"""
argument_spec = dict(
server_ids=dict(type='list', required=True),
server_ids=dict(type='list', required=True, elements='str'),
protocol=dict(default='TCP', choices=['TCP', 'UDP', 'ICMP']),
ports=dict(type='list'),
ports=dict(type='list', elements='int'),
wait=dict(type='bool', default=True),
state=dict(default='present', choices=['present', 'absent']),
)

View File

@@ -17,6 +17,7 @@ options:
description:
- The list of additional disks for the server
type: list
elements: dict
default: []
add_public_ip:
description:
@@ -66,6 +67,7 @@ options:
- The list of custom fields to set on the server.
type: list
default: []
elements: dict
description:
description:
- The description to set for the server.
@@ -111,6 +113,7 @@ options:
description:
- The list of blue print packages to run on the server after its created.
type: list
elements: dict
default: []
password:
description:
@@ -130,6 +133,7 @@ options:
description:
- A list of ports to allow on the firewall to the servers public ip, if add_public_ip is set to True.
type: list
elements: dict
default: []
secondary_dns:
description:
@@ -141,6 +145,7 @@ options:
A list of server Ids to insure are started, stopped, or absent.
type: list
default: []
elements: str
source_server_password:
description:
- The password for the source server if a clone is specified.
@@ -575,8 +580,8 @@ class ClcServer:
type=dict(default='standard', choices=['standard', 'hyperscale', 'bareMetal']),
primary_dns=dict(default=None),
secondary_dns=dict(default=None),
additional_disks=dict(type='list', default=[]),
custom_fields=dict(type='list', default=[]),
additional_disks=dict(type='list', default=[], elements='dict'),
custom_fields=dict(type='list', default=[], elements='dict'),
ttl=dict(default=None),
managed_os=dict(type='bool', default=False),
description=dict(default=None),
@@ -586,7 +591,7 @@ class ClcServer:
anti_affinity_policy_name=dict(default=None),
alert_policy_id=dict(default=None),
alert_policy_name=dict(default=None),
packages=dict(type='list', default=[]),
packages=dict(type='list', default=[], elements='dict'),
state=dict(
default='present',
choices=[
@@ -597,7 +602,7 @@ class ClcServer:
count=dict(type='int', default=1),
exact_count=dict(type='int', default=None),
count_group=dict(),
server_ids=dict(type='list', default=[]),
server_ids=dict(type='list', default=[], elements='str'),
add_public_ip=dict(type='bool', default=False),
public_ip_protocol=dict(
default='TCP',
@@ -605,7 +610,7 @@ class ClcServer:
'TCP',
'UDP',
'ICMP']),
public_ip_ports=dict(type='list', default=[]),
public_ip_ports=dict(type='list', default=[], elements='dict'),
configuration_id=dict(default=None),
os_type=dict(default=None,
choices=[

View File

@@ -18,6 +18,7 @@ options:
- The list of CLC server Ids.
type: list
required: True
elements: str
expiration_days:
description:
- The number of days to keep the server snapshot before it expires.
@@ -330,7 +331,7 @@ class ClcSnapshot:
:return: the package dictionary object
"""
argument_spec = dict(
server_ids=dict(type='list', required=True),
server_ids=dict(type='list', required=True, elements='str'),
expiration_days=dict(default=7, type='int'),
wait=dict(default=True),
state=dict(

View File

@@ -543,7 +543,7 @@ def build_module():
snapshot_id=dict(type='str')
)),
vpc_id=dict(type='str', required=True),
admin_pass=dict(type='str'),
admin_pass=dict(type='str', no_log=True),
data_volumes=dict(type='list', elements='dict', options=dict(
volume_id=dict(type='str', required=True),
device=dict(type='str')

View File

@@ -730,7 +730,7 @@ class LxcContainerManagement(object):
for option_line in container_config:
# Look for key in config
if keyre.match(option_line):
_, _value = option_line.split('=', 1)
dummy, _value = option_line.split('=', 1)
config_value = ' '.join(_value.split())
line_index = container_config.index(option_line)
# If the sanitized values don't match replace them
@@ -953,7 +953,7 @@ class LxcContainerManagement(object):
"""
self.container = self.get_container_bind()
for _ in xrange(timeout):
for dummy in xrange(timeout):
if self._get_state() != 'running':
self.container.start()
self.state_change = True
@@ -1006,7 +1006,7 @@ class LxcContainerManagement(object):
:type timeout: ``int``
"""
for _ in xrange(timeout):
for dummy in xrange(timeout):
if not self._container_exists(container_name=self.container_name, lxc_path=self.lxc_path):
break

View File

@@ -45,6 +45,7 @@ options:
description:
- Profile to be used by the container
type: list
elements: str
devices:
description:
- 'The devices for the container
@@ -132,14 +133,14 @@ options:
- If not specified, it defaults to C(${HOME}/.config/lxc/client.key).
required: false
aliases: [ key_file ]
type: str
type: path
client_cert:
description:
- The client certificate file path.
- If not specified, it defaults to C(${HOME}/.config/lxc/client.crt).
required: false
aliases: [ cert_file ]
type: str
type: path
trust_password:
description:
- The client trusted password.
@@ -658,6 +659,7 @@ def main():
),
profiles=dict(
type='list',
elements='str',
),
source=dict(
type='dict',
@@ -690,11 +692,11 @@ def main():
default='unix:/var/snap/lxd/common/lxd/unix.socket'
),
client_key=dict(
type='str',
type='path',
aliases=['key_file']
),
client_cert=dict(
type='str',
type='path',
aliases=['cert_file']
),
trust_password=dict(type='str', no_log=True)

View File

@@ -2,12 +2,12 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com>
# Copyright: (c) 2020, Frank Dornheim <dornheim@posteo.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: lxd_profile
@@ -52,6 +52,14 @@ options:
See U(https://github.com/lxc/lxd/blob/master/doc/rest-api.md#post-11)
required: false
type: str
merge_profile:
description:
- Merge the configuration of the present profile with the new desired configuration,
instead of replacing it.
required: false
default: false
type: bool
version_added: 2.1.0
state:
choices:
- present
@@ -79,14 +87,14 @@ options:
- If not specified, it defaults to C($HOME/.config/lxc/client.key).
required: false
aliases: [ key_file ]
type: str
type: path
client_cert:
description:
- The client certificate file path.
- If not specified, it defaults to C($HOME/.config/lxc/client.crt).
required: false
aliases: [ cert_file ]
type: str
type: path
trust_password:
description:
- The client trusted password.
@@ -142,6 +150,23 @@ EXAMPLES = '''
parent: br0
type: nic
# An example for modify/merge a profile
- hosts: localhost
connection: local
tasks:
- name: Merge a profile
community.general.lxd_profile:
merge_profile: true
name: macvlan
state: present
config: {}
description: my macvlan profile
devices:
eth0:
nictype: macvlan
parent: br0
type: nic
# An example for deleting a profile
- hosts: localhost
connection: local
@@ -181,7 +206,6 @@ actions:
'''
import os
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.lxd import LXDClient, LXDClientException
@@ -266,7 +290,7 @@ class LXDProfileManagement(object):
self._create_profile()
else:
self.module.fail_json(
msg='new_name must not be set when the profile does not exist and the specified state is present',
msg='new_name must not be set when the profile does not exist and the state is present',
changed=False)
else:
if self.new_name is not None and self.new_name != self.name:
@@ -307,10 +331,96 @@ class LXDProfileManagement(object):
self._needs_to_change_profile_config('devices')
)
def _apply_profile_configs(self):
config = self.old_profile_json.copy()
def _merge_dicts(self, source, destination):
"""Merge Dictionarys
Get a list of filehandle numbers from logger to be handed to
DaemonContext.files_preserve
Args:
dict(source): source dict
dict(destination): destination dict
Kwargs:
None
Raises:
None
Returns:
dict(destination): merged dict"""
for key, value in source.items():
if isinstance(value, dict):
# get node or create one
node = destination.setdefault(key, {})
self._merge_dicts(value, node)
else:
destination[key] = value
return destination
def _merge_config(self, config):
""" merge profile
Merge Configuration of the present profile and the new desired configitems
Args:
dict(config): Dict with the old config in 'metadata' and new config in 'config'
Kwargs:
None
Raises:
None
Returns:
dict(config): new config"""
# merge or copy the sections from the existing profile to 'config'
for item in ['config', 'description', 'devices', 'name', 'used_by']:
if item in config:
config[item] = self._merge_dicts(config['metadata'][item], config[item])
else:
config[item] = config['metadata'][item]
# merge or copy the sections from the ansible-task to 'config'
return self._merge_dicts(self.config, config)
def _generate_new_config(self, config):
""" rebuild profile
Rebuild the Profile by the configuration provided in the play.
Existing configurations are discarded.
This ist the default behavior.
Args:
dict(config): Dict with the old config in 'metadata' and new config in 'config'
Kwargs:
None
Raises:
None
Returns:
dict(config): new config"""
for k, v in self.config.items():
config[k] = v
return config
def _apply_profile_configs(self):
""" Selection of the procedure: rebuild or merge
The standard behavior is that all information not contained
in the play is discarded.
If "merge_profile" is provides in the play and "True", then existing
configurations from the profile and new ones defined are merged.
Args:
None
Kwargs:
None
Raises:
None
Returns:
None"""
config = self.old_profile_json.copy()
if self.module.params['merge_profile']:
config = self._merge_config(config)
else:
config = self._generate_new_config(config)
# upload config to lxd
self.client.do('PUT', '/1.0/profiles/{0}'.format(self.name), config)
self.actions.append('apply_profile_configs')
@@ -371,6 +481,10 @@ def main():
devices=dict(
type='dict',
),
merge_profile=dict(
type='bool',
default=False
),
state=dict(
choices=PROFILES_STATES,
default='present'
@@ -384,11 +498,11 @@ def main():
default='unix:/var/snap/lxd/common/lxd/unix.socket'
),
client_key=dict(
type='str',
type='path',
aliases=['key_file']
),
client_cert=dict(
type='str',
type='path',
aliases=['cert_file']
),
trust_password=dict(type='str', no_log=True)

View File

@@ -405,8 +405,8 @@ def main():
instance_gateway=dict(type='str', aliases=['gateway']),
instance_domain=dict(type='str', aliases=['domain']),
instance_dns=dict(type='str', aliases=['dns']),
instance_rootpw=dict(type='str', aliases=['rootpw']),
instance_key=dict(type='str', aliases=['key']),
instance_rootpw=dict(type='str', aliases=['rootpw'], no_log=True),
instance_key=dict(type='str', aliases=['key'], no_log=True),
sdomain=dict(type='str'),
region=dict(type='str'),
),

View File

@@ -345,7 +345,6 @@ EXAMPLES = r'''
state: absent
'''
import os
import time
import traceback
from distutils.version import LooseVersion
@@ -356,7 +355,7 @@ try:
except ImportError:
HAS_PROXMOXER = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.basic import AnsibleModule, env_fallback
from ansible.module_utils._text import to_native
@@ -481,7 +480,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
api_host=dict(required=True),
api_password=dict(no_log=True),
api_password=dict(no_log=True, fallback=(env_fallback, ['PROXMOX_PASSWORD'])),
api_token_id=dict(no_log=True),
api_token_secret=dict(no_log=True),
api_user=dict(required=True),
@@ -514,7 +513,10 @@ def main():
description=dict(type='str'),
hookscript=dict(type='str'),
proxmox_default_behavior=dict(type='str', choices=['compatibility', 'no_defaults']),
)
),
required_if=[('state', 'present', ['node', 'hostname', 'password', 'ostemplate'])],
required_together=[('api_token_id', 'api_token_secret')],
required_one_of=[('api_password', 'api_token_id')],
)
if not HAS_PROXMOXER:
@@ -561,13 +563,7 @@ def main():
module.params[param] = value
auth_args = {'user': api_user}
if not (api_token_id and api_token_secret):
# If password not set get it from PROXMOX_PASSWORD env
if not api_password:
try:
api_password = os.environ['PROXMOX_PASSWORD']
except KeyError as e:
module.fail_json(msg='You should set api_password param or use PROXMOX_PASSWORD environment variable')
if not api_token_id:
auth_args['password'] = api_password
else:
auth_args['token_name'] = api_token_id
@@ -599,8 +595,6 @@ def main():
# If no vmid was passed, there cannot be another VM named 'hostname'
if not module.params['vmid'] and get_vmid(proxmox, hostname) and not module.params['force']:
module.exit_json(changed=False, msg="VM with hostname %s already exists and has ID number %s" % (hostname, get_vmid(proxmox, hostname)[0]))
elif not (node, module.params['hostname'] and module.params['password'] and module.params['ostemplate']):
module.fail_json(msg='node, hostname, password and ostemplate are mandatory for creating vm')
elif not node_check(proxmox, node):
module.fail_json(msg="node '%s' not exists in cluster" % node)
elif not content_check(proxmox, node, module.params['ostemplate'], template_store):
@@ -622,7 +616,7 @@ def main():
searchdomain=module.params['searchdomain'],
force=int(module.params['force']),
pubkey=module.params['pubkey'],
features=",".join(module.params['features'] or []),
features=",".join(module.params['features']) if module.params['features'] is not None else None,
unprivileged=int(module.params['unprivileged']),
description=module.params['description'],
hookscript=module.params['hookscript'])

View File

@@ -31,6 +31,9 @@ options:
description:
- Pass arbitrary arguments to kvm.
- This option is for experts only!
- If I(proxmox_default_behavior) is set to C(compatiblity) (the default value), this
option has a default of C(-serial unix:/var/run/qemu-server/<vmid>.serial,server,nowait).
Note that the default value of I(proxmox_default_behavior) changes in community.general 4.0.0.
type: str
autostart:
description:
@@ -730,27 +733,6 @@ EXAMPLES = '''
'''
RETURN = '''
devices:
description: The list of devices created or used.
returned: success
type: dict
sample: '
{
"ide0": "VMS_LVM:vm-115-disk-1",
"ide1": "VMs:115/vm-115-disk-3.raw",
"virtio0": "VMS_LVM:vm-115-disk-2",
"virtio1": "VMs:115/vm-115-disk-1.qcow2",
"virtio2": "VMs:115/vm-115-disk-2.raw"
}'
mac:
description: List of mac address created and net[n] attached. Useful when you want to use provision systems like Foreman via PXE.
returned: success
type: dict
sample: '
{
"net0": "3E:6E:97:D2:31:9F",
"net1": "B6:A1:FC:EF:78:A4"
}'
vmid:
description: The VM vmid.
returned: success
@@ -759,7 +741,6 @@ vmid:
status:
description:
- The current virtual machine status.
- Returned only when C(state=current)
returned: success
type: dict
sample: '{
@@ -769,7 +750,6 @@ status:
}'
'''
import os
import re
import time
import traceback
@@ -782,7 +762,7 @@ try:
except ImportError:
HAS_PROXMOXER = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.basic import AnsibleModule, env_fallback
from ansible.module_utils._text import to_native
@@ -948,9 +928,9 @@ def create_vm(module, proxmox, vmid, newid, node, name, memory, cpu, cores, sock
if searchdomains:
kwargs['searchdomain'] = ' '.join(searchdomains)
# -args and skiplock require root@pam user
# -args and skiplock require root@pam user - but can not use api tokens
if module.params['api_user'] == "root@pam" and module.params['args'] is None:
if not update:
if not update and module.params['proxmox_default_behavior'] == 'compatibility':
kwargs['args'] = vm_args
elif module.params['api_user'] == "root@pam" and module.params['args'] is not None:
kwargs['args'] = module.params['args']
@@ -1015,7 +995,7 @@ def main():
agent=dict(type='bool'),
args=dict(type='str'),
api_host=dict(required=True),
api_password=dict(no_log=True),
api_password=dict(no_log=True, fallback=(env_fallback, ['PROXMOX_PASSWORD'])),
api_token_id=dict(no_log=True),
api_token_secret=dict(no_log=True),
api_user=dict(required=True),
@@ -1028,12 +1008,12 @@ def main():
cipassword=dict(type='str', no_log=True),
citype=dict(type='str', choices=['nocloud', 'configdrive2']),
ciuser=dict(type='str'),
clone=dict(type='str', default=None),
clone=dict(type='str'),
cores=dict(type='int'),
cpu=dict(type='str'),
cpulimit=dict(type='int'),
cpuunits=dict(type='int'),
delete=dict(type='str', default=None),
delete=dict(type='str'),
description=dict(type='str'),
digest=dict(type='str'),
force=dict(type='bool'),
@@ -1056,7 +1036,7 @@ def main():
name=dict(type='str'),
nameservers=dict(type='list', elements='str'),
net=dict(type='dict'),
newid=dict(type='int', default=None),
newid=dict(type='int'),
node=dict(),
numa=dict(type='dict'),
numa_enabled=dict(type='bool'),
@@ -1092,13 +1072,14 @@ def main():
vcpus=dict(type='int'),
vga=dict(choices=['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']),
virtio=dict(type='dict'),
vmid=dict(type='int', default=None),
vmid=dict(type='int'),
watchdog=dict(),
proxmox_default_behavior=dict(type='str', choices=['compatibility', 'no_defaults']),
),
mutually_exclusive=[('delete', 'revert'), ('delete', 'update'), ('revert', 'update'), ('clone', 'update'), ('clone', 'delete'), ('clone', 'revert')],
required_one_of=[('name', 'vmid',)],
required_if=[('state', 'present', ['node'])]
required_together=[('api_token_id', 'api_token_secret')],
required_one_of=[('name', 'vmid'), ('api_password', 'api_token_id')],
required_if=[('state', 'present', ['node'])],
)
if not HAS_PROXMOXER:
@@ -1140,7 +1121,6 @@ def main():
cores=1,
cpu='kvm64',
cpuunits=1000,
force=False,
format='qcow2',
kvm=True,
memory=512,
@@ -1159,12 +1139,6 @@ def main():
auth_args = {'user': api_user}
if not (api_token_id and api_token_secret):
# If password not set get it from PROXMOX_PASSWORD env
if not api_password:
try:
api_password = os.environ['PROXMOX_PASSWORD']
except KeyError:
module.fail_json(msg='You should set api_password param or use PROXMOX_PASSWORD environment variable')
auth_args['password'] = api_password
else:
auth_args['token_name'] = api_token_id
@@ -1207,36 +1181,36 @@ def main():
# Ensure source VM id exists when cloning
if not get_vm(proxmox, vmid):
module.fail_json(msg='VM with vmid = %s does not exist in cluster' % vmid)
module.fail_json(vmid=vmid, msg='VM with vmid = %s does not exist in cluster' % vmid)
# Ensure the choosen VM name doesn't already exist when cloning
if get_vmid(proxmox, name):
module.exit_json(changed=False, msg="VM with name <%s> already exists" % name)
module.exit_json(changed=False, vmid=vmid, msg="VM with name <%s> already exists" % name)
# Ensure the choosen VM id doesn't already exist when cloning
if get_vm(proxmox, newid):
module.exit_json(changed=False, msg="vmid %s with VM name %s already exists" % (newid, name))
module.exit_json(changed=False, vmid=vmid, msg="vmid %s with VM name %s already exists" % (newid, name))
if delete is not None:
try:
settings(module, proxmox, vmid, node, name, delete=delete)
module.exit_json(changed=True, msg="Settings has deleted on VM {0} with vmid {1}".format(name, vmid))
module.exit_json(changed=True, vmid=vmid, msg="Settings has deleted on VM {0} with vmid {1}".format(name, vmid))
except Exception as e:
module.fail_json(msg='Unable to delete settings on VM {0} with vmid {1}: '.format(name, vmid) + str(e))
module.fail_json(vmid=vmid, msg='Unable to delete settings on VM {0} with vmid {1}: '.format(name, vmid) + str(e))
if revert is not None:
try:
settings(module, proxmox, vmid, node, name, revert=revert)
module.exit_json(changed=True, msg="Settings has reverted on VM {0} with vmid {1}".format(name, vmid))
module.exit_json(changed=True, vmid=vmid, msg="Settings has reverted on VM {0} with vmid {1}".format(name, vmid))
except Exception as e:
module.fail_json(msg='Unable to revert settings on VM {0} with vmid {1}: Maybe is not a pending task... '.format(name, vmid) + str(e))
module.fail_json(vmid=vmid, msg='Unable to revert settings on VM {0} with vmid {1}: Maybe is not a pending task... '.format(name, vmid) + str(e))
if state == 'present':
try:
if get_vm(proxmox, vmid) and not (update or clone):
module.exit_json(changed=False, msg="VM with vmid <%s> already exists" % vmid)
module.exit_json(changed=False, vmid=vmid, msg="VM with vmid <%s> already exists" % vmid)
elif get_vmid(proxmox, name) and not (update or clone):
module.exit_json(changed=False, msg="VM with name <%s> already exists" % name)
module.exit_json(changed=False, vmid=vmid, msg="VM with name <%s> already exists" % name)
elif not (node, name):
module.fail_json(msg='node, name is mandatory for creating/updating vm')
elif not node_check(proxmox, node):
@@ -1309,18 +1283,18 @@ def main():
scsi=module.params['scsi'],
virtio=module.params['virtio'])
if update:
module.exit_json(changed=True, msg="VM %s with vmid %s updated" % (name, vmid))
module.exit_json(changed=True, vmid=vmid, msg="VM %s with vmid %s updated" % (name, vmid))
elif clone is not None:
module.exit_json(changed=True, msg="VM %s with newid %s cloned from vm with vmid %s" % (name, newid, vmid))
module.exit_json(changed=True, vmid=vmid, msg="VM %s with newid %s cloned from vm with vmid %s" % (name, newid, vmid))
else:
module.exit_json(changed=True, msg="VM %s with vmid %s deployed" % (name, vmid), **results)
module.exit_json(changed=True, vmid=vmid, msg="VM %s with vmid %s deployed" % (name, vmid), **results)
except Exception as e:
if update:
module.fail_json(msg="Unable to update vm {0} with vmid {1}=".format(name, vmid) + str(e))
module.fail_json(vmid=vmid, msg="Unable to update vm {0} with vmid {1}=".format(name, vmid) + str(e))
elif clone is not None:
module.fail_json(msg="Unable to clone vm {0} from vmid {1}=".format(name, vmid) + str(e))
module.fail_json(vmid=vmid, msg="Unable to clone vm {0} from vmid {1}=".format(name, vmid) + str(e))
else:
module.fail_json(msg="creation of qemu VM %s with vmid %s failed with exception=%s" % (name, vmid, e))
module.fail_json(vmid=vmid, msg="creation of qemu VM %s with vmid %s failed with exception=%s" % (name, vmid, e))
elif state == 'started':
try:
@@ -1328,14 +1302,14 @@ def main():
module.fail_json(msg='VM with name = %s does not exist in cluster' % name)
vm = get_vm(proxmox, vmid)
if not vm:
module.fail_json(msg='VM with vmid <%s> does not exist in cluster' % vmid)
module.fail_json(vmid=vmid, msg='VM with vmid <%s> does not exist in cluster' % vmid)
if vm[0]['status'] == 'running':
module.exit_json(changed=False, msg="VM %s is already running" % vmid)
module.exit_json(changed=False, vmid=vmid, msg="VM %s is already running" % vmid, **status)
if start_vm(module, proxmox, vm):
module.exit_json(changed=True, msg="VM %s started" % vmid)
module.exit_json(changed=True, vmid=vmid, msg="VM %s started" % vmid, **status)
except Exception as e:
module.fail_json(msg="starting of VM %s failed with exception: %s" % (vmid, e))
module.fail_json(vmid=vmid, msg="starting of VM %s failed with exception: %s" % (vmid, e), **status)
elif state == 'stopped':
try:
@@ -1344,15 +1318,15 @@ def main():
vm = get_vm(proxmox, vmid)
if not vm:
module.fail_json(msg='VM with vmid = %s does not exist in cluster' % vmid)
module.fail_json(vmid=vmid, msg='VM with vmid = %s does not exist in cluster' % vmid)
if vm[0]['status'] == 'stopped':
module.exit_json(changed=False, msg="VM %s is already stopped" % vmid)
module.exit_json(changed=False, vmid=vmid, msg="VM %s is already stopped" % vmid, **status)
if stop_vm(module, proxmox, vm, force=module.params['force']):
module.exit_json(changed=True, msg="VM %s is shutting down" % vmid)
module.exit_json(changed=True, vmid=vmid, msg="VM %s is shutting down" % vmid, **status)
except Exception as e:
module.fail_json(msg="stopping of VM %s failed with exception: %s" % (vmid, e))
module.fail_json(vmid=vmid, msg="stopping of VM %s failed with exception: %s" % (vmid, e), **status)
elif state == 'restarted':
try:
@@ -1361,33 +1335,33 @@ def main():
vm = get_vm(proxmox, vmid)
if not vm:
module.fail_json(msg='VM with vmid = %s does not exist in cluster' % vmid)
module.fail_json(vmid=vmid, msg='VM with vmid = %s does not exist in cluster' % vmid)
if vm[0]['status'] == 'stopped':
module.exit_json(changed=False, msg="VM %s is not running" % vmid)
module.exit_json(changed=False, vmid=vmid, msg="VM %s is not running" % vmid, **status)
if stop_vm(module, proxmox, vm, force=module.params['force']) and start_vm(module, proxmox, vm):
module.exit_json(changed=True, msg="VM %s is restarted" % vmid)
module.exit_json(changed=True, vmid=vmid, msg="VM %s is restarted" % vmid, **status)
except Exception as e:
module.fail_json(msg="restarting of VM %s failed with exception: %s" % (vmid, e))
module.fail_json(vmid=vmid, msg="restarting of VM %s failed with exception: %s" % (vmid, e), **status)
elif state == 'absent':
try:
vm = get_vm(proxmox, vmid)
if not vm:
module.exit_json(changed=False)
module.exit_json(changed=False, vmid=vmid)
proxmox_node = proxmox.nodes(vm[0]['node'])
if vm[0]['status'] == 'running':
if module.params['force']:
stop_vm(module, proxmox, vm, True)
else:
module.exit_json(changed=False, msg="VM %s is running. Stop it before deletion or use force=yes." % vmid)
module.exit_json(changed=False, vmid=vmid, msg="VM %s is running. Stop it before deletion or use force=yes." % vmid)
taskid = proxmox_node.qemu.delete(vmid)
if not wait_for_task(module, proxmox, vm[0]['node'], taskid):
module.fail_json(msg='Reached timeout while waiting for removing VM. Last line in task before timeout: %s' %
proxmox_node.tasks(taskid).log.get()[:1])
else:
module.exit_json(changed=True, msg="VM %s removed" % vmid)
module.exit_json(changed=True, vmid=vmid, msg="VM %s removed" % vmid)
except Exception as e:
module.fail_json(msg="deletion of VM %s failed with exception: %s" % (vmid, e))
@@ -1401,7 +1375,7 @@ def main():
current = proxmox.nodes(vm[0]['node']).qemu(vmid).status.current.get()['status']
status['status'] = current
if status:
module.exit_json(changed=False, msg="VM %s with vmid = %s is %s" % (name, vmid, current), **status)
module.exit_json(changed=False, vmid=vmid, msg="VM %s with vmid = %s is %s" % (name, vmid, current), **status)
if __name__ == '__main__':

View File

@@ -31,6 +31,7 @@ options:
- The password to authenticate with.
- You can use PROXMOX_PASSWORD environment variable.
type: str
required: yes
hostname:
description:
- The instance name.
@@ -106,7 +107,6 @@ EXAMPLES = r'''
RETURN = r'''#'''
import os
import time
import traceback
@@ -118,7 +118,7 @@ except ImportError:
PROXMOXER_IMP_ERR = traceback.format_exc()
HAS_PROXMOXER = False
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible.module_utils.basic import AnsibleModule, missing_required_lib, env_fallback
from ansible.module_utils._text import to_native
@@ -182,7 +182,7 @@ def main():
argument_spec=dict(
api_host=dict(required=True),
api_user=dict(required=True),
api_password=dict(no_log=True),
api_password=dict(no_log=True, required=True, fallback=(env_fallback, ['PROXMOX_PASSWORD'])),
vmid=dict(required=False),
validate_certs=dict(type='bool', default='no'),
hostname=dict(),
@@ -213,13 +213,6 @@ def main():
force = module.params['force']
vmstate = module.params['vmstate']
# If password not set get it from PROXMOX_PASSWORD env
if not api_password:
try:
api_password = os.environ['PROXMOX_PASSWORD']
except KeyError as e:
module.fail_json(msg='You should set api_password param or use PROXMOX_PASSWORD environment variable' % to_native(e))
try:
proxmox = setup_api(api_host, api_user, api_password, validate_certs)

View File

@@ -122,7 +122,7 @@ try:
except ImportError:
HAS_PROXMOXER = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.basic import AnsibleModule, env_fallback
def get_template(proxmox, node, storage, content_type, template):
@@ -175,7 +175,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
api_host=dict(required=True),
api_password=dict(no_log=True),
api_password=dict(no_log=True, fallback=(env_fallback, ['PROXMOX_PASSWORD'])),
api_token_id=dict(no_log=True),
api_token_secret=dict(no_log=True),
api_user=dict(required=True),
@@ -188,7 +188,10 @@ def main():
timeout=dict(type='int', default=30),
force=dict(type='bool', default=False),
state=dict(default='present', choices=['present', 'absent']),
)
),
required_together=[('api_token_id', 'api_token_secret')],
required_one_of=[('api_password', 'api_token_id')],
required_if=[('state', 'absent', ['template'])]
)
if not HAS_PROXMOXER:
@@ -207,12 +210,6 @@ def main():
auth_args = {'user': api_user}
if not (api_token_id and api_token_secret):
# If password not set get it from PROXMOX_PASSWORD env
if not api_password:
try:
api_password = os.environ['PROXMOX_PASSWORD']
except KeyError as e:
module.fail_json(msg='You should set api_password param or use PROXMOX_PASSWORD environment variable')
auth_args['password'] = api_password
else:
auth_args['token_name'] = api_token_id
@@ -261,9 +258,7 @@ def main():
content_type = module.params['content_type']
template = module.params['template']
if not template:
module.fail_json(msg='template param is mandatory')
elif not get_template(proxmox, node, storage, content_type, template):
if not get_template(proxmox, node, storage, content_type, template):
module.exit_json(changed=False, msg='template with volid=%s:%s/%s is already deleted' % (storage, content_type, template))
if delete_template(module, proxmox, node, storage, content_type, template, timeout):

View File

@@ -500,7 +500,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
auth_token=dict(
type='str',
type='str', no_log=True,
default=os.environ.get('ONEANDONE_AUTH_TOKEN')),
api_url=dict(
type='str',

View File

@@ -594,7 +594,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
auth_token=dict(
type='str',
type='str', no_log=True,
default=os.environ.get('ONEANDONE_AUTH_TOKEN')),
api_url=dict(
type='str',

View File

@@ -947,7 +947,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
auth_token=dict(
type='str',
type='str', no_log=True,
default=os.environ.get('ONEANDONE_AUTH_TOKEN')),
api_url=dict(
type='str',

View File

@@ -384,7 +384,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
auth_token=dict(
type='str',
type='str', no_log=True,
default=os.environ.get('ONEANDONE_AUTH_TOKEN')),
api_url=dict(
type='str',

View File

@@ -274,7 +274,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
auth_token=dict(
type='str',
type='str', no_log=True,
default=os.environ.get('ONEANDONE_AUTH_TOKEN')),
api_url=dict(
type='str',

View File

@@ -137,17 +137,13 @@ def main():
host = search_by_name(hosts_service, module.params['host'])
if host is None:
raise Exception("Host '%s' was not found." % module.params['host'])
tags.extend([
tag for tag in hosts_service.host_service(host.id).tags_service().list()
])
tags.extend(hosts_service.host_service(host.id).tags_service().list())
if module.params['vm']:
vms_service = connection.system_service().vms_service()
vm = search_by_name(vms_service, module.params['vm'])
if vm is None:
raise Exception("Vm '%s' was not found." % module.params['vm'])
tags.extend([
tag for tag in vms_service.vm_service(vm.id).tags_service().list()
])
tags.extend(vms_service.vm_service(vm.id).tags_service().list())
if not (module.params['vm'] or module.params['host'] or module.params['name']):
tags = all_tags

View File

@@ -31,20 +31,25 @@ options:
auth_token:
description:
- Packet API token. You can also supply it in env var C(PACKET_API_TOKEN).
type: str
count:
description:
- The number of devices to create. Count number can be included in hostname via the %d string formatter.
default: 1
type: int
count_offset:
description:
- From which number to start the count.
default: 1
type: int
device_ids:
description:
- List of device IDs on which to operate.
type: list
elements: str
tags:
description:
@@ -57,10 +62,12 @@ options:
facility:
description:
- Facility slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/facilities/).
type: str
features:
description:
- Dict with "features" for device creation. See Packet API docs for details.
type: dict
hostnames:
description:
@@ -68,6 +75,8 @@ options:
- If given string or one-item list, you can use the C("%d") Python string format to expand numbers from I(count).
- If only one hostname, it might be expanded to list if I(count)>1.
aliases: [name]
type: list
elements: str
locked:
description:
@@ -79,15 +88,18 @@ options:
operating_system:
description:
- OS slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/operatingsystems/).
type: str
plan:
description:
- Plan slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/plans/).
type: str
project_id:
description:
- ID of project of the device.
required: true
type: str
state:
description:
@@ -96,10 +108,12 @@ options:
- If set to C(active), the module call will block until all the specified devices are in state active due to the Packet API, or until I(wait_timeout).
choices: [present, absent, active, inactive, rebooted]
default: present
type: str
user_data:
description:
- Userdata blob made available to the machine
type: str
wait_for_public_IPv:
description:
@@ -107,16 +121,21 @@ options:
- If set to 4, it will wait until IPv4 is assigned to the instance.
- If set to 6, wait until public IPv6 is assigned to the instance.
choices: [4,6]
type: int
wait_timeout:
description:
- How long (seconds) to wait either for automatic IP address assignment, or for the device to reach the C(active) I(state).
- If I(wait_for_public_IPv) is set and I(state) is C(active), the module will wait for both events consequently, applying the timeout twice.
default: 900
type: int
ipxe_script_url:
description:
- URL of custom iPXE script for provisioning.
- More about custom iPXE for Packet devices at U(https://help.packet.net/technical/infrastructure/custom-ipxe).
type: str
always_pxe:
description:
- Persist PXE as the first boot option.
@@ -601,10 +620,10 @@ def main():
no_log=True),
count=dict(type='int', default=1),
count_offset=dict(type='int', default=1),
device_ids=dict(type='list'),
device_ids=dict(type='list', elements='str'),
facility=dict(),
features=dict(type='dict'),
hostnames=dict(type='list', aliases=['name']),
hostnames=dict(type='list', elements='str', aliases=['name']),
tags=dict(type='list', elements='str'),
locked=dict(type='bool', default=False, aliases=['lock']),
operating_system=dict(),

View File

@@ -111,6 +111,7 @@ options:
required: false
default: []
type: list
elements: dict
changes:
description:
- "List of fields which should be changed by block itself (doesn't
@@ -552,7 +553,7 @@ def main():
state=dict(default='present', type='str',
choices=['started', 'stopped', 'present', 'absent']),
name=dict(required=True, type='str'), description=dict(type='str'),
event_handlers=dict(default=list(), type='list'),
event_handlers=dict(default=list(), type='list', elements='dict'),
changes=dict(default=dict(), type='dict'),
cache=dict(default=dict(), type='dict'),
validate_certs=dict(default=True, type='bool'))

View File

@@ -238,7 +238,7 @@ def main():
loadbalancer=dict(required=True),
state=dict(default='present', choices=['present', 'absent']),
enabled=dict(type='bool', default=True),
private_key=dict(),
private_key=dict(no_log=True),
certificate=dict(),
intermediate_certificate=dict(),
secure_port=dict(type='int', default=443),

View File

@@ -78,6 +78,7 @@ options:
description:
- A list of disks to add, valid properties are documented in vmadm(1M).
type: list
elements: dict
dns_domain:
required: false
description:
@@ -93,6 +94,7 @@ options:
description:
- Mount additional filesystems into an OS VM.
type: list
elements: dict
firewall_enabled:
required: false
description:
@@ -198,6 +200,7 @@ options:
description:
- A list of nics to add, valid properties are documented in vmadm(1M).
type: list
elements: dict
nowait:
required: false
description:
@@ -230,6 +233,7 @@ options:
description:
- List of resolvers to be put into C(/etc/resolv.conf).
type: list
elements: dict
routes:
required: false
description:
@@ -670,7 +674,6 @@ def main():
'zfs_snapshot_limit'
],
'dict': ['customer_metadata', 'internal_metadata', 'routes'],
'list': ['disks', 'nics', 'resolvers', 'filesystems']
}
# Start with the options that are not as trivial as those above.
@@ -697,6 +700,10 @@ def main():
# Regular strings, however these require additional options.
spice_password=dict(type='str', no_log=True),
vnc_password=dict(type='str', no_log=True),
disks=dict(type='list', elements='dict'),
nics=dict(type='list', elements='dict'),
resolvers=dict(type='list', elements='dict'),
filesystems=dict(type='list', elements='dict'),
)
# Add our 'simple' options to options dict.

View File

@@ -115,6 +115,7 @@ options:
- List of disk sizes to be assigned to new virtual instance.
default: [ 25 ]
type: list
elements: int
os_code:
description:
- OS Code to be used for new virtual instance.
@@ -140,6 +141,7 @@ options:
description:
- List of ssh keys by their Id to be assigned to a virtual instance.
type: list
elements: str
post_uri:
description:
- URL of a post provisioning script to be loaded and executed on virtual instance.
@@ -396,13 +398,13 @@ def main():
cpus=dict(type='int', choices=CPU_SIZES),
memory=dict(type='int', choices=MEMORY_SIZES),
flavor=dict(type='str'),
disks=dict(type='list', default=[25]),
disks=dict(type='list', elements='int', default=[25]),
os_code=dict(type='str'),
image_id=dict(type='str'),
nic_speed=dict(type='int', choices=NIC_SPEEDS),
public_vlan=dict(type='str'),
private_vlan=dict(type='str'),
ssh_keys=dict(type='list', default=[]),
ssh_keys=dict(type='list', elements='str', default=[]),
post_uri=dict(type='str'),
state=dict(type='str', default='present', choices=STATES),
wait=dict(type='bool', default=True),

View File

@@ -1459,7 +1459,7 @@ def main():
min_size=dict(type='int', required=True),
monitoring=dict(type='str'),
multai_load_balancers=dict(type='list'),
multai_token=dict(type='str'),
multai_token=dict(type='str', no_log=True),
name=dict(type='str', required=True),
network_interfaces=dict(type='list'),
on_demand_count=dict(type='int'),
@@ -1483,7 +1483,7 @@ def main():
target_group_arns=dict(type='list'),
tenancy=dict(type='str'),
terminate_at_end_of_billing_hour=dict(type='bool'),
token=dict(type='str'),
token=dict(type='str', no_log=True),
unit=dict(type='str'),
user_data=dict(type='str'),
utilize_reserved_instances=dict(type='bool'),

View File

@@ -312,12 +312,11 @@ def run():
)
changed = False
nomad_jobs = list()
result = list()
try:
job_list = nomad_client.jobs.get_jobs()
for job in job_list:
nomad_jobs.append(nomad_client.job.get_job(job.get('ID')))
result = nomad_jobs
result.append(nomad_client.job.get_job(job.get('ID')))
except Exception as e:
module.fail_json(msg=to_native(e))

View File

@@ -115,7 +115,6 @@ EXAMPLES = '''
local_only: False
# example playbook:
---
- name: Upgrade aerospike
hosts: all
become: true
@@ -338,7 +337,7 @@ class Migrations:
namespace_tx = \
int(namespace_stats[self.module.params['migrate_tx_key']])
namespace_rx = \
int(namespace_stats[self.module.params['migrate_tx_key']])
int(namespace_stats[self.module.params['migrate_rx_key']])
except KeyError:
self.module.fail_json(
msg="Did not find partition remaining key:" +

View File

@@ -22,11 +22,13 @@ options:
description:
- Name of the plugin to install.
required: True
type: str
state:
description:
- Desired state of a plugin.
choices: ["present", "absent"]
default: present
type: str
src:
description:
- Optionally set the source location to retrieve the plugin from. This can be a file://
@@ -38,16 +40,19 @@ options:
effect.
- For ES 1.x use url.
required: False
type: str
url:
description:
- Set exact URL to download the plugin from (Only works for ES 1.x).
- For ES 2.x and higher, use src.
required: False
type: str
timeout:
description:
- "Timeout setting: 30s, 1m, 1h..."
- Only valid for Elasticsearch < 5.0. This option is ignored for Elasticsearch > 5.0.
default: 1m
type: str
force:
description:
- "Force batch mode when installing plugins. This is only necessary if a plugin requires additional permissions and console detection fails."
@@ -57,20 +62,25 @@ options:
description:
- Location of the plugin binary. If this file is not found, the default plugin binaries will be used.
- The default changed in Ansible 2.4 to None.
type: path
plugin_dir:
description:
- Your configured plugin directory specified in Elasticsearch
default: /usr/share/elasticsearch/plugins/
type: path
proxy_host:
description:
- Proxy host to use during plugin installation
type: str
proxy_port:
description:
- Proxy port to use during plugin installation
type: str
version:
description:
- Version of the plugin to be installed.
If plugin exists with previous version, it will NOT be updated
type: str
'''
EXAMPLES = '''
@@ -241,7 +251,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
name=dict(required=True),
state=dict(default="present", choices=PACKAGE_STATE_MAP.keys()),
state=dict(default="present", choices=list(PACKAGE_STATE_MAP.keys())),
src=dict(default=None),
url=dict(default=None),
timeout=dict(default="1m"),

View File

@@ -22,31 +22,38 @@ options:
description:
- Name of the plugin to install.
required: True
type: str
state:
description:
- Desired state of a plugin.
choices: ["present", "absent"]
default: present
type: str
url:
description:
- Set exact URL to download the plugin from.
- For local file, prefix its absolute path with file://
type: str
timeout:
description:
- "Timeout setting: 30s, 1m, 1h etc."
default: 1m
type: str
plugin_bin:
description:
- Location of the Kibana binary.
default: /opt/kibana/bin/kibana
type: path
plugin_dir:
description:
- Your configured plugin directory specified in Kibana.
default: /opt/kibana/installedPlugins/
type: path
version:
description:
- Version of the plugin to be installed.
- If plugin exists with previous version, plugin will NOT be updated unless C(force) is set to yes.
type: str
force:
description:
- Delete and re-install the plugin. Can be useful for plugins update.
@@ -209,7 +216,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
name=dict(required=True),
state=dict(default="present", choices=PACKAGE_STATE_MAP.keys()),
state=dict(default="present", choices=list(PACKAGE_STATE_MAP.keys())),
url=dict(default=None),
timeout=dict(default="1m"),
plugin_bin=dict(default="/opt/kibana/bin/kibana", type="path"),

View File

@@ -23,28 +23,37 @@ options:
description:
- The command you would like to perform against the cluster.
choices: ['ping', 'kv_test', 'join', 'plan', 'commit']
type: str
config_dir:
description:
- The path to the riak configuration directory
default: /etc/riak
type: path
http_conn:
description:
- The ip address and port that is listening for Riak HTTP queries
default: 127.0.0.1:8098
type: str
target_node:
description:
- The target node for certain operations (join, ping)
default: riak@127.0.0.1
type: str
wait_for_handoffs:
description:
- Number of seconds to wait for handoffs to complete.
type: int
default: 0
wait_for_ring:
description:
- Number of seconds to wait for all nodes to agree on the ring.
type: int
default: 0
wait_for_service:
description:
- Waits for a riak service to come online before continuing.
choices: ['kv']
type: str
validate_certs:
description:
- If C(no), SSL certificates will not be validated. This should only be used
@@ -93,8 +102,8 @@ def main():
config_dir=dict(default='/etc/riak', type='path'),
http_conn=dict(required=False, default='127.0.0.1:8098'),
target_node=dict(default='riak@127.0.0.1', required=False),
wait_for_handoffs=dict(default=False, type='int'),
wait_for_ring=dict(default=False, type='int'),
wait_for_handoffs=dict(default=0, type='int'),
wait_for_ring=dict(default=0, type='int'),
wait_for_service=dict(
required=False, default=None, choices=['kv']),
validate_certs=dict(default=True, type='bool'))

View File

@@ -14,11 +14,11 @@ short_description: Updates Vertica configuration parameters.
description:
- Updates Vertica configuration parameters.
options:
name:
parameter:
description:
- Name of the parameter to update.
required: true
aliases: [parameter]
aliases: [name]
type: str
value:
description:

View File

@@ -21,25 +21,30 @@ options:
description:
- Name of the cluster running the schema.
default: localhost
type: str
port:
description:
Database port to connect to.
default: 5433
type: str
db:
description:
- Name of the database running the schema.
type: str
login_user:
description:
- The username used to authenticate with.
default: dbadmin
type: str
login_password:
description:
- The password used to authenticate with.
type: str
notes:
- The default authentication assumes that you are either logging in as or sudo'ing
to the C(dbadmin) account on the host.
- This module uses C(pyodbc), a Python ODBC database adapter. You must ensure
that C(unixODBC) and C(pyodbc) is installed on the host and properly configured.
that C(unixODBC) and C(pyodbc) are installed on the host and properly configured.
- Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so)
to be added to the C(Vertica) section of either C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini)
and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16)

View File

@@ -15,37 +15,46 @@ short_description: Adds or removes Vertica database roles and assigns roles to t
description:
- Adds or removes Vertica database role and, optionally, assign other roles.
options:
name:
role:
description:
- Name of the role to add or remove.
required: true
type: str
aliases: ['name']
assigned_roles:
description:
- Comma separated list of roles to assign to the role.
aliases: ['assigned_role']
type: str
state:
description:
- Whether to create C(present), drop C(absent) or lock C(locked) a role.
choices: ['present', 'absent']
default: present
type: str
db:
description:
- Name of the Vertica database.
type: str
cluster:
description:
- Name of the Vertica cluster.
default: localhost
type: str
port:
description:
- Vertica cluster port to connect to.
default: 5433
type: str
login_user:
description:
- The username used to authenticate with.
default: dbadmin
type: str
login_password:
description:
- The password used to authenticate with.
type: str
notes:
- The default authentication assumes that you are either logging in as or sudo'ing
to the C(dbadmin) account on the host.
@@ -168,11 +177,11 @@ def main():
role=dict(required=True, aliases=['name']),
assigned_roles=dict(default=None, aliases=['assigned_role']),
state=dict(default='present', choices=['absent', 'present']),
db=dict(default=None),
db=dict(),
cluster=dict(default='localhost'),
port=dict(default='5433'),
login_user=dict(default='dbadmin'),
login_password=dict(default=None, no_log=True),
login_password=dict(no_log=True),
), supports_check_mode=True)
if not pyodbc_found:

View File

@@ -20,44 +20,55 @@ description:
will fail and only remove roles created for the schema if they have
no dependencies.
options:
name:
schema:
description:
- Name of the schema to add or remove.
required: true
aliases: ['name']
type: str
usage_roles:
description:
- Comma separated list of roles to create and grant usage access to the schema.
aliases: ['usage_role']
type: str
create_roles:
description:
- Comma separated list of roles to create and grant usage and create access to the schema.
aliases: ['create_role']
type: str
owner:
description:
- Name of the user to set as owner of the schema.
type: str
state:
description:
- Whether to create C(present), or drop C(absent) a schema.
default: present
choices: ['present', 'absent']
type: str
db:
description:
- Name of the Vertica database.
type: str
cluster:
description:
- Name of the Vertica cluster.
default: localhost
type: str
port:
description:
- Vertica cluster port to connect to.
default: 5433
type: str
login_user:
description:
- The username used to authenticate with.
default: dbadmin
type: str
login_password:
description:
- The password used to authenticate with.
type: str
notes:
- The default authentication assumes that you are either logging in as or sudo'ing
to the C(dbadmin) account on the host.
@@ -230,15 +241,15 @@ def main():
module = AnsibleModule(
argument_spec=dict(
schema=dict(required=True, aliases=['name']),
usage_roles=dict(default=None, aliases=['usage_role']),
create_roles=dict(default=None, aliases=['create_role']),
owner=dict(default=None),
usage_roles=dict(aliases=['usage_role']),
create_roles=dict(aliases=['create_role']),
owner=dict(),
state=dict(default='present', choices=['absent', 'present']),
db=dict(default=None),
db=dict(),
cluster=dict(default='localhost'),
port=dict(default='5433'),
login_user=dict(default='dbadmin'),
login_password=dict(default=None, no_log=True),
login_password=dict(no_log=True),
), supports_check_mode=True)
if not pyodbc_found:

View File

@@ -17,22 +17,27 @@ description:
- In such a situation, if the module tries to remove the user it
will fail and only remove roles granted to the user.
options:
name:
user:
description:
- Name of the user to add or remove.
required: true
type: str
aliases: ['name']
profile:
description:
- Sets the user's profile.
type: str
resource_pool:
description:
- Sets the user's resource pool.
type: str
password:
description:
- The user's password encrypted by the MD5 algorithm.
- The password must be generated with the format C("md5" + md5[password + username]),
resulting in a total of 35 characters. An easy way to do this is by querying
the Vertica database with select 'md5'||md5('<user_password><user_name>').
type: str
expired:
description:
- Sets the user's password expiration.
@@ -46,29 +51,36 @@ options:
description:
- Comma separated list of roles to assign to the user.
aliases: ['role']
type: str
state:
description:
- Whether to create C(present), drop C(absent) or lock C(locked) a user.
choices: ['present', 'absent', 'locked']
default: present
type: str
db:
description:
- Name of the Vertica database.
type: str
cluster:
description:
- Name of the Vertica cluster.
default: localhost
type: str
port:
description:
- Vertica cluster port to connect to.
default: 5433
type: str
login_user:
description:
- The username used to authenticate with.
default: dbadmin
type: str
login_password:
description:
- The password used to authenticate with.
type: str
notes:
- The default authentication assumes that you are either logging in as or sudo'ing
to the C(dbadmin) account on the host.
@@ -282,18 +294,18 @@ def main():
module = AnsibleModule(
argument_spec=dict(
user=dict(required=True, aliases=['name']),
profile=dict(default=None),
resource_pool=dict(default=None),
password=dict(default=None, no_log=True),
expired=dict(type='bool', default=None),
ldap=dict(type='bool', default=None),
roles=dict(default=None, aliases=['role']),
profile=dict(),
resource_pool=dict(),
password=dict(no_log=True),
expired=dict(type='bool'),
ldap=dict(type='bool'),
roles=dict(aliases=['role']),
state=dict(default='present', choices=['absent', 'present', 'locked']),
db=dict(default=None),
db=dict(),
cluster=dict(default='localhost'),
port=dict(default='5433'),
login_user=dict(default='dbadmin'),
login_password=dict(default=None, no_log=True),
login_password=dict(no_log=True),
), supports_check_mode=True)
if not pyodbc_found:

View File

@@ -59,8 +59,8 @@ options:
executable:
description:
- The path to the C(7z) executable to use for extracting files from the ISO.
- If not provided, it will assume the value C(7z).
type: path
default: '7z'
notes:
- Only the file checksum (content) is taken into account when extracting files
from the ISO image. If C(force=no), only checks the presence of the file.
@@ -101,7 +101,8 @@ def main():
image=dict(type='path', required=True, aliases=['path', 'src']),
dest=dict(type='path', required=True),
files=dict(type='list', elements='str', required=True),
force=dict(type='bool', default=True, aliases=['thirsty']),
force=dict(type='bool', default=True, aliases=['thirsty'],
deprecated_aliases=[dict(name='thirsty', version='3.0.0', collection_name='community.general')]),
executable=dict(type='path'), # No default on purpose
),
supports_check_mode=True,
@@ -112,10 +113,6 @@ def main():
force = module.params['force']
executable = module.params['executable']
if module.params.get('thirsty'):
module.deprecate('The alias "thirsty" has been deprecated and will be removed, use "force" instead',
version='3.0.0', collection_name='community.general') # was Ansible 2.13
result = dict(
changed=False,
dest=dest,

View File

@@ -66,6 +66,7 @@ options:
or a hash where the key is an element name and the value is the element value.
- This parameter requires C(xpath) to be set.
type: list
elements: raw
set_children:
description:
- Set the child-element(s) of a selected element for a given C(xpath).
@@ -73,6 +74,7 @@ options:
- Child elements must be specified as in C(add_children).
- This parameter requires C(xpath) to be set.
type: list
elements: raw
count:
description:
- Search for a given C(xpath) and provide the count of any matches.
@@ -809,8 +811,8 @@ def main():
state=dict(type='str', default='present', choices=['absent', 'present'], aliases=['ensure']),
value=dict(type='raw'),
attribute=dict(type='raw'),
add_children=dict(type='list'),
set_children=dict(type='list'),
add_children=dict(type='list', elements='raw'),
set_children=dict(type='list', elements='raw'),
count=dict(type='bool', default=False),
print_match=dict(type='bool', default=False),
pretty_print=dict(type='bool', default=False),

View File

@@ -137,6 +137,7 @@ options:
aliases:
- defaultRoles
type: list
elements: str
redirect_uris:
description:
@@ -145,6 +146,7 @@ options:
aliases:
- redirectUris
type: list
elements: str
web_origins:
description:
@@ -153,6 +155,7 @@ options:
aliases:
- webOrigins
type: list
elements: str
not_before:
description:
@@ -707,10 +710,10 @@ def main():
enabled=dict(type='bool'),
client_authenticator_type=dict(type='str', choices=['client-secret', 'client-jwt'], aliases=['clientAuthenticatorType']),
secret=dict(type='str', no_log=True),
registration_access_token=dict(type='str', aliases=['registrationAccessToken']),
default_roles=dict(type='list', aliases=['defaultRoles']),
redirect_uris=dict(type='list', aliases=['redirectUris']),
web_origins=dict(type='list', aliases=['webOrigins']),
registration_access_token=dict(type='str', aliases=['registrationAccessToken'], no_log=True),
default_roles=dict(type='list', elements='str', aliases=['defaultRoles']),
redirect_uris=dict(type='list', elements='str', aliases=['redirectUris']),
web_origins=dict(type='list', elements='str', aliases=['webOrigins']),
not_before=dict(type='int', aliases=['notBefore']),
bearer_only=dict(type='bool', aliases=['bearerOnly']),
consent_required=dict(type='bool', aliases=['consentRequired']),

View File

@@ -34,6 +34,7 @@ description:
options:
search_terms:
type: list
elements: dict
description:
- A list of one or more search terms.
- Each search term can either be a simple string or it can be a dictionary for more control.
@@ -372,7 +373,7 @@ def main():
master_password=dict(required=True, type='str', no_log=True),
secret_key=dict(type='str', no_log=True),
), default=None),
search_terms=dict(required=True, type='list')
search_terms=dict(required=True, type='list', elements='dict'),
),
supports_check_mode=True
)

View File

@@ -22,46 +22,56 @@ options:
- The path to the bin directory of OpenDJ.
required: false
default: /opt/opendj/bin
type: path
hostname:
description:
- The hostname of the OpenDJ server.
required: true
type: str
port:
description:
- The Admin port on which the OpenDJ instance is available.
required: true
type: str
username:
description:
- The username to connect to.
required: false
default: cn=Directory Manager
type: str
password:
description:
- The password for the cn=Directory Manager user.
- Either password or passwordfile is needed.
required: false
type: str
passwordfile:
description:
- Location to the password file which holds the password for the cn=Directory Manager user.
- Either password or passwordfile is needed.
required: false
type: path
backend:
description:
- The name of the backend on which the property needs to be updated.
required: true
type: str
name:
description:
- The configuration setting to update.
required: true
type: str
value:
description:
- The value for the configuration item.
required: true
type: str
state:
description:
- If configuration needs to be added/updated
required: false
default: "present"
type: str
'''
EXAMPLES = '''

View File

@@ -49,7 +49,8 @@ options:
type:
description:
- The type of the monitor.
choices: ['metric alert', 'service check', 'event alert', 'process alert', 'log alert']
- The types C(query alert), C(trace-analytics alert) and C(rum alert) were added in community.general 2.1.0.
choices: ['metric alert', 'service check', 'event alert', 'process alert', 'log alert', 'query alert', 'trace-analytics alert', 'rum alert']
type: str
query:
description:
@@ -208,7 +209,9 @@ def main():
api_host=dict(required=False),
app_key=dict(required=True, no_log=True),
state=dict(required=True, choices=['present', 'absent', 'mute', 'unmute']),
type=dict(required=False, choices=['metric alert', 'service check', 'event alert', 'process alert', 'log alert']),
type=dict(required=False, choices=['metric alert', 'service check', 'event alert',
'process alert', 'log alert', 'query alert',
'trace-analytics alert', 'rum alert']),
name=dict(required=True),
query=dict(required=False),
notification_message=dict(required=False, no_log=True, default=None, aliases=['message'],
@@ -348,7 +351,7 @@ def install_monitor(module):
if module.params['type'] == "service check":
options["thresholds"] = module.params['thresholds'] or {'ok': 1, 'critical': 1, 'warning': 1}
if module.params['type'] in ["metric alert", "log alert"] and module.params['thresholds'] is not None:
if module.params['type'] in ["metric alert", "log alert", "query alert", "trace-analytics alert", "rum alert"] and module.params['thresholds'] is not None:
options["thresholds"] = module.params['thresholds']
monitor = _get_monitor(module)

View File

@@ -63,6 +63,7 @@ options:
required: false
links:
type: list
elements: dict
description:
- See examples
'''
@@ -148,14 +149,14 @@ def main():
module = AnsibleModule(
argument_spec=dict(
user=dict(required=True),
api_key=dict(required=True),
api_key=dict(required=True, no_log=True),
name=dict(required=False),
title=dict(required=True),
source=dict(required=False),
description=dict(required=False),
start_time=dict(required=False, default=None, type='int'),
end_time=dict(required=False, default=None, type='int'),
links=dict(type='list')
links=dict(type='list', elements='dict')
)
)

View File

@@ -138,11 +138,11 @@ def main():
module = AnsibleModule(
argument_spec=dict(
name=dict(required=True),
state=dict(default="present", choices=PACKAGE_STATE_MAP.keys()),
state=dict(default="present", choices=list(PACKAGE_STATE_MAP.keys())),
plugin_bin=dict(default="/usr/share/logstash/bin/logstash-plugin", type="path"),
proxy_host=dict(default=None),
proxy_port=dict(default=None),
version=dict(default=None)
proxy_host=dict(),
proxy_port=dict(),
version=dict()
),
supports_check_mode=True
)

View File

@@ -47,6 +47,7 @@ options:
- ID of user making the request. Only needed when creating a maintenance_window.
service:
type: list
elements: str
description:
- A comma separated list of PagerDuty service IDs.
aliases: [ services ]
@@ -233,7 +234,7 @@ def main():
name=dict(required=False),
user=dict(required=False),
token=dict(required=True, no_log=True),
service=dict(required=False, type='list', aliases=["services"]),
service=dict(required=False, type='list', elements='str', aliases=["services"]),
window_id=dict(required=False),
requester_id=dict(required=False),
hours=dict(default='1', required=False), # @TODO change to int?

View File

@@ -197,9 +197,9 @@ def main():
argument_spec=dict(
name=dict(required=False),
service_id=dict(required=True),
service_key=dict(required=False),
integration_key=dict(required=False),
api_key=dict(required=True),
service_key=dict(required=False, no_log=True),
integration_key=dict(required=False, no_log=True),
api_key=dict(required=True, no_log=True),
state=dict(required=True,
choices=['triggered', 'acknowledged', 'resolved']),
client=dict(required=False, default=None),

View File

@@ -108,7 +108,7 @@ from datetime import datetime
def main():
module = AnsibleModule(
argument_spec=dict(
integration_key=dict(required=True, type='str'),
integration_key=dict(required=True, type='str', no_log=True),
summary=dict(required=True, type='str'),
source=dict(required=False, default='Ansible', type='str'),
user=dict(required=False, type='str'),

View File

@@ -112,7 +112,7 @@ def main():
checkid=dict(required=True),
uid=dict(required=True),
passwd=dict(required=True, no_log=True),
key=dict(required=True)
key=dict(required=True, no_log=True),
)
)

View File

@@ -92,7 +92,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
token=dict(required=True),
token=dict(required=True, no_log=True),
environment=dict(required=True),
revision=dict(required=True),
user=dict(required=False),

View File

@@ -97,6 +97,7 @@ RETURN = '''
import json
from ansible.module_utils._text import to_native
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import fetch_url
@@ -129,7 +130,7 @@ def query(module, url, check, subscription):
)
try:
json_out = json.loads(response.read())
json_out = json.loads(to_native(response.read()))
except Exception:
json_out = ""
@@ -181,7 +182,7 @@ def clear(module, url, check, subscription):
)
try:
json_out = json.loads(response.read())
json_out = json.loads(to_native(response.read()))
except Exception:
json_out = ""
@@ -246,7 +247,7 @@ def create(
)
try:
json_out = json.loads(response.read())
json_out = json.loads(to_native(response.read()))
except Exception:
json_out = ""

View File

@@ -152,7 +152,7 @@ def main():
module = AnsibleModule(
argument_spec=dict( # @TODO add types
key=dict(required=True),
key=dict(required=True, no_log=True),
event=dict(required=True, choices=['deploy', 'annotation']),
msg=dict(),
revision_id=dict(),

View File

@@ -0,0 +1,170 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: statsd
short_description: Send metrics to StatsD
version_added: 2.1.0
description:
- The C(statsd) module sends metrics to StatsD.
- For more information, see U(https://statsd-metrics.readthedocs.io/en/latest/).
- Supported metric types are C(counter) and C(gauge).
Currently unupported metric types are C(timer), C(set), and C(gaugedelta).
author: "Mark Mercado (@mamercad)"
requirements:
- statsd
options:
state:
type: str
description:
- State of the check, only C(present) makes sense.
choices: ["present"]
default: present
host:
type: str
default: localhost
description:
- StatsD host (hostname or IP) to send metrics to.
port:
type: int
default: 8125
description:
- The port on C(host) which StatsD is listening on.
protocol:
type: str
default: udp
choices: ["udp", "tcp"]
description:
- The transport protocol to send metrics over.
timeout:
type: float
default: 1.0
description:
- Sender timeout, only applicable if C(protocol) is C(tcp).
metric:
type: str
required: true
description:
- The name of the metric.
metric_type:
type: str
required: true
choices: ["counter", "gauge"]
description:
- The type of metric.
metric_prefix:
type: str
description:
- The prefix to add to the metric.
value:
type: int
required: true
description:
- The value of the metric.
delta:
type: bool
default: false
description:
- If the metric is of type C(gauge), change the value by C(delta).
'''
EXAMPLES = '''
- name: Increment the metric my_counter by 1
community.general.statsd:
host: localhost
port: 9125
protocol: tcp
metric: my_counter
metric_type: counter
value: 1
- name: Set the gauge my_gauge to 7
community.general.statsd:
host: localhost
port: 9125
protocol: tcp
metric: my_gauge
metric_type: gauge
value: 7
'''
from ansible.module_utils.basic import (AnsibleModule, missing_required_lib)
try:
from statsd import StatsClient, TCPStatsClient
HAS_STATSD = True
except ImportError:
HAS_STATSD = False
def udp_statsd_client(**client_params):
return StatsClient(**client_params)
def tcp_statsd_client(**client_params):
return TCPStatsClient(**client_params)
def main():
module = AnsibleModule(
argument_spec=dict(
state=dict(type='str', default='present', choices=['present']),
host=dict(type='str', default='localhost'),
port=dict(type='int', default=8125),
protocol=dict(type='str', default='udp', choices=['udp', 'tcp']),
timeout=dict(type='float', default=1.0),
metric=dict(type='str', required=True),
metric_type=dict(type='str', required=True, choices=['counter', 'gauge']),
metric_prefix=dict(type='str', default=''),
value=dict(type='int', required=True),
delta=dict(type='bool', default=False),
),
supports_check_mode=False
)
if not HAS_STATSD:
module.fail_json(msg=missing_required_lib('statsd'))
host = module.params.get('host')
port = module.params.get('port')
protocol = module.params.get('protocol')
timeout = module.params.get('timeout')
metric = module.params.get('metric')
metric_type = module.params.get('metric_type')
metric_prefix = module.params.get('metric_prefix')
value = module.params.get('value')
delta = module.params.get('delta')
if protocol == 'udp':
client = udp_statsd_client(host=host, port=port, prefix=metric_prefix, maxudpsize=512, ipv6=False)
elif protocol == 'tcp':
client = tcp_statsd_client(host=host, port=port, timeout=timeout, prefix=metric_prefix, ipv6=False)
metric_name = '%s/%s' % (metric_prefix, metric) if metric_prefix else metric
metric_display_value = '%s (delta=%s)' % (value, delta) if metric_type == 'gauge' else value
try:
if metric_type == 'counter':
client.incr(metric, value)
elif metric_type == 'gauge':
client.gauge(metric, value, delta=delta)
except Exception as exc:
module.fail_json(msg='Failed sending to StatsD %s' % str(exc))
finally:
if protocol == 'tcp':
client.close()
module.exit_json(msg="Sent %s %s -> %s to StatsD" % (metric_type, metric_name, str(metric_display_value)), changed=True)
if __name__ == '__main__':
main()

View File

@@ -59,11 +59,13 @@ options:
default: "https://api.status.io"
components:
type: list
elements: str
description:
- The given name of your component (server name)
aliases: ['component']
containers:
type: list
elements: str
description:
- The given name of your container (data center)
aliases: ['container']
@@ -339,9 +341,9 @@ def main():
state=dict(required=False, default='present',
choices=['present', 'absent']),
url=dict(default='https://api.status.io', required=False),
components=dict(type='list', required=False, default=None,
components=dict(type='list', elements='str', required=False, default=None,
aliases=['component']),
containers=dict(type='list', required=False, default=None,
containers=dict(type='list', elements='str', required=False, default=None,
aliases=['container']),
all_infrastructure_affected=dict(type='bool', default=False,
required=False),
@@ -423,7 +425,7 @@ def main():
if module.check_mode:
module.exit_json(changed=True)
else:
(rc, _, error) = create_maintenance(
(rc, dummy, error) = create_maintenance(
auth_headers, url, statuspage, host_ids,
all_infrastructure_affected, automation,
title, desc, returned_date, maintenance_notify_now,
@@ -449,7 +451,7 @@ def main():
if module.check_mode:
module.exit_json(changed=True)
else:
(rc, _, error) = delete_maintenance(
(rc, dummy, error) = delete_maintenance(
auth_headers, url, statuspage, maintenance_id)
if rc == 0:
module.exit_json(

View File

@@ -40,10 +40,11 @@ options:
description:
- List of records to ensure they either exist or do not exist.
type: list
elements: str
type:
description:
- The type of DNS record to create.
choices: [ 'A', 'ALIAS', 'CNAME', 'MX', 'SPF', 'URL', 'TXT', 'NS', 'SRV', 'NAPTR', 'PTR', 'AAAA', 'SSHFP', 'HINFO', 'POOL' ]
choices: [ 'A', 'ALIAS', 'CNAME', 'MX', 'SPF', 'URL', 'TXT', 'NS', 'SRV', 'NAPTR', 'PTR', 'AAAA', 'SSHFP', 'HINFO', 'POOL', 'CAA' ]
type: str
ttl:
description:
@@ -167,9 +168,9 @@ def main():
account_api_token=dict(type='str', no_log=True),
domain=dict(type='str'),
record=dict(type='str'),
record_ids=dict(type='list'),
record_ids=dict(type='list', elements='str'),
type=dict(type='str', choices=['A', 'ALIAS', 'CNAME', 'MX', 'SPF', 'URL', 'TXT', 'NS', 'SRV', 'NAPTR', 'PTR', 'AAAA', 'SSHFP', 'HINFO',
'POOL']),
'POOL', 'CAA']),
ttl=dict(type='int', default=3600),
value=dict(type='str'),
priority=dict(type='int'),

View File

@@ -546,7 +546,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
account_key=dict(required=True),
account_key=dict(required=True, no_log=True),
account_secret=dict(required=True, no_log=True),
domain=dict(required=True),
sandbox=dict(default=False, type='bool'),

View File

@@ -398,7 +398,7 @@ def main():
address=dict(required=True),
name=dict(required=True),
stealth=dict(type='bool', default=False),
tsig_key=dict(),
tsig_key=dict(no_log=True),
tsig_key_alg=dict(choices=['HMAC-MD5', 'HMAC-SHA256'], default='HMAC-MD5'),
tsig_key_name=dict(required=True)
)

View File

@@ -28,51 +28,64 @@ options:
- Manage DNS record.
choices: ['present', 'absent']
default: 'present'
type: str
server:
description:
- Apply DNS modification on this server, specified by IPv4 or IPv6 address.
required: true
type: str
port:
description:
- Use this TCP port when connecting to C(server).
default: 53
type: int
key_name:
description:
- Use TSIG key name to authenticate against DNS C(server)
type: str
key_secret:
description:
- Use TSIG key secret, associated with C(key_name), to authenticate against C(server)
type: str
key_algorithm:
description:
- Specify key algorithm used by C(key_secret).
choices: ['HMAC-MD5.SIG-ALG.REG.INT', 'hmac-md5', 'hmac-sha1', 'hmac-sha224', 'hmac-sha256', 'hmac-sha384',
'hmac-sha512']
default: 'hmac-md5'
type: str
zone:
description:
- DNS record will be modified on this C(zone).
- When omitted DNS will be queried to attempt finding the correct zone.
- Starting with Ansible 2.7 this parameter is optional.
type: str
record:
description:
- Sets the DNS record to modify. When zone is omitted this has to be absolute (ending with a dot).
required: true
type: str
type:
description:
- Sets the record type.
default: 'A'
type: str
ttl:
description:
- Sets the record TTL.
default: 3600
type: int
value:
description:
- Sets the record value.
type: list
elements: str
protocol:
description:
- Sets the transport protocol (TCP or UDP). TCP is the recommended and a more robust option.
default: 'tcp'
choices: ['tcp', 'udp']
type: str
'''
EXAMPLES = '''
@@ -432,7 +445,7 @@ def main():
record=dict(required=True, type='str'),
type=dict(required=False, default='A', type='str'),
ttl=dict(required=False, default=3600, type='int'),
value=dict(required=False, default=None, type='list'),
value=dict(required=False, default=None, type='list', elements='str'),
protocol=dict(required=False, default='tcp', choices=['tcp', 'udp'], type='str')
),
supports_check_mode=True

View File

@@ -63,6 +63,7 @@ options:
description:
- Attach a list of OMAPI DHCP statements with host lease (without ending semicolon).
type: list
elements: str
default: []
ddns:
description:
@@ -282,7 +283,7 @@ def main():
hostname=dict(type='str', aliases=['name']),
ip=dict(type='str'),
ddns=dict(type='bool', default=False),
statements=dict(type='list', default=[]),
statements=dict(type='list', elements='str', default=[]),
),
supports_check_mode=False,
)

View File

@@ -73,7 +73,7 @@ def send_msg(module, token, msg, api, port):
def main():
module = AnsibleModule(
argument_spec=dict(
token=dict(type='str', required=True),
token=dict(type='str', required=True, no_log=True),
msg=dict(type='str', required=True),
api=dict(type='str', default="data.logentries.com"),
port=dict(type='int', default=80)),

View File

@@ -39,6 +39,7 @@ options:
- The email-address(es) the mail is being sent to.
- This is a list, which may contain address and phrase portions.
type: list
elements: str
default: root
aliases: [ recipients ]
cc:
@@ -46,11 +47,13 @@ options:
- The email-address(es) the mail is being copied to.
- This is a list, which may contain address and phrase portions.
type: list
elements: str
bcc:
description:
- The email-address(es) the mail is being 'blind' copied to.
- This is a list, which may contain address and phrase portions.
type: list
elements: str
subject:
description:
- The subject of the email being sent.
@@ -85,12 +88,14 @@ options:
- A list of pathnames of files to attach to the message.
- Attached files will have their content-type set to C(application/octet-stream).
type: list
elements: path
default: []
headers:
description:
- A list of headers which should be added to the message.
- Each individual header is specified as C(header=value) (see example below).
type: list
elements: str
default: []
charset:
description:
@@ -211,13 +216,13 @@ def main():
host=dict(type='str', default='localhost'),
port=dict(type='int', default=25),
sender=dict(type='str', default='root', aliases=['from']),
to=dict(type='list', default=['root'], aliases=['recipients']),
cc=dict(type='list', default=[]),
bcc=dict(type='list', default=[]),
to=dict(type='list', elements='str', default=['root'], aliases=['recipients']),
cc=dict(type='list', elements='str', default=[]),
bcc=dict(type='list', elements='str', default=[]),
subject=dict(type='str', required=True, aliases=['msg']),
body=dict(type='str'),
attach=dict(type='list', default=[]),
headers=dict(type='list', default=[]),
attach=dict(type='list', elements='path', default=[]),
headers=dict(type='list', elements='str', default=[]),
charset=dict(type='str', default='utf-8'),
subtype=dict(type='str', default='plain', choices=['html', 'plain']),
secure=dict(type='str', default='try', choices=['always', 'never', 'starttls', 'try']),

View File

@@ -32,6 +32,7 @@ options:
required: true
dest:
type: list
elements: int
description:
- Phone number(s) to send SMS message to
required: true
@@ -119,7 +120,7 @@ def main():
api_key=dict(required=True, no_log=True),
api_secret=dict(required=True, no_log=True),
src=dict(required=True, type='int'),
dest=dict(required=True, type='list'),
dest=dict(required=True, type='list', elements='int'),
msg=dict(required=True),
),
)

View File

@@ -45,11 +45,13 @@ options:
- and above any sections or actions present.
actions:
type: list
elements: dict
description:
- This array of objects will power the action links
- found at the bottom of the card.
sections:
type: list
elements: dict
description:
- Contains a list of sections to display in the card.
- For more information see https://dev.outlook.com/Connectors/reference.
@@ -264,8 +266,8 @@ def main():
color=dict(type='str'),
title=dict(type='str'),
text=dict(type='str'),
actions=dict(type='list'),
sections=dict(type='list')
actions=dict(type='list', elements='dict'),
sections=dict(type='list', elements='dict')
),
supports_check_mode=True
)

View File

@@ -89,6 +89,7 @@ options:
- 'danger'
attachments:
type: list
elements: dict
description:
- Define a list of attachments.
'''
@@ -215,7 +216,7 @@ def main():
link_names=dict(type='int', default=1, choices=[0, 1]),
validate_certs=dict(default=True, type='bool'),
color=dict(type='str', default='normal', choices=['normal', 'good', 'warning', 'danger']),
attachments=dict(type='list', required=False)
attachments=dict(type='list', elements='dict', required=False)
)
)

View File

@@ -44,6 +44,7 @@ options:
required: true
to_addresses:
type: list
elements: str
description:
- A list with one or more recipient email addresses.
required: true
@@ -58,14 +59,17 @@ options:
- Sendgrid API key to use instead of username/password.
cc:
type: list
elements: str
description:
- A list of email addresses to cc.
bcc:
type: list
elements: str
description:
- A list of email addresses to bcc.
attachments:
type: list
elements: path
description:
- A list of relative or explicit paths of files you want to attach (7MB limit as per SendGrid docs).
from_name:
@@ -209,16 +213,16 @@ def main():
username=dict(required=False),
password=dict(required=False, no_log=True),
api_key=dict(required=False, no_log=True),
bcc=dict(required=False, type='list'),
cc=dict(required=False, type='list'),
bcc=dict(required=False, type='list', elements='str'),
cc=dict(required=False, type='list', elements='str'),
headers=dict(required=False, type='dict'),
from_address=dict(required=True),
from_name=dict(required=False),
to_addresses=dict(required=True, type='list'),
to_addresses=dict(required=True, type='list', elements='str'),
subject=dict(required=True),
body=dict(required=True),
html_body=dict(required=False, default=False, type='bool'),
attachments=dict(required=False, type='list')
attachments=dict(required=False, type='list', elements='path')
),
supports_check_mode=True,
mutually_exclusive=[

View File

@@ -116,6 +116,7 @@ options:
default: 'normal'
attachments:
type: list
elements: dict
description:
- Define a list of attachments. This list mirrors the Slack JSON API.
- For more information, see U(https://api.slack.com/docs/attachments).
@@ -420,7 +421,7 @@ def main():
parse=dict(type='str', default=None, choices=['none', 'full']),
validate_certs=dict(default=True, type='bool'),
color=dict(type='str', default='normal'),
attachments=dict(type='list', required=False, default=None),
attachments=dict(type='list', elements='dict', required=False, default=None),
blocks=dict(type='list', elements='dict'),
message_id=dict(type='str', default=None),
),

View File

@@ -37,6 +37,7 @@ options:
required: true
to_numbers:
type: list
elements: str
description:
one or more phone numbers to send the text message to,
format +15551112222
@@ -143,7 +144,7 @@ def main():
auth_token=dict(required=True, no_log=True),
msg=dict(required=True),
from_number=dict(required=True),
to_numbers=dict(required=True, aliases=['to_number'], type='list'),
to_numbers=dict(required=True, aliases=['to_number'], type='list', elements='str'),
media_url=dict(default=None, required=False),
),
supports_check_mode=True

View File

@@ -45,6 +45,12 @@ options:
required: false
default: 'present'
type: str
path:
description:
- "A ':' separated list of paths to search for C(brew) executable."
default: '/usr/local/bin:/opt/homebrew/bin'
type: path
version_added: '2.1.0'
requirements: [ homebrew ]
'''
@@ -127,7 +133,7 @@ def add_tap(module, brew_path, tap, url=None):
def add_taps(module, brew_path, taps):
'''Adds one or more taps.'''
failed, unchanged, added, msg = False, 0, 0, ''
failed, changed, unchanged, added, msg = False, False, 0, 0, ''
for tap in taps:
(failed, changed, msg) = add_tap(module, brew_path, tap)
@@ -182,7 +188,7 @@ def remove_tap(module, brew_path, tap):
def remove_taps(module, brew_path, taps):
'''Removes one or more taps.'''
failed, unchanged, removed, msg = False, 0, 0, ''
failed, changed, unchanged, removed, msg = False, False, 0, 0, ''
for tap in taps:
(failed, changed, msg) = remove_tap(module, brew_path, tap)
@@ -211,14 +217,23 @@ def main():
name=dict(aliases=['tap'], type='list', required=True, elements='str'),
url=dict(default=None, required=False),
state=dict(default='present', choices=['present', 'absent']),
path=dict(
default="/usr/local/bin:/opt/homebrew/bin",
required=False,
type='path',
),
),
supports_check_mode=True,
)
path = module.params['path']
if path:
path = path.split(':')
brew_path = module.get_bin_path(
'brew',
required=True,
opt_dirs=['/usr/local/bin', '/opt/homebrew/bin']
opt_dirs=path,
)
taps = module.params['name']

View File

@@ -164,7 +164,7 @@ def get_package_state(names, pkg_spec, module):
if stdout:
# If the requested package name is just a stem, like "python", we may
# find multiple packages with that name.
pkg_spec[name]['installed_names'] = [installed_name for installed_name in stdout.splitlines()]
pkg_spec[name]['installed_names'] = stdout.splitlines()
module.debug("get_package_state(): installed_names = %s" % pkg_spec[name]['installed_names'])
pkg_spec[name]['installed_state'] = True
else:

View File

@@ -545,7 +545,7 @@ def main():
deprecated_aliases=[dict(name='ca_cert', version='3.0.0',
collection_name='community.general')]), # was Ansible 2.14
feed_client_cert=dict(aliases=['importer_ssl_client_cert']),
feed_client_key=dict(aliases=['importer_ssl_client_key']),
feed_client_key=dict(aliases=['importer_ssl_client_key'], no_log=True),
name=dict(required=True, aliases=['repo']),
proxy_host=dict(),
proxy_port=dict(),

View File

@@ -105,6 +105,7 @@ options:
entitlements from a pool (the pool must support this). Mutually exclusive with I(pool).
default: []
type: list
elements: raw
consumer_type:
description:
- The type of unit to register, defaults to system
@@ -153,6 +154,7 @@ options:
addons:
description: Syspurpose attribute addons
type: list
elements: str
sync:
description:
- When this option is true, then syspurpose attributes are synchronized with
@@ -787,7 +789,7 @@ def main():
'org_id': {},
'environment': {},
'pool': {'default': '^$'},
'pool_ids': {'default': [], 'type': 'list'},
'pool_ids': {'default': [], 'type': 'list', 'elements': 'raw'},
'consumer_type': {},
'consumer_name': {},
'consumer_id': {},
@@ -803,7 +805,7 @@ def main():
'role': {},
'usage': {},
'service_level_agreement': {},
'addons': {'type': 'list'},
'addons': {'type': 'list', 'elements': 'str'},
'sync': {'type': 'bool', 'default': False}
}
}
@@ -814,7 +816,7 @@ def main():
mutually_exclusive=[['activationkey', 'username'],
['activationkey', 'consumer_id'],
['activationkey', 'environment'],
['activationkey', 'autosubscribe'],
['activationkey', 'auto_attach'],
['pool', 'pool_ids']],
required_if=[['state', 'present', ['username', 'activationkey'], True]],
)

View File

@@ -19,18 +19,22 @@ options:
description:
- Hostname or ip address of the BMC.
required: true
type: str
port:
description:
- Remote RMCP port.
default: 623
type: int
user:
description:
- Username to use to connect to the BMC.
required: true
type: str
password:
description:
- Password to connect to the BMC.
required: true
type: str
bootdev:
description:
- Set boot device to use on next reboot
@@ -51,6 +55,7 @@ options:
- optical
- setup
- default
type: str
state:
description:
- Whether to ensure that boot devices is desired.
@@ -59,6 +64,7 @@ options:
- absent -- Request system turn on"
default: present
choices: [ present, absent ]
type: str
persistent:
description:
- If set, ask that system firmware uses this device beyond next boot.

View File

@@ -19,18 +19,22 @@ options:
description:
- Hostname or ip address of the BMC.
required: true
type: str
port:
description:
- Remote RMCP port.
default: 623
type: int
user:
description:
- Username to use to connect to the BMC.
required: true
type: str
password:
description:
- Password to connect to the BMC.
required: true
type: str
state:
description:
- Whether to ensure that the machine in desired state.
@@ -42,10 +46,12 @@ options:
- boot -- If system is off, then 'on', else 'reset'"
choices: ['on', 'off', shutdown, reset, boot]
required: true
type: str
timeout:
description:
- Maximum number of seconds before interrupt request.
default: 300
type: int
requirements:
- "python >= 2.6"
- pyghmi

View File

@@ -26,6 +26,7 @@ options:
description:
- List of commands to execute on OOB controller
type: list
elements: str
baseuri:
required: true
description:
@@ -134,7 +135,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
category=dict(required=True),
command=dict(required=True, type='list'),
command=dict(required=True, type='list', elements='str'),
baseuri=dict(required=True),
username=dict(required=True),
password=dict(required=True, no_log=True),

View File

@@ -29,6 +29,7 @@ options:
I(SetSystemAttributes) are mutually exclusive commands when C(category)
is I(Manager)
type: list
elements: str
baseuri:
required: true
description:
@@ -245,7 +246,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
category=dict(required=True),
command=dict(required=True, type='list'),
command=dict(required=True, type='list', elements='str'),
baseuri=dict(required=True),
username=dict(required=True),
password=dict(required=True, no_log=True),

View File

@@ -30,6 +30,7 @@ options:
- C(GetManagerAttributes) returns the list of dicts containing iDRAC,
LifecycleController and System attributes
type: list
elements: str
baseuri:
required: true
description:
@@ -171,7 +172,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
category=dict(required=True),
command=dict(required=True, type='list'),
command=dict(required=True, type='list', elements='str'),
baseuri=dict(required=True),
username=dict(required=True),
password=dict(required=True, no_log=True),

View File

@@ -28,6 +28,7 @@ options:
description:
- List of commands to execute on OOB controller
type: list
elements: str
baseuri:
required: true
description:
@@ -550,7 +551,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
category=dict(required=True),
command=dict(required=True, type='list'),
command=dict(required=True, type='list', elements='str'),
baseuri=dict(required=True),
username=dict(required=True),
password=dict(required=True, no_log=True),
@@ -572,7 +573,7 @@ def main():
type='dict',
options=dict(
username=dict(),
password=dict()
password=dict(no_log=True)
)
),
virtual_media=dict(

View File

@@ -27,6 +27,7 @@ options:
description:
- List of commands to execute on OOB controller
type: list
elements: str
baseuri:
required: true
description:
@@ -228,7 +229,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
category=dict(required=True),
command=dict(required=True, type='list'),
command=dict(required=True, type='list', elements='str'),
baseuri=dict(required=True),
username=dict(required=True),
password=dict(required=True, no_log=True),

View File

@@ -24,11 +24,13 @@ options:
- List of categories to execute on OOB controller
default: ['Systems']
type: list
elements: str
command:
required: false
description:
- List of commands to execute on OOB controller
type: list
elements: str
baseuri:
required: true
description:
@@ -296,8 +298,8 @@ def main():
category_list = []
module = AnsibleModule(
argument_spec=dict(
category=dict(type='list', default=['Systems']),
command=dict(type='list'),
category=dict(type='list', elements='str', default=['Systems']),
command=dict(type='list', elements='str'),
baseuri=dict(required=True),
username=dict(required=True),
password=dict(required=True, no_log=True),

Some files were not shown because too many files have changed in this diff Show More