mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-30 10:26:52 +00:00
Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f46cdc588 | ||
|
|
ea530784b8 | ||
|
|
dc2fa05b1f | ||
|
|
b2e51272ad | ||
|
|
afba9a11af | ||
|
|
c3ac479ae2 | ||
|
|
7e367244f7 | ||
|
|
331d2c7651 | ||
|
|
b35a262378 | ||
|
|
7d400663b6 | ||
|
|
0d0884b069 | ||
|
|
dd400e8c21 | ||
|
|
a60f9bc78b | ||
|
|
47714ecf79 | ||
|
|
d15ed4135b | ||
|
|
bd61228e40 | ||
|
|
26d7c28b33 | ||
|
|
2e533daffa | ||
|
|
6c50119eab | ||
|
|
bc3435b993 | ||
|
|
370f5d8082 | ||
|
|
e77c5413c9 | ||
|
|
800ee1bae0 | ||
|
|
8de8d21062 | ||
|
|
81e71b5034 | ||
|
|
44ce63ed85 | ||
|
|
a3c9c688b9 | ||
|
|
a332ed4429 | ||
|
|
91571f8bff | ||
|
|
43856eaa6f | ||
|
|
ae87b5479a | ||
|
|
42cd462780 | ||
|
|
d871378574 | ||
|
|
983b292399 | ||
|
|
6831aa5501 | ||
|
|
2d8a94a459 | ||
|
|
f721e76fdc | ||
|
|
3eadb9d637 | ||
|
|
033582b696 |
@@ -36,7 +36,7 @@ variables:
|
|||||||
resources:
|
resources:
|
||||||
containers:
|
containers:
|
||||||
- container: default
|
- 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
|
pool: Standard
|
||||||
|
|
||||||
@@ -140,16 +140,12 @@ stages:
|
|||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/{0}
|
testFormat: devel/{0}
|
||||||
targets:
|
targets:
|
||||||
- name: OS X 10.11
|
|
||||||
test: osx/10.11
|
|
||||||
- name: macOS 10.15
|
|
||||||
test: macos/10.15
|
|
||||||
- name: macOS 11.1
|
- name: macOS 11.1
|
||||||
test: macos/11.1
|
test: macos/11.1
|
||||||
- name: RHEL 7.8
|
- name: RHEL 7.9
|
||||||
test: rhel/7.8
|
test: rhel/7.9
|
||||||
- name: RHEL 8.2
|
- name: RHEL 8.3
|
||||||
test: rhel/8.2
|
test: rhel/8.3
|
||||||
- name: FreeBSD 11.4
|
- name: FreeBSD 11.4
|
||||||
test: freebsd/11.4
|
test: freebsd/11.4
|
||||||
- name: FreeBSD 12.2
|
- name: FreeBSD 12.2
|
||||||
@@ -166,8 +162,14 @@ stages:
|
|||||||
parameters:
|
parameters:
|
||||||
testFormat: 2.10/{0}
|
testFormat: 2.10/{0}
|
||||||
targets:
|
targets:
|
||||||
|
- name: OS X 10.11
|
||||||
|
test: osx/10.11
|
||||||
|
- name: macOS 10.15
|
||||||
|
test: macos/10.15
|
||||||
- name: macOS 11.1
|
- name: macOS 11.1
|
||||||
test: macos/11.1
|
test: macos/11.1
|
||||||
|
- name: RHEL 7.8
|
||||||
|
test: rhel/7.8
|
||||||
- name: RHEL 8.2
|
- name: RHEL 8.2
|
||||||
test: rhel/8.2
|
test: rhel/8.2
|
||||||
- name: FreeBSD 12.1
|
- name: FreeBSD 12.1
|
||||||
@@ -214,8 +216,6 @@ stages:
|
|||||||
test: opensuse15py2
|
test: opensuse15py2
|
||||||
- name: openSUSE 15 py3
|
- name: openSUSE 15 py3
|
||||||
test: opensuse15
|
test: opensuse15
|
||||||
- name: Ubuntu 16.04
|
|
||||||
test: ubuntu1604
|
|
||||||
- name: Ubuntu 18.04
|
- name: Ubuntu 18.04
|
||||||
test: ubuntu1804
|
test: ubuntu1804
|
||||||
- name: Ubuntu 20.04
|
- name: Ubuntu 20.04
|
||||||
@@ -238,6 +238,8 @@ stages:
|
|||||||
test: fedora32
|
test: fedora32
|
||||||
- name: openSUSE 15 py3
|
- name: openSUSE 15 py3
|
||||||
test: opensuse15
|
test: opensuse15
|
||||||
|
- name: Ubuntu 16.04
|
||||||
|
test: ubuntu1604
|
||||||
groups:
|
groups:
|
||||||
- 2
|
- 2
|
||||||
- 3
|
- 3
|
||||||
|
|||||||
2
.github/BOTMETA.yml
vendored
2
.github/BOTMETA.yml
vendored
@@ -419,6 +419,8 @@ files:
|
|||||||
maintainers: orgito
|
maintainers: orgito
|
||||||
$modules/monitoring/stackdriver.py:
|
$modules/monitoring/stackdriver.py:
|
||||||
maintainers: bwhaley
|
maintainers: bwhaley
|
||||||
|
$modules/monitoring/statsd.py:
|
||||||
|
maintainers: mamercad
|
||||||
$modules/monitoring/statusio_maintenance.py:
|
$modules/monitoring/statusio_maintenance.py:
|
||||||
maintainers: bhcopeland
|
maintainers: bhcopeland
|
||||||
$modules/monitoring/uptimerobot.py:
|
$modules/monitoring/uptimerobot.py:
|
||||||
|
|||||||
114
CHANGELOG.rst
114
CHANGELOG.rst
@@ -6,6 +6,120 @@ Community General Release Notes
|
|||||||
|
|
||||||
This changelog describes changes after version 1.0.0.
|
This changelog describes changes after version 1.0.0.
|
||||||
|
|
||||||
|
v2.1.1
|
||||||
|
======
|
||||||
|
|
||||||
|
Release Summary
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Extraordinary bugfix release to fix a fatal bug in ``proxmox_kvm``.
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
--------
|
||||||
|
|
||||||
|
- proxmox_kvm - fix undefined local variable ``status`` when the parameter ``state`` is either ``stopped``, ``started``, ``restarted`` or ``absent`` (https://github.com/ansible-collections/community.general/pull/1847).
|
||||||
|
|
||||||
|
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
|
v2.0.1
|
||||||
======
|
======
|
||||||
|
|
||||||
|
|||||||
@@ -1115,3 +1115,185 @@ releases:
|
|||||||
- dellemc-migration.yml
|
- dellemc-migration.yml
|
||||||
- no_log-fixes.yml
|
- no_log-fixes.yml
|
||||||
release_date: '2021-02-09'
|
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'
|
||||||
|
2.1.1:
|
||||||
|
changes:
|
||||||
|
bugfixes:
|
||||||
|
- proxmox_kvm - fix undefined local variable ``status`` when the parameter ``state``
|
||||||
|
is either ``stopped``, ``started``, ``restarted`` or ``absent`` (https://github.com/ansible-collections/community.general/pull/1847).
|
||||||
|
release_summary: Extraordinary bugfix release to fix a fatal bug in ``proxmox_kvm``.
|
||||||
|
fragments:
|
||||||
|
- 1847-proxmox-kvm-fix-status.yml
|
||||||
|
- 2.1.0.yml
|
||||||
|
release_date: '2021-02-17'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace: community
|
namespace: community
|
||||||
name: general
|
name: general
|
||||||
version: 2.0.1
|
version: 2.1.1
|
||||||
readme: README.md
|
readme: README.md
|
||||||
authors:
|
authors:
|
||||||
- Ansible (https://github.com/ansible)
|
- Ansible (https://github.com/ansible)
|
||||||
|
|||||||
@@ -173,8 +173,7 @@ class CallbackModule(CallbackBase):
|
|||||||
# Displays info about playbook being started by a person on an
|
# Displays info about playbook being started by a person on an
|
||||||
# inventory, as well as Tags, Skip Tags and Limits
|
# inventory, as well as Tags, Skip Tags and Limits
|
||||||
if not self.printed_playbook:
|
if not self.printed_playbook:
|
||||||
self.playbook_name, _ = os.path.splitext(
|
self.playbook_name, dummy = os.path.splitext(os.path.basename(self.play.playbook.filename))
|
||||||
os.path.basename(self.play.playbook.filename))
|
|
||||||
host_list = self.play.playbook.inventory.host_list
|
host_list = self.play.playbook.inventory.host_list
|
||||||
inventory = os.path.basename(os.path.realpath(host_list))
|
inventory = os.path.basename(os.path.realpath(host_list))
|
||||||
self.send_msg("%s: Playbook initiated by %s against %s" %
|
self.send_msg("%s: Playbook initiated by %s against %s" %
|
||||||
|
|||||||
@@ -41,7 +41,16 @@ import difflib
|
|||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible.plugins.callback import CallbackBase
|
from ansible.plugins.callback import CallbackBase
|
||||||
from ansible.module_utils._text import to_text
|
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
|
DONT_COLORIZE = False
|
||||||
COLORS = {
|
COLORS = {
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class Connection(ConnectionBase):
|
|||||||
write_fds = []
|
write_fds = []
|
||||||
while len(read_fds) > 0 or len(write_fds) > 0:
|
while len(read_fds) > 0 or len(write_fds) > 0:
|
||||||
try:
|
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:
|
except select.error as e:
|
||||||
if e.args[0] == errno.EINTR:
|
if e.args[0] == errno.EINTR:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -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
|
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
|
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.
|
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:
|
api_user_key_pass_phrase:
|
||||||
description:
|
description:
|
||||||
- Passphrase used by the key referenced in C(api_user_key_file), if it is encrypted. If not set, then
|
- Passphrase used by the key referenced in C(api_user_key_file), if it is encrypted. If not set, then
|
||||||
|
|||||||
@@ -20,4 +20,5 @@ class ModuleDocFragment(object):
|
|||||||
identify an instance of the resource. By default, all the attributes of a resource except
|
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.
|
I(freeform_tags) are used to uniquely identify a resource.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -226,10 +226,8 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
|
|||||||
if config == 'rootfs' or config.startswith(('virtio', 'sata', 'ide', 'scsi')):
|
if config == 'rootfs' or config.startswith(('virtio', 'sata', 'ide', 'scsi')):
|
||||||
value = ('disk_image=' + value)
|
value = ('disk_image=' + value)
|
||||||
|
|
||||||
if isinstance(value, int) or ',' not in value:
|
if not (isinstance(value, int) or ',' not in value):
|
||||||
value = value
|
# split off strings with commas to a dict
|
||||||
# split off strings with commas to a dict
|
|
||||||
else:
|
|
||||||
# skip over any keys that cannot be processed
|
# skip over any keys that cannot be processed
|
||||||
try:
|
try:
|
||||||
value = dict(key.split("=") for key in value.split(","))
|
value = dict(key.split("=") for key in value.split(","))
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||||||
yield host not in v
|
yield host not in v
|
||||||
yield True
|
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):
|
def verify_file(self, path):
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class CloudRetry(object):
|
|||||||
try:
|
try:
|
||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
except Exception as e:
|
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)
|
response_code = cls.status_code_from_exception(e)
|
||||||
if cls.found(response_code, catch_extra_error_codes):
|
if cls.found(response_code, catch_extra_error_codes):
|
||||||
msg = "{0}: Retrying in {1} seconds...".format(str(e), delay)
|
msg = "{0}: Retrying in {1} seconds...".format(str(e), delay)
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ class CmdMixin(object):
|
|||||||
|
|
||||||
def _calculate_args(self, extra_params=None, params=None):
|
def _calculate_args(self, extra_params=None, params=None):
|
||||||
def add_arg_formatted_param(_cmd_args, arg_format, _value):
|
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
|
return _cmd_args + args
|
||||||
|
|
||||||
def find_format(_param):
|
def find_format(_param):
|
||||||
|
|||||||
@@ -260,13 +260,10 @@ class WapiModule(WapiBase):
|
|||||||
else:
|
else:
|
||||||
proposed_object[key] = self.module.params[key]
|
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'\
|
if not proposed_object.get('configure_for_dns') and proposed_object.get('view') == 'default'\
|
||||||
and ib_obj_type == NIOS_HOST_RECORD:
|
and ib_obj_type == NIOS_HOST_RECORD:
|
||||||
del proposed_object['view']
|
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 ib_obj_ref:
|
||||||
if len(ib_obj_ref) > 1:
|
if len(ib_obj_ref) > 1:
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ def get_common_arg_spec(supports_create=False, supports_wait=False):
|
|||||||
config_profile_name=dict(type="str", default="DEFAULT"),
|
config_profile_name=dict(type="str", default="DEFAULT"),
|
||||||
api_user=dict(type="str"),
|
api_user=dict(type="str"),
|
||||||
api_user_fingerprint=dict(type="str", no_log=True),
|
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),
|
api_user_key_pass_phrase=dict(type="str", no_log=True),
|
||||||
auth_type=dict(
|
auth_type=dict(
|
||||||
type="str",
|
type="str",
|
||||||
@@ -104,7 +104,7 @@ def get_common_arg_spec(supports_create=False, supports_wait=False):
|
|||||||
|
|
||||||
if supports_create:
|
if supports_create:
|
||||||
common_args.update(
|
common_args.update(
|
||||||
key_by=dict(type="list"),
|
key_by=dict(type="list", elements="str"),
|
||||||
force_create=dict(type="bool", default=False),
|
force_create=dict(type="bool", default=False),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2632,7 +2632,7 @@ class RedfishUtils(object):
|
|||||||
if response['ret'] is False:
|
if response['ret'] is False:
|
||||||
return response
|
return response
|
||||||
data = response['data']
|
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_uri = uri
|
||||||
target_ethernet_current_setting = data
|
target_ethernet_current_setting = data
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ options:
|
|||||||
- A list of recipient email ids to notify the alert.
|
- A list of recipient email ids to notify the alert.
|
||||||
This is required for state 'present'
|
This is required for state 'present'
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
metric:
|
metric:
|
||||||
description:
|
description:
|
||||||
- The metric on which to measure the condition that will trigger the alert.
|
- The metric on which to measure the condition that will trigger the alert.
|
||||||
@@ -220,7 +221,7 @@ class ClcAlertPolicy:
|
|||||||
name=dict(),
|
name=dict(),
|
||||||
id=dict(),
|
id=dict(),
|
||||||
alias=dict(required=True),
|
alias=dict(required=True),
|
||||||
alert_recipients=dict(type='list'),
|
alert_recipients=dict(type='list', elements='str'),
|
||||||
metric=dict(
|
metric=dict(
|
||||||
choices=[
|
choices=[
|
||||||
'cpu',
|
'cpu',
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ options:
|
|||||||
- A list of server Ids to deploy the blue print package.
|
- A list of server Ids to deploy the blue print package.
|
||||||
type: list
|
type: list
|
||||||
required: True
|
required: True
|
||||||
|
elements: str
|
||||||
package_id:
|
package_id:
|
||||||
description:
|
description:
|
||||||
- The package id of the blue print.
|
- The package id of the blue print.
|
||||||
@@ -164,7 +165,7 @@ class ClcBlueprintPackage:
|
|||||||
:return: the package dictionary object
|
:return: the package dictionary object
|
||||||
"""
|
"""
|
||||||
argument_spec = dict(
|
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_id=dict(required=True),
|
||||||
package_params=dict(type='dict', default={}),
|
package_params=dict(type='dict', default={}),
|
||||||
wait=dict(default=True), # @FIXME should be bool?
|
wait=dict(default=True), # @FIXME should be bool?
|
||||||
|
|||||||
@@ -29,17 +29,20 @@ options:
|
|||||||
- The list of source addresses for traffic on the originating firewall.
|
- The list of source addresses for traffic on the originating firewall.
|
||||||
This is required when state is 'present'
|
This is required when state is 'present'
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
destination:
|
destination:
|
||||||
description:
|
description:
|
||||||
- The list of destination addresses for traffic on the terminating firewall.
|
- The list of destination addresses for traffic on the terminating firewall.
|
||||||
This is required when state is 'present'
|
This is required when state is 'present'
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
ports:
|
ports:
|
||||||
description:
|
description:
|
||||||
- The list of ports associated with the policy.
|
- The list of ports associated with the policy.
|
||||||
TCP and UDP can take in single ports or port ranges.
|
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'])."
|
- "Example: C(['any', 'icmp', 'TCP/123', 'UDP/123', 'TCP/123-456', 'UDP/123-456'])."
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
firewall_policy_id:
|
firewall_policy_id:
|
||||||
description:
|
description:
|
||||||
- Id of the firewall policy. This is required to update or delete an existing firewall policy
|
- 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),
|
source_account_alias=dict(required=True),
|
||||||
destination_account_alias=dict(),
|
destination_account_alias=dict(),
|
||||||
firewall_policy_id=dict(),
|
firewall_policy_id=dict(),
|
||||||
ports=dict(type='list'),
|
ports=dict(type='list', elements='str'),
|
||||||
source=dict(type='list'),
|
source=dict(type='list', elements='str'),
|
||||||
destination=dict(type='list'),
|
destination=dict(type='list', elements='str'),
|
||||||
wait=dict(default=True), # @FIXME type=bool
|
wait=dict(default=True), # @FIXME type=bool
|
||||||
state=dict(default='present', choices=['present', 'absent']),
|
state=dict(default='present', choices=['present', 'absent']),
|
||||||
enabled=dict(default=True, choices=[True, False])
|
enabled=dict(default=True, choices=[True, False])
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ options:
|
|||||||
- A list of nodes that needs to be added to the load balancer pool
|
- A list of nodes that needs to be added to the load balancer pool
|
||||||
type: list
|
type: list
|
||||||
default: []
|
default: []
|
||||||
|
elements: dict
|
||||||
status:
|
status:
|
||||||
description:
|
description:
|
||||||
- The status of the loadbalancer
|
- The status of the loadbalancer
|
||||||
@@ -869,7 +870,7 @@ class ClcLoadBalancer:
|
|||||||
port=dict(choices=[80, 443]),
|
port=dict(choices=[80, 443]),
|
||||||
method=dict(choices=['leastConnection', 'roundRobin']),
|
method=dict(choices=['leastConnection', 'roundRobin']),
|
||||||
persistence=dict(choices=['standard', 'sticky']),
|
persistence=dict(choices=['standard', 'sticky']),
|
||||||
nodes=dict(type='list', default=[]),
|
nodes=dict(type='list', default=[], elements='dict'),
|
||||||
status=dict(default='enabled', choices=['enabled', 'disabled']),
|
status=dict(default='enabled', choices=['enabled', 'disabled']),
|
||||||
state=dict(
|
state=dict(
|
||||||
default='present',
|
default='present',
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ options:
|
|||||||
- A list of server Ids to modify.
|
- A list of server Ids to modify.
|
||||||
type: list
|
type: list
|
||||||
required: True
|
required: True
|
||||||
|
elements: str
|
||||||
cpu:
|
cpu:
|
||||||
description:
|
description:
|
||||||
- How many CPUs to update on the server
|
- How many CPUs to update on the server
|
||||||
@@ -396,7 +397,7 @@ class ClcModifyServer:
|
|||||||
:return: argument spec dictionary
|
:return: argument spec dictionary
|
||||||
"""
|
"""
|
||||||
argument_spec = dict(
|
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']),
|
state=dict(default='present', choices=['present', 'absent']),
|
||||||
cpu=dict(),
|
cpu=dict(),
|
||||||
memory=dict(),
|
memory=dict(),
|
||||||
|
|||||||
@@ -23,11 +23,13 @@ options:
|
|||||||
description:
|
description:
|
||||||
- A list of ports to expose. This is required when state is 'present'
|
- A list of ports to expose. This is required when state is 'present'
|
||||||
type: list
|
type: list
|
||||||
|
elements: int
|
||||||
server_ids:
|
server_ids:
|
||||||
description:
|
description:
|
||||||
- A list of servers to create public ips on.
|
- A list of servers to create public ips on.
|
||||||
type: list
|
type: list
|
||||||
required: True
|
required: True
|
||||||
|
elements: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Determine whether to create or delete public IPs. If present module will not create a second public ip if one
|
- 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
|
:return: argument spec dictionary
|
||||||
"""
|
"""
|
||||||
argument_spec = dict(
|
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']),
|
protocol=dict(default='TCP', choices=['TCP', 'UDP', 'ICMP']),
|
||||||
ports=dict(type='list'),
|
ports=dict(type='list', elements='int'),
|
||||||
wait=dict(type='bool', default=True),
|
wait=dict(type='bool', default=True),
|
||||||
state=dict(default='present', choices=['present', 'absent']),
|
state=dict(default='present', choices=['present', 'absent']),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- The list of additional disks for the server
|
- The list of additional disks for the server
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
default: []
|
default: []
|
||||||
add_public_ip:
|
add_public_ip:
|
||||||
description:
|
description:
|
||||||
@@ -66,6 +67,7 @@ options:
|
|||||||
- The list of custom fields to set on the server.
|
- The list of custom fields to set on the server.
|
||||||
type: list
|
type: list
|
||||||
default: []
|
default: []
|
||||||
|
elements: dict
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- The description to set for the server.
|
- The description to set for the server.
|
||||||
@@ -111,6 +113,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- The list of blue print packages to run on the server after its created.
|
- The list of blue print packages to run on the server after its created.
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
default: []
|
default: []
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
@@ -130,6 +133,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- A list of ports to allow on the firewall to the servers public ip, if add_public_ip is set to True.
|
- A list of ports to allow on the firewall to the servers public ip, if add_public_ip is set to True.
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
default: []
|
default: []
|
||||||
secondary_dns:
|
secondary_dns:
|
||||||
description:
|
description:
|
||||||
@@ -141,6 +145,7 @@ options:
|
|||||||
A list of server Ids to insure are started, stopped, or absent.
|
A list of server Ids to insure are started, stopped, or absent.
|
||||||
type: list
|
type: list
|
||||||
default: []
|
default: []
|
||||||
|
elements: str
|
||||||
source_server_password:
|
source_server_password:
|
||||||
description:
|
description:
|
||||||
- The password for the source server if a clone is specified.
|
- 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']),
|
type=dict(default='standard', choices=['standard', 'hyperscale', 'bareMetal']),
|
||||||
primary_dns=dict(default=None),
|
primary_dns=dict(default=None),
|
||||||
secondary_dns=dict(default=None),
|
secondary_dns=dict(default=None),
|
||||||
additional_disks=dict(type='list', default=[]),
|
additional_disks=dict(type='list', default=[], elements='dict'),
|
||||||
custom_fields=dict(type='list', default=[]),
|
custom_fields=dict(type='list', default=[], elements='dict'),
|
||||||
ttl=dict(default=None),
|
ttl=dict(default=None),
|
||||||
managed_os=dict(type='bool', default=False),
|
managed_os=dict(type='bool', default=False),
|
||||||
description=dict(default=None),
|
description=dict(default=None),
|
||||||
@@ -586,7 +591,7 @@ class ClcServer:
|
|||||||
anti_affinity_policy_name=dict(default=None),
|
anti_affinity_policy_name=dict(default=None),
|
||||||
alert_policy_id=dict(default=None),
|
alert_policy_id=dict(default=None),
|
||||||
alert_policy_name=dict(default=None),
|
alert_policy_name=dict(default=None),
|
||||||
packages=dict(type='list', default=[]),
|
packages=dict(type='list', default=[], elements='dict'),
|
||||||
state=dict(
|
state=dict(
|
||||||
default='present',
|
default='present',
|
||||||
choices=[
|
choices=[
|
||||||
@@ -597,7 +602,7 @@ class ClcServer:
|
|||||||
count=dict(type='int', default=1),
|
count=dict(type='int', default=1),
|
||||||
exact_count=dict(type='int', default=None),
|
exact_count=dict(type='int', default=None),
|
||||||
count_group=dict(),
|
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),
|
add_public_ip=dict(type='bool', default=False),
|
||||||
public_ip_protocol=dict(
|
public_ip_protocol=dict(
|
||||||
default='TCP',
|
default='TCP',
|
||||||
@@ -605,7 +610,7 @@ class ClcServer:
|
|||||||
'TCP',
|
'TCP',
|
||||||
'UDP',
|
'UDP',
|
||||||
'ICMP']),
|
'ICMP']),
|
||||||
public_ip_ports=dict(type='list', default=[]),
|
public_ip_ports=dict(type='list', default=[], elements='dict'),
|
||||||
configuration_id=dict(default=None),
|
configuration_id=dict(default=None),
|
||||||
os_type=dict(default=None,
|
os_type=dict(default=None,
|
||||||
choices=[
|
choices=[
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ options:
|
|||||||
- The list of CLC server Ids.
|
- The list of CLC server Ids.
|
||||||
type: list
|
type: list
|
||||||
required: True
|
required: True
|
||||||
|
elements: str
|
||||||
expiration_days:
|
expiration_days:
|
||||||
description:
|
description:
|
||||||
- The number of days to keep the server snapshot before it expires.
|
- The number of days to keep the server snapshot before it expires.
|
||||||
@@ -330,7 +331,7 @@ class ClcSnapshot:
|
|||||||
:return: the package dictionary object
|
:return: the package dictionary object
|
||||||
"""
|
"""
|
||||||
argument_spec = dict(
|
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'),
|
expiration_days=dict(default=7, type='int'),
|
||||||
wait=dict(default=True),
|
wait=dict(default=True),
|
||||||
state=dict(
|
state=dict(
|
||||||
|
|||||||
@@ -730,7 +730,7 @@ class LxcContainerManagement(object):
|
|||||||
for option_line in container_config:
|
for option_line in container_config:
|
||||||
# Look for key in config
|
# Look for key in config
|
||||||
if keyre.match(option_line):
|
if keyre.match(option_line):
|
||||||
_, _value = option_line.split('=', 1)
|
dummy, _value = option_line.split('=', 1)
|
||||||
config_value = ' '.join(_value.split())
|
config_value = ' '.join(_value.split())
|
||||||
line_index = container_config.index(option_line)
|
line_index = container_config.index(option_line)
|
||||||
# If the sanitized values don't match replace them
|
# If the sanitized values don't match replace them
|
||||||
@@ -953,7 +953,7 @@ class LxcContainerManagement(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.container = self.get_container_bind()
|
self.container = self.get_container_bind()
|
||||||
for _ in xrange(timeout):
|
for dummy in xrange(timeout):
|
||||||
if self._get_state() != 'running':
|
if self._get_state() != 'running':
|
||||||
self.container.start()
|
self.container.start()
|
||||||
self.state_change = True
|
self.state_change = True
|
||||||
@@ -1006,7 +1006,7 @@ class LxcContainerManagement(object):
|
|||||||
:type timeout: ``int``
|
: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):
|
if not self._container_exists(container_name=self.container_name, lxc_path=self.lxc_path):
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Profile to be used by the container
|
- Profile to be used by the container
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
devices:
|
devices:
|
||||||
description:
|
description:
|
||||||
- 'The devices for the container
|
- 'The devices for the container
|
||||||
@@ -132,14 +133,14 @@ options:
|
|||||||
- If not specified, it defaults to C(${HOME}/.config/lxc/client.key).
|
- If not specified, it defaults to C(${HOME}/.config/lxc/client.key).
|
||||||
required: false
|
required: false
|
||||||
aliases: [ key_file ]
|
aliases: [ key_file ]
|
||||||
type: str
|
type: path
|
||||||
client_cert:
|
client_cert:
|
||||||
description:
|
description:
|
||||||
- The client certificate file path.
|
- The client certificate file path.
|
||||||
- If not specified, it defaults to C(${HOME}/.config/lxc/client.crt).
|
- If not specified, it defaults to C(${HOME}/.config/lxc/client.crt).
|
||||||
required: false
|
required: false
|
||||||
aliases: [ cert_file ]
|
aliases: [ cert_file ]
|
||||||
type: str
|
type: path
|
||||||
trust_password:
|
trust_password:
|
||||||
description:
|
description:
|
||||||
- The client trusted password.
|
- The client trusted password.
|
||||||
@@ -658,6 +659,7 @@ def main():
|
|||||||
),
|
),
|
||||||
profiles=dict(
|
profiles=dict(
|
||||||
type='list',
|
type='list',
|
||||||
|
elements='str',
|
||||||
),
|
),
|
||||||
source=dict(
|
source=dict(
|
||||||
type='dict',
|
type='dict',
|
||||||
@@ -690,11 +692,11 @@ def main():
|
|||||||
default='unix:/var/snap/lxd/common/lxd/unix.socket'
|
default='unix:/var/snap/lxd/common/lxd/unix.socket'
|
||||||
),
|
),
|
||||||
client_key=dict(
|
client_key=dict(
|
||||||
type='str',
|
type='path',
|
||||||
aliases=['key_file']
|
aliases=['key_file']
|
||||||
),
|
),
|
||||||
client_cert=dict(
|
client_cert=dict(
|
||||||
type='str',
|
type='path',
|
||||||
aliases=['cert_file']
|
aliases=['cert_file']
|
||||||
),
|
),
|
||||||
trust_password=dict(type='str', no_log=True)
|
trust_password=dict(type='str', no_log=True)
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright: (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com>
|
# 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)
|
# 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
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: lxd_profile
|
module: lxd_profile
|
||||||
@@ -52,6 +52,14 @@ options:
|
|||||||
See U(https://github.com/lxc/lxd/blob/master/doc/rest-api.md#post-11)
|
See U(https://github.com/lxc/lxd/blob/master/doc/rest-api.md#post-11)
|
||||||
required: false
|
required: false
|
||||||
type: str
|
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:
|
state:
|
||||||
choices:
|
choices:
|
||||||
- present
|
- present
|
||||||
@@ -79,14 +87,14 @@ options:
|
|||||||
- If not specified, it defaults to C($HOME/.config/lxc/client.key).
|
- If not specified, it defaults to C($HOME/.config/lxc/client.key).
|
||||||
required: false
|
required: false
|
||||||
aliases: [ key_file ]
|
aliases: [ key_file ]
|
||||||
type: str
|
type: path
|
||||||
client_cert:
|
client_cert:
|
||||||
description:
|
description:
|
||||||
- The client certificate file path.
|
- The client certificate file path.
|
||||||
- If not specified, it defaults to C($HOME/.config/lxc/client.crt).
|
- If not specified, it defaults to C($HOME/.config/lxc/client.crt).
|
||||||
required: false
|
required: false
|
||||||
aliases: [ cert_file ]
|
aliases: [ cert_file ]
|
||||||
type: str
|
type: path
|
||||||
trust_password:
|
trust_password:
|
||||||
description:
|
description:
|
||||||
- The client trusted password.
|
- The client trusted password.
|
||||||
@@ -142,6 +150,23 @@ EXAMPLES = '''
|
|||||||
parent: br0
|
parent: br0
|
||||||
type: nic
|
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
|
# An example for deleting a profile
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
connection: local
|
connection: local
|
||||||
@@ -181,7 +206,6 @@ actions:
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.lxd import LXDClient, LXDClientException
|
from ansible_collections.community.general.plugins.module_utils.lxd import LXDClient, LXDClientException
|
||||||
|
|
||||||
@@ -266,7 +290,7 @@ class LXDProfileManagement(object):
|
|||||||
self._create_profile()
|
self._create_profile()
|
||||||
else:
|
else:
|
||||||
self.module.fail_json(
|
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)
|
changed=False)
|
||||||
else:
|
else:
|
||||||
if self.new_name is not None and self.new_name != self.name:
|
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')
|
self._needs_to_change_profile_config('devices')
|
||||||
)
|
)
|
||||||
|
|
||||||
def _apply_profile_configs(self):
|
def _merge_dicts(self, source, destination):
|
||||||
config = self.old_profile_json.copy()
|
"""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():
|
for k, v in self.config.items():
|
||||||
config[k] = v
|
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.client.do('PUT', '/1.0/profiles/{0}'.format(self.name), config)
|
||||||
self.actions.append('apply_profile_configs')
|
self.actions.append('apply_profile_configs')
|
||||||
|
|
||||||
@@ -371,6 +481,10 @@ def main():
|
|||||||
devices=dict(
|
devices=dict(
|
||||||
type='dict',
|
type='dict',
|
||||||
),
|
),
|
||||||
|
merge_profile=dict(
|
||||||
|
type='bool',
|
||||||
|
default=False
|
||||||
|
),
|
||||||
state=dict(
|
state=dict(
|
||||||
choices=PROFILES_STATES,
|
choices=PROFILES_STATES,
|
||||||
default='present'
|
default='present'
|
||||||
@@ -384,11 +498,11 @@ def main():
|
|||||||
default='unix:/var/snap/lxd/common/lxd/unix.socket'
|
default='unix:/var/snap/lxd/common/lxd/unix.socket'
|
||||||
),
|
),
|
||||||
client_key=dict(
|
client_key=dict(
|
||||||
type='str',
|
type='path',
|
||||||
aliases=['key_file']
|
aliases=['key_file']
|
||||||
),
|
),
|
||||||
client_cert=dict(
|
client_cert=dict(
|
||||||
type='str',
|
type='path',
|
||||||
aliases=['cert_file']
|
aliases=['cert_file']
|
||||||
),
|
),
|
||||||
trust_password=dict(type='str', no_log=True)
|
trust_password=dict(type='str', no_log=True)
|
||||||
|
|||||||
@@ -345,7 +345,6 @@ EXAMPLES = r'''
|
|||||||
state: absent
|
state: absent
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import os
|
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
@@ -356,7 +355,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_PROXMOXER = False
|
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
|
from ansible.module_utils._text import to_native
|
||||||
|
|
||||||
|
|
||||||
@@ -481,7 +480,7 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
api_host=dict(required=True),
|
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_id=dict(no_log=True),
|
||||||
api_token_secret=dict(no_log=True),
|
api_token_secret=dict(no_log=True),
|
||||||
api_user=dict(required=True),
|
api_user=dict(required=True),
|
||||||
@@ -514,7 +513,10 @@ def main():
|
|||||||
description=dict(type='str'),
|
description=dict(type='str'),
|
||||||
hookscript=dict(type='str'),
|
hookscript=dict(type='str'),
|
||||||
proxmox_default_behavior=dict(type='str', choices=['compatibility', 'no_defaults']),
|
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:
|
if not HAS_PROXMOXER:
|
||||||
@@ -561,13 +563,7 @@ def main():
|
|||||||
module.params[param] = value
|
module.params[param] = value
|
||||||
|
|
||||||
auth_args = {'user': api_user}
|
auth_args = {'user': api_user}
|
||||||
if not (api_token_id and api_token_secret):
|
if not api_token_id:
|
||||||
# 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
|
auth_args['password'] = api_password
|
||||||
else:
|
else:
|
||||||
auth_args['token_name'] = api_token_id
|
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 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']:
|
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]))
|
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):
|
elif not node_check(proxmox, node):
|
||||||
module.fail_json(msg="node '%s' not exists in cluster" % node)
|
module.fail_json(msg="node '%s' not exists in cluster" % node)
|
||||||
elif not content_check(proxmox, node, module.params['ostemplate'], template_store):
|
elif not content_check(proxmox, node, module.params['ostemplate'], template_store):
|
||||||
@@ -622,7 +616,7 @@ def main():
|
|||||||
searchdomain=module.params['searchdomain'],
|
searchdomain=module.params['searchdomain'],
|
||||||
force=int(module.params['force']),
|
force=int(module.params['force']),
|
||||||
pubkey=module.params['pubkey'],
|
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']),
|
unprivileged=int(module.params['unprivileged']),
|
||||||
description=module.params['description'],
|
description=module.params['description'],
|
||||||
hookscript=module.params['hookscript'])
|
hookscript=module.params['hookscript'])
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Pass arbitrary arguments to kvm.
|
- Pass arbitrary arguments to kvm.
|
||||||
- This option is for experts only!
|
- 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
|
type: str
|
||||||
autostart:
|
autostart:
|
||||||
description:
|
description:
|
||||||
@@ -730,46 +733,23 @@ EXAMPLES = '''
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
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:
|
vmid:
|
||||||
description: The VM vmid.
|
description: The VM vmid.
|
||||||
returned: success
|
returned: success
|
||||||
type: int
|
type: int
|
||||||
sample: 115
|
sample: 115
|
||||||
status:
|
status:
|
||||||
description:
|
description: The current virtual machine status.
|
||||||
- The current virtual machine status.
|
returned: success, not clone, not absent, not update
|
||||||
- Returned only when C(state=current)
|
type: str
|
||||||
returned: success
|
sample: running
|
||||||
type: dict
|
msg:
|
||||||
sample: '{
|
description: A short message
|
||||||
"changed": false,
|
returned: always
|
||||||
"msg": "VM kropta with vmid = 110 is running",
|
type: str
|
||||||
"status": "running"
|
sample: "VM kropta with vmid = 110 is running"
|
||||||
}'
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
@@ -782,7 +762,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_PROXMOXER = False
|
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
|
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:
|
if searchdomains:
|
||||||
kwargs['searchdomain'] = ' '.join(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 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
|
kwargs['args'] = vm_args
|
||||||
elif module.params['api_user'] == "root@pam" and module.params['args'] is not None:
|
elif module.params['api_user'] == "root@pam" and module.params['args'] is not None:
|
||||||
kwargs['args'] = module.params['args']
|
kwargs['args'] = module.params['args']
|
||||||
@@ -1015,7 +995,7 @@ def main():
|
|||||||
agent=dict(type='bool'),
|
agent=dict(type='bool'),
|
||||||
args=dict(type='str'),
|
args=dict(type='str'),
|
||||||
api_host=dict(required=True),
|
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_id=dict(no_log=True),
|
||||||
api_token_secret=dict(no_log=True),
|
api_token_secret=dict(no_log=True),
|
||||||
api_user=dict(required=True),
|
api_user=dict(required=True),
|
||||||
@@ -1028,12 +1008,12 @@ def main():
|
|||||||
cipassword=dict(type='str', no_log=True),
|
cipassword=dict(type='str', no_log=True),
|
||||||
citype=dict(type='str', choices=['nocloud', 'configdrive2']),
|
citype=dict(type='str', choices=['nocloud', 'configdrive2']),
|
||||||
ciuser=dict(type='str'),
|
ciuser=dict(type='str'),
|
||||||
clone=dict(type='str', default=None),
|
clone=dict(type='str'),
|
||||||
cores=dict(type='int'),
|
cores=dict(type='int'),
|
||||||
cpu=dict(type='str'),
|
cpu=dict(type='str'),
|
||||||
cpulimit=dict(type='int'),
|
cpulimit=dict(type='int'),
|
||||||
cpuunits=dict(type='int'),
|
cpuunits=dict(type='int'),
|
||||||
delete=dict(type='str', default=None),
|
delete=dict(type='str'),
|
||||||
description=dict(type='str'),
|
description=dict(type='str'),
|
||||||
digest=dict(type='str'),
|
digest=dict(type='str'),
|
||||||
force=dict(type='bool'),
|
force=dict(type='bool'),
|
||||||
@@ -1056,7 +1036,7 @@ def main():
|
|||||||
name=dict(type='str'),
|
name=dict(type='str'),
|
||||||
nameservers=dict(type='list', elements='str'),
|
nameservers=dict(type='list', elements='str'),
|
||||||
net=dict(type='dict'),
|
net=dict(type='dict'),
|
||||||
newid=dict(type='int', default=None),
|
newid=dict(type='int'),
|
||||||
node=dict(),
|
node=dict(),
|
||||||
numa=dict(type='dict'),
|
numa=dict(type='dict'),
|
||||||
numa_enabled=dict(type='bool'),
|
numa_enabled=dict(type='bool'),
|
||||||
@@ -1092,13 +1072,14 @@ def main():
|
|||||||
vcpus=dict(type='int'),
|
vcpus=dict(type='int'),
|
||||||
vga=dict(choices=['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']),
|
vga=dict(choices=['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4']),
|
||||||
virtio=dict(type='dict'),
|
virtio=dict(type='dict'),
|
||||||
vmid=dict(type='int', default=None),
|
vmid=dict(type='int'),
|
||||||
watchdog=dict(),
|
watchdog=dict(),
|
||||||
proxmox_default_behavior=dict(type='str', choices=['compatibility', 'no_defaults']),
|
proxmox_default_behavior=dict(type='str', choices=['compatibility', 'no_defaults']),
|
||||||
),
|
),
|
||||||
mutually_exclusive=[('delete', 'revert'), ('delete', 'update'), ('revert', 'update'), ('clone', 'update'), ('clone', 'delete'), ('clone', 'revert')],
|
mutually_exclusive=[('delete', 'revert'), ('delete', 'update'), ('revert', 'update'), ('clone', 'update'), ('clone', 'delete'), ('clone', 'revert')],
|
||||||
required_one_of=[('name', 'vmid',)],
|
required_together=[('api_token_id', 'api_token_secret')],
|
||||||
required_if=[('state', 'present', ['node'])]
|
required_one_of=[('name', 'vmid'), ('api_password', 'api_token_id')],
|
||||||
|
required_if=[('state', 'present', ['node'])],
|
||||||
)
|
)
|
||||||
|
|
||||||
if not HAS_PROXMOXER:
|
if not HAS_PROXMOXER:
|
||||||
@@ -1140,7 +1121,6 @@ def main():
|
|||||||
cores=1,
|
cores=1,
|
||||||
cpu='kvm64',
|
cpu='kvm64',
|
||||||
cpuunits=1000,
|
cpuunits=1000,
|
||||||
force=False,
|
|
||||||
format='qcow2',
|
format='qcow2',
|
||||||
kvm=True,
|
kvm=True,
|
||||||
memory=512,
|
memory=512,
|
||||||
@@ -1159,12 +1139,6 @@ def main():
|
|||||||
|
|
||||||
auth_args = {'user': api_user}
|
auth_args = {'user': api_user}
|
||||||
if not (api_token_id and api_token_secret):
|
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
|
auth_args['password'] = api_password
|
||||||
else:
|
else:
|
||||||
auth_args['token_name'] = api_token_id
|
auth_args['token_name'] = api_token_id
|
||||||
@@ -1207,36 +1181,36 @@ def main():
|
|||||||
|
|
||||||
# Ensure source VM id exists when cloning
|
# Ensure source VM id exists when cloning
|
||||||
if not get_vm(proxmox, vmid):
|
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
|
# Ensure the choosen VM name doesn't already exist when cloning
|
||||||
if get_vmid(proxmox, name):
|
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
|
# Ensure the choosen VM id doesn't already exist when cloning
|
||||||
if get_vm(proxmox, newid):
|
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:
|
if delete is not None:
|
||||||
try:
|
try:
|
||||||
settings(module, proxmox, vmid, node, name, delete=delete)
|
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:
|
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:
|
if revert is not None:
|
||||||
try:
|
try:
|
||||||
settings(module, proxmox, vmid, node, name, revert=revert)
|
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:
|
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':
|
if state == 'present':
|
||||||
try:
|
try:
|
||||||
if get_vm(proxmox, vmid) and not (update or clone):
|
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):
|
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):
|
elif not (node, name):
|
||||||
module.fail_json(msg='node, name is mandatory for creating/updating vm')
|
module.fail_json(msg='node, name is mandatory for creating/updating vm')
|
||||||
elif not node_check(proxmox, node):
|
elif not node_check(proxmox, node):
|
||||||
@@ -1309,85 +1283,93 @@ def main():
|
|||||||
scsi=module.params['scsi'],
|
scsi=module.params['scsi'],
|
||||||
virtio=module.params['virtio'])
|
virtio=module.params['virtio'])
|
||||||
if update:
|
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:
|
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:
|
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:
|
except Exception as e:
|
||||||
if update:
|
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:
|
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:
|
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':
|
elif state == 'started':
|
||||||
|
status = {}
|
||||||
try:
|
try:
|
||||||
if -1 == vmid:
|
if -1 == vmid:
|
||||||
module.fail_json(msg='VM with name = %s does not exist in cluster' % name)
|
module.fail_json(msg='VM with name = %s does not exist in cluster' % name)
|
||||||
vm = get_vm(proxmox, vmid)
|
vm = get_vm(proxmox, vmid)
|
||||||
if not vm:
|
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)
|
||||||
|
status['status'] = vm[0]['status']
|
||||||
if vm[0]['status'] == 'running':
|
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):
|
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:
|
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':
|
elif state == 'stopped':
|
||||||
|
status = {}
|
||||||
try:
|
try:
|
||||||
if -1 == vmid:
|
if -1 == vmid:
|
||||||
module.fail_json(msg='VM with name = %s does not exist in cluster' % name)
|
module.fail_json(msg='VM with name = %s does not exist in cluster' % name)
|
||||||
|
|
||||||
vm = get_vm(proxmox, vmid)
|
vm = get_vm(proxmox, vmid)
|
||||||
if not vm:
|
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)
|
||||||
|
|
||||||
|
status['status'] = vm[0]['status']
|
||||||
if vm[0]['status'] == 'stopped':
|
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']):
|
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:
|
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':
|
elif state == 'restarted':
|
||||||
|
status = {}
|
||||||
try:
|
try:
|
||||||
if -1 == vmid:
|
if -1 == vmid:
|
||||||
module.fail_json(msg='VM with name = %s does not exist in cluster' % name)
|
module.fail_json(msg='VM with name = %s does not exist in cluster' % name)
|
||||||
|
|
||||||
vm = get_vm(proxmox, vmid)
|
vm = get_vm(proxmox, vmid)
|
||||||
if not vm:
|
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)
|
||||||
|
status['status'] = vm[0]['status']
|
||||||
if vm[0]['status'] == 'stopped':
|
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):
|
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:
|
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':
|
elif state == 'absent':
|
||||||
|
status = {}
|
||||||
try:
|
try:
|
||||||
vm = get_vm(proxmox, vmid)
|
vm = get_vm(proxmox, vmid)
|
||||||
if not vm:
|
if not vm:
|
||||||
module.exit_json(changed=False)
|
module.exit_json(changed=False, vmid=vmid)
|
||||||
|
|
||||||
proxmox_node = proxmox.nodes(vm[0]['node'])
|
proxmox_node = proxmox.nodes(vm[0]['node'])
|
||||||
|
status['status'] = vm[0]['status']
|
||||||
if vm[0]['status'] == 'running':
|
if vm[0]['status'] == 'running':
|
||||||
if module.params['force']:
|
if module.params['force']:
|
||||||
stop_vm(module, proxmox, vm, True)
|
stop_vm(module, proxmox, vm, True)
|
||||||
else:
|
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)
|
taskid = proxmox_node.qemu.delete(vmid)
|
||||||
if not wait_for_task(module, proxmox, vm[0]['node'], taskid):
|
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' %
|
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])
|
proxmox_node.tasks(taskid).log.get()[:1])
|
||||||
else:
|
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:
|
except Exception as e:
|
||||||
module.fail_json(msg="deletion of VM %s failed with exception: %s" % (vmid, e))
|
module.fail_json(msg="deletion of VM %s failed with exception: %s" % (vmid, e))
|
||||||
|
|
||||||
@@ -1398,10 +1380,12 @@ def main():
|
|||||||
vm = get_vm(proxmox, vmid)
|
vm = get_vm(proxmox, vmid)
|
||||||
if not vm:
|
if not vm:
|
||||||
module.fail_json(msg='VM with vmid = %s does not exist in cluster' % vmid)
|
module.fail_json(msg='VM with vmid = %s does not exist in cluster' % vmid)
|
||||||
|
if not name:
|
||||||
|
name = vm[0]['name']
|
||||||
current = proxmox.nodes(vm[0]['node']).qemu(vmid).status.current.get()['status']
|
current = proxmox.nodes(vm[0]['node']).qemu(vmid).status.current.get()['status']
|
||||||
status['status'] = current
|
status['status'] = current
|
||||||
if status:
|
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__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ options:
|
|||||||
- The password to authenticate with.
|
- The password to authenticate with.
|
||||||
- You can use PROXMOX_PASSWORD environment variable.
|
- You can use PROXMOX_PASSWORD environment variable.
|
||||||
type: str
|
type: str
|
||||||
|
required: yes
|
||||||
hostname:
|
hostname:
|
||||||
description:
|
description:
|
||||||
- The instance name.
|
- The instance name.
|
||||||
@@ -106,7 +107,6 @@ EXAMPLES = r'''
|
|||||||
|
|
||||||
RETURN = r'''#'''
|
RETURN = r'''#'''
|
||||||
|
|
||||||
import os
|
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ except ImportError:
|
|||||||
PROXMOXER_IMP_ERR = traceback.format_exc()
|
PROXMOXER_IMP_ERR = traceback.format_exc()
|
||||||
HAS_PROXMOXER = False
|
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
|
from ansible.module_utils._text import to_native
|
||||||
|
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ def main():
|
|||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
api_host=dict(required=True),
|
api_host=dict(required=True),
|
||||||
api_user=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),
|
vmid=dict(required=False),
|
||||||
validate_certs=dict(type='bool', default='no'),
|
validate_certs=dict(type='bool', default='no'),
|
||||||
hostname=dict(),
|
hostname=dict(),
|
||||||
@@ -213,13 +213,6 @@ def main():
|
|||||||
force = module.params['force']
|
force = module.params['force']
|
||||||
vmstate = module.params['vmstate']
|
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:
|
try:
|
||||||
proxmox = setup_api(api_host, api_user, api_password, validate_certs)
|
proxmox = setup_api(api_host, api_user, api_password, validate_certs)
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_PROXMOXER = False
|
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):
|
def get_template(proxmox, node, storage, content_type, template):
|
||||||
@@ -175,7 +175,7 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
api_host=dict(required=True),
|
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_id=dict(no_log=True),
|
||||||
api_token_secret=dict(no_log=True),
|
api_token_secret=dict(no_log=True),
|
||||||
api_user=dict(required=True),
|
api_user=dict(required=True),
|
||||||
@@ -188,7 +188,10 @@ def main():
|
|||||||
timeout=dict(type='int', default=30),
|
timeout=dict(type='int', default=30),
|
||||||
force=dict(type='bool', default=False),
|
force=dict(type='bool', default=False),
|
||||||
state=dict(default='present', choices=['present', 'absent']),
|
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:
|
if not HAS_PROXMOXER:
|
||||||
@@ -207,12 +210,6 @@ def main():
|
|||||||
|
|
||||||
auth_args = {'user': api_user}
|
auth_args = {'user': api_user}
|
||||||
if not (api_token_id and api_token_secret):
|
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
|
auth_args['password'] = api_password
|
||||||
else:
|
else:
|
||||||
auth_args['token_name'] = api_token_id
|
auth_args['token_name'] = api_token_id
|
||||||
@@ -261,9 +258,7 @@ def main():
|
|||||||
content_type = module.params['content_type']
|
content_type = module.params['content_type']
|
||||||
template = module.params['template']
|
template = module.params['template']
|
||||||
|
|
||||||
if not template:
|
if not get_template(proxmox, node, storage, content_type, template):
|
||||||
module.fail_json(msg='template param is mandatory')
|
|
||||||
elif 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))
|
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):
|
if delete_template(module, proxmox, node, storage, content_type, template, timeout):
|
||||||
|
|||||||
@@ -137,17 +137,13 @@ def main():
|
|||||||
host = search_by_name(hosts_service, module.params['host'])
|
host = search_by_name(hosts_service, module.params['host'])
|
||||||
if host is None:
|
if host is None:
|
||||||
raise Exception("Host '%s' was not found." % module.params['host'])
|
raise Exception("Host '%s' was not found." % module.params['host'])
|
||||||
tags.extend([
|
tags.extend(hosts_service.host_service(host.id).tags_service().list())
|
||||||
tag for tag in hosts_service.host_service(host.id).tags_service().list()
|
|
||||||
])
|
|
||||||
if module.params['vm']:
|
if module.params['vm']:
|
||||||
vms_service = connection.system_service().vms_service()
|
vms_service = connection.system_service().vms_service()
|
||||||
vm = search_by_name(vms_service, module.params['vm'])
|
vm = search_by_name(vms_service, module.params['vm'])
|
||||||
if vm is None:
|
if vm is None:
|
||||||
raise Exception("Vm '%s' was not found." % module.params['vm'])
|
raise Exception("Vm '%s' was not found." % module.params['vm'])
|
||||||
tags.extend([
|
tags.extend(vms_service.vm_service(vm.id).tags_service().list())
|
||||||
tag for tag in vms_service.vm_service(vm.id).tags_service().list()
|
|
||||||
])
|
|
||||||
|
|
||||||
if not (module.params['vm'] or module.params['host'] or module.params['name']):
|
if not (module.params['vm'] or module.params['host'] or module.params['name']):
|
||||||
tags = all_tags
|
tags = all_tags
|
||||||
|
|||||||
@@ -31,20 +31,25 @@ options:
|
|||||||
auth_token:
|
auth_token:
|
||||||
description:
|
description:
|
||||||
- Packet API token. You can also supply it in env var C(PACKET_API_TOKEN).
|
- Packet API token. You can also supply it in env var C(PACKET_API_TOKEN).
|
||||||
|
type: str
|
||||||
|
|
||||||
count:
|
count:
|
||||||
description:
|
description:
|
||||||
- The number of devices to create. Count number can be included in hostname via the %d string formatter.
|
- The number of devices to create. Count number can be included in hostname via the %d string formatter.
|
||||||
default: 1
|
default: 1
|
||||||
|
type: int
|
||||||
|
|
||||||
count_offset:
|
count_offset:
|
||||||
description:
|
description:
|
||||||
- From which number to start the count.
|
- From which number to start the count.
|
||||||
default: 1
|
default: 1
|
||||||
|
type: int
|
||||||
|
|
||||||
device_ids:
|
device_ids:
|
||||||
description:
|
description:
|
||||||
- List of device IDs on which to operate.
|
- List of device IDs on which to operate.
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
description:
|
description:
|
||||||
@@ -57,10 +62,12 @@ options:
|
|||||||
facility:
|
facility:
|
||||||
description:
|
description:
|
||||||
- Facility slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/facilities/).
|
- Facility slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/facilities/).
|
||||||
|
type: str
|
||||||
|
|
||||||
features:
|
features:
|
||||||
description:
|
description:
|
||||||
- Dict with "features" for device creation. See Packet API docs for details.
|
- Dict with "features" for device creation. See Packet API docs for details.
|
||||||
|
type: dict
|
||||||
|
|
||||||
hostnames:
|
hostnames:
|
||||||
description:
|
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 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.
|
- If only one hostname, it might be expanded to list if I(count)>1.
|
||||||
aliases: [name]
|
aliases: [name]
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
|
|
||||||
locked:
|
locked:
|
||||||
description:
|
description:
|
||||||
@@ -79,15 +88,18 @@ options:
|
|||||||
operating_system:
|
operating_system:
|
||||||
description:
|
description:
|
||||||
- OS slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/operatingsystems/).
|
- OS slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/operatingsystems/).
|
||||||
|
type: str
|
||||||
|
|
||||||
plan:
|
plan:
|
||||||
description:
|
description:
|
||||||
- Plan slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/plans/).
|
- Plan slug for device creation. See Packet API for current list - U(https://www.packet.net/developers/api/plans/).
|
||||||
|
type: str
|
||||||
|
|
||||||
project_id:
|
project_id:
|
||||||
description:
|
description:
|
||||||
- ID of project of the device.
|
- ID of project of the device.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
|
|
||||||
state:
|
state:
|
||||||
description:
|
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).
|
- 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]
|
choices: [present, absent, active, inactive, rebooted]
|
||||||
default: present
|
default: present
|
||||||
|
type: str
|
||||||
|
|
||||||
user_data:
|
user_data:
|
||||||
description:
|
description:
|
||||||
- Userdata blob made available to the machine
|
- Userdata blob made available to the machine
|
||||||
|
type: str
|
||||||
|
|
||||||
wait_for_public_IPv:
|
wait_for_public_IPv:
|
||||||
description:
|
description:
|
||||||
@@ -107,16 +121,21 @@ options:
|
|||||||
- If set to 4, it will wait until IPv4 is assigned to the instance.
|
- 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.
|
- If set to 6, wait until public IPv6 is assigned to the instance.
|
||||||
choices: [4,6]
|
choices: [4,6]
|
||||||
|
type: int
|
||||||
|
|
||||||
wait_timeout:
|
wait_timeout:
|
||||||
description:
|
description:
|
||||||
- How long (seconds) to wait either for automatic IP address assignment, or for the device to reach the C(active) I(state).
|
- 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.
|
- 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
|
default: 900
|
||||||
|
type: int
|
||||||
|
|
||||||
ipxe_script_url:
|
ipxe_script_url:
|
||||||
description:
|
description:
|
||||||
- URL of custom iPXE script for provisioning.
|
- URL of custom iPXE script for provisioning.
|
||||||
- More about custom iPXE for Packet devices at U(https://help.packet.net/technical/infrastructure/custom-ipxe).
|
- More about custom iPXE for Packet devices at U(https://help.packet.net/technical/infrastructure/custom-ipxe).
|
||||||
|
type: str
|
||||||
|
|
||||||
always_pxe:
|
always_pxe:
|
||||||
description:
|
description:
|
||||||
- Persist PXE as the first boot option.
|
- Persist PXE as the first boot option.
|
||||||
@@ -601,10 +620,10 @@ def main():
|
|||||||
no_log=True),
|
no_log=True),
|
||||||
count=dict(type='int', default=1),
|
count=dict(type='int', default=1),
|
||||||
count_offset=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(),
|
facility=dict(),
|
||||||
features=dict(type='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'),
|
tags=dict(type='list', elements='str'),
|
||||||
locked=dict(type='bool', default=False, aliases=['lock']),
|
locked=dict(type='bool', default=False, aliases=['lock']),
|
||||||
operating_system=dict(),
|
operating_system=dict(),
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ options:
|
|||||||
required: false
|
required: false
|
||||||
default: []
|
default: []
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
changes:
|
changes:
|
||||||
description:
|
description:
|
||||||
- "List of fields which should be changed by block itself (doesn't
|
- "List of fields which should be changed by block itself (doesn't
|
||||||
@@ -552,7 +553,7 @@ def main():
|
|||||||
state=dict(default='present', type='str',
|
state=dict(default='present', type='str',
|
||||||
choices=['started', 'stopped', 'present', 'absent']),
|
choices=['started', 'stopped', 'present', 'absent']),
|
||||||
name=dict(required=True, type='str'), description=dict(type='str'),
|
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'),
|
changes=dict(default=dict(), type='dict'),
|
||||||
cache=dict(default=dict(), type='dict'),
|
cache=dict(default=dict(), type='dict'),
|
||||||
validate_certs=dict(default=True, type='bool'))
|
validate_certs=dict(default=True, type='bool'))
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- A list of disks to add, valid properties are documented in vmadm(1M).
|
- A list of disks to add, valid properties are documented in vmadm(1M).
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
dns_domain:
|
dns_domain:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
@@ -93,6 +94,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Mount additional filesystems into an OS VM.
|
- Mount additional filesystems into an OS VM.
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
firewall_enabled:
|
firewall_enabled:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
@@ -198,6 +200,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- A list of nics to add, valid properties are documented in vmadm(1M).
|
- A list of nics to add, valid properties are documented in vmadm(1M).
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
nowait:
|
nowait:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
@@ -230,6 +233,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- List of resolvers to be put into C(/etc/resolv.conf).
|
- List of resolvers to be put into C(/etc/resolv.conf).
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
routes:
|
routes:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
@@ -670,7 +674,6 @@ def main():
|
|||||||
'zfs_snapshot_limit'
|
'zfs_snapshot_limit'
|
||||||
],
|
],
|
||||||
'dict': ['customer_metadata', 'internal_metadata', 'routes'],
|
'dict': ['customer_metadata', 'internal_metadata', 'routes'],
|
||||||
'list': ['disks', 'nics', 'resolvers', 'filesystems']
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Start with the options that are not as trivial as those above.
|
# 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.
|
# Regular strings, however these require additional options.
|
||||||
spice_password=dict(type='str', no_log=True),
|
spice_password=dict(type='str', no_log=True),
|
||||||
vnc_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.
|
# Add our 'simple' options to options dict.
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ options:
|
|||||||
- List of disk sizes to be assigned to new virtual instance.
|
- List of disk sizes to be assigned to new virtual instance.
|
||||||
default: [ 25 ]
|
default: [ 25 ]
|
||||||
type: list
|
type: list
|
||||||
|
elements: int
|
||||||
os_code:
|
os_code:
|
||||||
description:
|
description:
|
||||||
- OS Code to be used for new virtual instance.
|
- OS Code to be used for new virtual instance.
|
||||||
@@ -140,6 +141,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- List of ssh keys by their Id to be assigned to a virtual instance.
|
- List of ssh keys by their Id to be assigned to a virtual instance.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
post_uri:
|
post_uri:
|
||||||
description:
|
description:
|
||||||
- URL of a post provisioning script to be loaded and executed on virtual instance.
|
- 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),
|
cpus=dict(type='int', choices=CPU_SIZES),
|
||||||
memory=dict(type='int', choices=MEMORY_SIZES),
|
memory=dict(type='int', choices=MEMORY_SIZES),
|
||||||
flavor=dict(type='str'),
|
flavor=dict(type='str'),
|
||||||
disks=dict(type='list', default=[25]),
|
disks=dict(type='list', elements='int', default=[25]),
|
||||||
os_code=dict(type='str'),
|
os_code=dict(type='str'),
|
||||||
image_id=dict(type='str'),
|
image_id=dict(type='str'),
|
||||||
nic_speed=dict(type='int', choices=NIC_SPEEDS),
|
nic_speed=dict(type='int', choices=NIC_SPEEDS),
|
||||||
public_vlan=dict(type='str'),
|
public_vlan=dict(type='str'),
|
||||||
private_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'),
|
post_uri=dict(type='str'),
|
||||||
state=dict(type='str', default='present', choices=STATES),
|
state=dict(type='str', default='present', choices=STATES),
|
||||||
wait=dict(type='bool', default=True),
|
wait=dict(type='bool', default=True),
|
||||||
|
|||||||
@@ -312,12 +312,11 @@ def run():
|
|||||||
)
|
)
|
||||||
|
|
||||||
changed = False
|
changed = False
|
||||||
nomad_jobs = list()
|
result = list()
|
||||||
try:
|
try:
|
||||||
job_list = nomad_client.jobs.get_jobs()
|
job_list = nomad_client.jobs.get_jobs()
|
||||||
for job in job_list:
|
for job in job_list:
|
||||||
nomad_jobs.append(nomad_client.job.get_job(job.get('ID')))
|
result.append(nomad_client.job.get_job(job.get('ID')))
|
||||||
result = nomad_jobs
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
module.fail_json(msg=to_native(e))
|
module.fail_json(msg=to_native(e))
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ EXAMPLES = '''
|
|||||||
local_only: False
|
local_only: False
|
||||||
|
|
||||||
# example playbook:
|
# example playbook:
|
||||||
---
|
|
||||||
- name: Upgrade aerospike
|
- name: Upgrade aerospike
|
||||||
hosts: all
|
hosts: all
|
||||||
become: true
|
become: true
|
||||||
@@ -338,7 +337,7 @@ class Migrations:
|
|||||||
namespace_tx = \
|
namespace_tx = \
|
||||||
int(namespace_stats[self.module.params['migrate_tx_key']])
|
int(namespace_stats[self.module.params['migrate_tx_key']])
|
||||||
namespace_rx = \
|
namespace_rx = \
|
||||||
int(namespace_stats[self.module.params['migrate_tx_key']])
|
int(namespace_stats[self.module.params['migrate_rx_key']])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.module.fail_json(
|
self.module.fail_json(
|
||||||
msg="Did not find partition remaining key:" +
|
msg="Did not find partition remaining key:" +
|
||||||
|
|||||||
@@ -22,11 +22,13 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Name of the plugin to install.
|
- Name of the plugin to install.
|
||||||
required: True
|
required: True
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Desired state of a plugin.
|
- Desired state of a plugin.
|
||||||
choices: ["present", "absent"]
|
choices: ["present", "absent"]
|
||||||
default: present
|
default: present
|
||||||
|
type: str
|
||||||
src:
|
src:
|
||||||
description:
|
description:
|
||||||
- Optionally set the source location to retrieve the plugin from. This can be a file://
|
- Optionally set the source location to retrieve the plugin from. This can be a file://
|
||||||
@@ -38,16 +40,19 @@ options:
|
|||||||
effect.
|
effect.
|
||||||
- For ES 1.x use url.
|
- For ES 1.x use url.
|
||||||
required: False
|
required: False
|
||||||
|
type: str
|
||||||
url:
|
url:
|
||||||
description:
|
description:
|
||||||
- Set exact URL to download the plugin from (Only works for ES 1.x).
|
- Set exact URL to download the plugin from (Only works for ES 1.x).
|
||||||
- For ES 2.x and higher, use src.
|
- For ES 2.x and higher, use src.
|
||||||
required: False
|
required: False
|
||||||
|
type: str
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- "Timeout setting: 30s, 1m, 1h..."
|
- "Timeout setting: 30s, 1m, 1h..."
|
||||||
- Only valid for Elasticsearch < 5.0. This option is ignored for Elasticsearch > 5.0.
|
- Only valid for Elasticsearch < 5.0. This option is ignored for Elasticsearch > 5.0.
|
||||||
default: 1m
|
default: 1m
|
||||||
|
type: str
|
||||||
force:
|
force:
|
||||||
description:
|
description:
|
||||||
- "Force batch mode when installing plugins. This is only necessary if a plugin requires additional permissions and console detection fails."
|
- "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:
|
description:
|
||||||
- Location of the plugin binary. If this file is not found, the default plugin binaries will be used.
|
- 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.
|
- The default changed in Ansible 2.4 to None.
|
||||||
|
type: path
|
||||||
plugin_dir:
|
plugin_dir:
|
||||||
description:
|
description:
|
||||||
- Your configured plugin directory specified in Elasticsearch
|
- Your configured plugin directory specified in Elasticsearch
|
||||||
default: /usr/share/elasticsearch/plugins/
|
default: /usr/share/elasticsearch/plugins/
|
||||||
|
type: path
|
||||||
proxy_host:
|
proxy_host:
|
||||||
description:
|
description:
|
||||||
- Proxy host to use during plugin installation
|
- Proxy host to use during plugin installation
|
||||||
|
type: str
|
||||||
proxy_port:
|
proxy_port:
|
||||||
description:
|
description:
|
||||||
- Proxy port to use during plugin installation
|
- Proxy port to use during plugin installation
|
||||||
|
type: str
|
||||||
version:
|
version:
|
||||||
description:
|
description:
|
||||||
- Version of the plugin to be installed.
|
- Version of the plugin to be installed.
|
||||||
If plugin exists with previous version, it will NOT be updated
|
If plugin exists with previous version, it will NOT be updated
|
||||||
|
type: str
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
@@ -241,7 +251,7 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
name=dict(required=True),
|
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),
|
src=dict(default=None),
|
||||||
url=dict(default=None),
|
url=dict(default=None),
|
||||||
timeout=dict(default="1m"),
|
timeout=dict(default="1m"),
|
||||||
|
|||||||
@@ -22,31 +22,38 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Name of the plugin to install.
|
- Name of the plugin to install.
|
||||||
required: True
|
required: True
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Desired state of a plugin.
|
- Desired state of a plugin.
|
||||||
choices: ["present", "absent"]
|
choices: ["present", "absent"]
|
||||||
default: present
|
default: present
|
||||||
|
type: str
|
||||||
url:
|
url:
|
||||||
description:
|
description:
|
||||||
- Set exact URL to download the plugin from.
|
- Set exact URL to download the plugin from.
|
||||||
- For local file, prefix its absolute path with file://
|
- For local file, prefix its absolute path with file://
|
||||||
|
type: str
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- "Timeout setting: 30s, 1m, 1h etc."
|
- "Timeout setting: 30s, 1m, 1h etc."
|
||||||
default: 1m
|
default: 1m
|
||||||
|
type: str
|
||||||
plugin_bin:
|
plugin_bin:
|
||||||
description:
|
description:
|
||||||
- Location of the Kibana binary.
|
- Location of the Kibana binary.
|
||||||
default: /opt/kibana/bin/kibana
|
default: /opt/kibana/bin/kibana
|
||||||
|
type: path
|
||||||
plugin_dir:
|
plugin_dir:
|
||||||
description:
|
description:
|
||||||
- Your configured plugin directory specified in Kibana.
|
- Your configured plugin directory specified in Kibana.
|
||||||
default: /opt/kibana/installedPlugins/
|
default: /opt/kibana/installedPlugins/
|
||||||
|
type: path
|
||||||
version:
|
version:
|
||||||
description:
|
description:
|
||||||
- Version of the plugin to be installed.
|
- 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.
|
- If plugin exists with previous version, plugin will NOT be updated unless C(force) is set to yes.
|
||||||
|
type: str
|
||||||
force:
|
force:
|
||||||
description:
|
description:
|
||||||
- Delete and re-install the plugin. Can be useful for plugins update.
|
- Delete and re-install the plugin. Can be useful for plugins update.
|
||||||
@@ -209,7 +216,7 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
name=dict(required=True),
|
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),
|
url=dict(default=None),
|
||||||
timeout=dict(default="1m"),
|
timeout=dict(default="1m"),
|
||||||
plugin_bin=dict(default="/opt/kibana/bin/kibana", type="path"),
|
plugin_bin=dict(default="/opt/kibana/bin/kibana", type="path"),
|
||||||
|
|||||||
@@ -23,28 +23,37 @@ options:
|
|||||||
description:
|
description:
|
||||||
- The command you would like to perform against the cluster.
|
- The command you would like to perform against the cluster.
|
||||||
choices: ['ping', 'kv_test', 'join', 'plan', 'commit']
|
choices: ['ping', 'kv_test', 'join', 'plan', 'commit']
|
||||||
|
type: str
|
||||||
config_dir:
|
config_dir:
|
||||||
description:
|
description:
|
||||||
- The path to the riak configuration directory
|
- The path to the riak configuration directory
|
||||||
default: /etc/riak
|
default: /etc/riak
|
||||||
|
type: path
|
||||||
http_conn:
|
http_conn:
|
||||||
description:
|
description:
|
||||||
- The ip address and port that is listening for Riak HTTP queries
|
- The ip address and port that is listening for Riak HTTP queries
|
||||||
default: 127.0.0.1:8098
|
default: 127.0.0.1:8098
|
||||||
|
type: str
|
||||||
target_node:
|
target_node:
|
||||||
description:
|
description:
|
||||||
- The target node for certain operations (join, ping)
|
- The target node for certain operations (join, ping)
|
||||||
default: riak@127.0.0.1
|
default: riak@127.0.0.1
|
||||||
|
type: str
|
||||||
wait_for_handoffs:
|
wait_for_handoffs:
|
||||||
description:
|
description:
|
||||||
- Number of seconds to wait for handoffs to complete.
|
- Number of seconds to wait for handoffs to complete.
|
||||||
|
type: int
|
||||||
|
default: 0
|
||||||
wait_for_ring:
|
wait_for_ring:
|
||||||
description:
|
description:
|
||||||
- Number of seconds to wait for all nodes to agree on the ring.
|
- Number of seconds to wait for all nodes to agree on the ring.
|
||||||
|
type: int
|
||||||
|
default: 0
|
||||||
wait_for_service:
|
wait_for_service:
|
||||||
description:
|
description:
|
||||||
- Waits for a riak service to come online before continuing.
|
- Waits for a riak service to come online before continuing.
|
||||||
choices: ['kv']
|
choices: ['kv']
|
||||||
|
type: str
|
||||||
validate_certs:
|
validate_certs:
|
||||||
description:
|
description:
|
||||||
- If C(no), SSL certificates will not be validated. This should only be used
|
- 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'),
|
config_dir=dict(default='/etc/riak', type='path'),
|
||||||
http_conn=dict(required=False, default='127.0.0.1:8098'),
|
http_conn=dict(required=False, default='127.0.0.1:8098'),
|
||||||
target_node=dict(default='riak@127.0.0.1', required=False),
|
target_node=dict(default='riak@127.0.0.1', required=False),
|
||||||
wait_for_handoffs=dict(default=False, type='int'),
|
wait_for_handoffs=dict(default=0, type='int'),
|
||||||
wait_for_ring=dict(default=False, type='int'),
|
wait_for_ring=dict(default=0, type='int'),
|
||||||
wait_for_service=dict(
|
wait_for_service=dict(
|
||||||
required=False, default=None, choices=['kv']),
|
required=False, default=None, choices=['kv']),
|
||||||
validate_certs=dict(default=True, type='bool'))
|
validate_certs=dict(default=True, type='bool'))
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ short_description: Updates Vertica configuration parameters.
|
|||||||
description:
|
description:
|
||||||
- Updates Vertica configuration parameters.
|
- Updates Vertica configuration parameters.
|
||||||
options:
|
options:
|
||||||
name:
|
parameter:
|
||||||
description:
|
description:
|
||||||
- Name of the parameter to update.
|
- Name of the parameter to update.
|
||||||
required: true
|
required: true
|
||||||
aliases: [parameter]
|
aliases: [name]
|
||||||
type: str
|
type: str
|
||||||
value:
|
value:
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -21,25 +21,30 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Name of the cluster running the schema.
|
- Name of the cluster running the schema.
|
||||||
default: localhost
|
default: localhost
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
Database port to connect to.
|
Database port to connect to.
|
||||||
default: 5433
|
default: 5433
|
||||||
|
type: str
|
||||||
db:
|
db:
|
||||||
description:
|
description:
|
||||||
- Name of the database running the schema.
|
- Name of the database running the schema.
|
||||||
|
type: str
|
||||||
login_user:
|
login_user:
|
||||||
description:
|
description:
|
||||||
- The username used to authenticate with.
|
- The username used to authenticate with.
|
||||||
default: dbadmin
|
default: dbadmin
|
||||||
|
type: str
|
||||||
login_password:
|
login_password:
|
||||||
description:
|
description:
|
||||||
- The password used to authenticate with.
|
- The password used to authenticate with.
|
||||||
|
type: str
|
||||||
notes:
|
notes:
|
||||||
- The default authentication assumes that you are either logging in as or sudo'ing
|
- The default authentication assumes that you are either logging in as or sudo'ing
|
||||||
to the C(dbadmin) account on the host.
|
to the C(dbadmin) account on the host.
|
||||||
- This module uses C(pyodbc), a Python ODBC database adapter. You must ensure
|
- 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)
|
- 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)
|
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)
|
and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16)
|
||||||
|
|||||||
@@ -15,37 +15,46 @@ short_description: Adds or removes Vertica database roles and assigns roles to t
|
|||||||
description:
|
description:
|
||||||
- Adds or removes Vertica database role and, optionally, assign other roles.
|
- Adds or removes Vertica database role and, optionally, assign other roles.
|
||||||
options:
|
options:
|
||||||
name:
|
role:
|
||||||
description:
|
description:
|
||||||
- Name of the role to add or remove.
|
- Name of the role to add or remove.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
|
aliases: ['name']
|
||||||
assigned_roles:
|
assigned_roles:
|
||||||
description:
|
description:
|
||||||
- Comma separated list of roles to assign to the role.
|
- Comma separated list of roles to assign to the role.
|
||||||
aliases: ['assigned_role']
|
aliases: ['assigned_role']
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether to create C(present), drop C(absent) or lock C(locked) a role.
|
- Whether to create C(present), drop C(absent) or lock C(locked) a role.
|
||||||
choices: ['present', 'absent']
|
choices: ['present', 'absent']
|
||||||
default: present
|
default: present
|
||||||
|
type: str
|
||||||
db:
|
db:
|
||||||
description:
|
description:
|
||||||
- Name of the Vertica database.
|
- Name of the Vertica database.
|
||||||
|
type: str
|
||||||
cluster:
|
cluster:
|
||||||
description:
|
description:
|
||||||
- Name of the Vertica cluster.
|
- Name of the Vertica cluster.
|
||||||
default: localhost
|
default: localhost
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Vertica cluster port to connect to.
|
- Vertica cluster port to connect to.
|
||||||
default: 5433
|
default: 5433
|
||||||
|
type: str
|
||||||
login_user:
|
login_user:
|
||||||
description:
|
description:
|
||||||
- The username used to authenticate with.
|
- The username used to authenticate with.
|
||||||
default: dbadmin
|
default: dbadmin
|
||||||
|
type: str
|
||||||
login_password:
|
login_password:
|
||||||
description:
|
description:
|
||||||
- The password used to authenticate with.
|
- The password used to authenticate with.
|
||||||
|
type: str
|
||||||
notes:
|
notes:
|
||||||
- The default authentication assumes that you are either logging in as or sudo'ing
|
- The default authentication assumes that you are either logging in as or sudo'ing
|
||||||
to the C(dbadmin) account on the host.
|
to the C(dbadmin) account on the host.
|
||||||
@@ -168,11 +177,11 @@ def main():
|
|||||||
role=dict(required=True, aliases=['name']),
|
role=dict(required=True, aliases=['name']),
|
||||||
assigned_roles=dict(default=None, aliases=['assigned_role']),
|
assigned_roles=dict(default=None, aliases=['assigned_role']),
|
||||||
state=dict(default='present', choices=['absent', 'present']),
|
state=dict(default='present', choices=['absent', 'present']),
|
||||||
db=dict(default=None),
|
db=dict(),
|
||||||
cluster=dict(default='localhost'),
|
cluster=dict(default='localhost'),
|
||||||
port=dict(default='5433'),
|
port=dict(default='5433'),
|
||||||
login_user=dict(default='dbadmin'),
|
login_user=dict(default='dbadmin'),
|
||||||
login_password=dict(default=None, no_log=True),
|
login_password=dict(no_log=True),
|
||||||
), supports_check_mode=True)
|
), supports_check_mode=True)
|
||||||
|
|
||||||
if not pyodbc_found:
|
if not pyodbc_found:
|
||||||
|
|||||||
@@ -20,44 +20,55 @@ description:
|
|||||||
will fail and only remove roles created for the schema if they have
|
will fail and only remove roles created for the schema if they have
|
||||||
no dependencies.
|
no dependencies.
|
||||||
options:
|
options:
|
||||||
name:
|
schema:
|
||||||
description:
|
description:
|
||||||
- Name of the schema to add or remove.
|
- Name of the schema to add or remove.
|
||||||
required: true
|
required: true
|
||||||
|
aliases: ['name']
|
||||||
|
type: str
|
||||||
usage_roles:
|
usage_roles:
|
||||||
description:
|
description:
|
||||||
- Comma separated list of roles to create and grant usage access to the schema.
|
- Comma separated list of roles to create and grant usage access to the schema.
|
||||||
aliases: ['usage_role']
|
aliases: ['usage_role']
|
||||||
|
type: str
|
||||||
create_roles:
|
create_roles:
|
||||||
description:
|
description:
|
||||||
- Comma separated list of roles to create and grant usage and create access to the schema.
|
- Comma separated list of roles to create and grant usage and create access to the schema.
|
||||||
aliases: ['create_role']
|
aliases: ['create_role']
|
||||||
|
type: str
|
||||||
owner:
|
owner:
|
||||||
description:
|
description:
|
||||||
- Name of the user to set as owner of the schema.
|
- Name of the user to set as owner of the schema.
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether to create C(present), or drop C(absent) a schema.
|
- Whether to create C(present), or drop C(absent) a schema.
|
||||||
default: present
|
default: present
|
||||||
choices: ['present', 'absent']
|
choices: ['present', 'absent']
|
||||||
|
type: str
|
||||||
db:
|
db:
|
||||||
description:
|
description:
|
||||||
- Name of the Vertica database.
|
- Name of the Vertica database.
|
||||||
|
type: str
|
||||||
cluster:
|
cluster:
|
||||||
description:
|
description:
|
||||||
- Name of the Vertica cluster.
|
- Name of the Vertica cluster.
|
||||||
default: localhost
|
default: localhost
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Vertica cluster port to connect to.
|
- Vertica cluster port to connect to.
|
||||||
default: 5433
|
default: 5433
|
||||||
|
type: str
|
||||||
login_user:
|
login_user:
|
||||||
description:
|
description:
|
||||||
- The username used to authenticate with.
|
- The username used to authenticate with.
|
||||||
default: dbadmin
|
default: dbadmin
|
||||||
|
type: str
|
||||||
login_password:
|
login_password:
|
||||||
description:
|
description:
|
||||||
- The password used to authenticate with.
|
- The password used to authenticate with.
|
||||||
|
type: str
|
||||||
notes:
|
notes:
|
||||||
- The default authentication assumes that you are either logging in as or sudo'ing
|
- The default authentication assumes that you are either logging in as or sudo'ing
|
||||||
to the C(dbadmin) account on the host.
|
to the C(dbadmin) account on the host.
|
||||||
@@ -230,15 +241,15 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
schema=dict(required=True, aliases=['name']),
|
schema=dict(required=True, aliases=['name']),
|
||||||
usage_roles=dict(default=None, aliases=['usage_role']),
|
usage_roles=dict(aliases=['usage_role']),
|
||||||
create_roles=dict(default=None, aliases=['create_role']),
|
create_roles=dict(aliases=['create_role']),
|
||||||
owner=dict(default=None),
|
owner=dict(),
|
||||||
state=dict(default='present', choices=['absent', 'present']),
|
state=dict(default='present', choices=['absent', 'present']),
|
||||||
db=dict(default=None),
|
db=dict(),
|
||||||
cluster=dict(default='localhost'),
|
cluster=dict(default='localhost'),
|
||||||
port=dict(default='5433'),
|
port=dict(default='5433'),
|
||||||
login_user=dict(default='dbadmin'),
|
login_user=dict(default='dbadmin'),
|
||||||
login_password=dict(default=None, no_log=True),
|
login_password=dict(no_log=True),
|
||||||
), supports_check_mode=True)
|
), supports_check_mode=True)
|
||||||
|
|
||||||
if not pyodbc_found:
|
if not pyodbc_found:
|
||||||
|
|||||||
@@ -17,22 +17,27 @@ description:
|
|||||||
- In such a situation, if the module tries to remove the user it
|
- In such a situation, if the module tries to remove the user it
|
||||||
will fail and only remove roles granted to the user.
|
will fail and only remove roles granted to the user.
|
||||||
options:
|
options:
|
||||||
name:
|
user:
|
||||||
description:
|
description:
|
||||||
- Name of the user to add or remove.
|
- Name of the user to add or remove.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
|
aliases: ['name']
|
||||||
profile:
|
profile:
|
||||||
description:
|
description:
|
||||||
- Sets the user's profile.
|
- Sets the user's profile.
|
||||||
|
type: str
|
||||||
resource_pool:
|
resource_pool:
|
||||||
description:
|
description:
|
||||||
- Sets the user's resource pool.
|
- Sets the user's resource pool.
|
||||||
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- The user's password encrypted by the MD5 algorithm.
|
- The user's password encrypted by the MD5 algorithm.
|
||||||
- The password must be generated with the format C("md5" + md5[password + username]),
|
- 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
|
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>').
|
the Vertica database with select 'md5'||md5('<user_password><user_name>').
|
||||||
|
type: str
|
||||||
expired:
|
expired:
|
||||||
description:
|
description:
|
||||||
- Sets the user's password expiration.
|
- Sets the user's password expiration.
|
||||||
@@ -46,29 +51,36 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Comma separated list of roles to assign to the user.
|
- Comma separated list of roles to assign to the user.
|
||||||
aliases: ['role']
|
aliases: ['role']
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether to create C(present), drop C(absent) or lock C(locked) a user.
|
- Whether to create C(present), drop C(absent) or lock C(locked) a user.
|
||||||
choices: ['present', 'absent', 'locked']
|
choices: ['present', 'absent', 'locked']
|
||||||
default: present
|
default: present
|
||||||
|
type: str
|
||||||
db:
|
db:
|
||||||
description:
|
description:
|
||||||
- Name of the Vertica database.
|
- Name of the Vertica database.
|
||||||
|
type: str
|
||||||
cluster:
|
cluster:
|
||||||
description:
|
description:
|
||||||
- Name of the Vertica cluster.
|
- Name of the Vertica cluster.
|
||||||
default: localhost
|
default: localhost
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Vertica cluster port to connect to.
|
- Vertica cluster port to connect to.
|
||||||
default: 5433
|
default: 5433
|
||||||
|
type: str
|
||||||
login_user:
|
login_user:
|
||||||
description:
|
description:
|
||||||
- The username used to authenticate with.
|
- The username used to authenticate with.
|
||||||
default: dbadmin
|
default: dbadmin
|
||||||
|
type: str
|
||||||
login_password:
|
login_password:
|
||||||
description:
|
description:
|
||||||
- The password used to authenticate with.
|
- The password used to authenticate with.
|
||||||
|
type: str
|
||||||
notes:
|
notes:
|
||||||
- The default authentication assumes that you are either logging in as or sudo'ing
|
- The default authentication assumes that you are either logging in as or sudo'ing
|
||||||
to the C(dbadmin) account on the host.
|
to the C(dbadmin) account on the host.
|
||||||
@@ -282,18 +294,18 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
user=dict(required=True, aliases=['name']),
|
user=dict(required=True, aliases=['name']),
|
||||||
profile=dict(default=None),
|
profile=dict(),
|
||||||
resource_pool=dict(default=None),
|
resource_pool=dict(),
|
||||||
password=dict(default=None, no_log=True),
|
password=dict(no_log=True),
|
||||||
expired=dict(type='bool', default=None),
|
expired=dict(type='bool'),
|
||||||
ldap=dict(type='bool', default=None),
|
ldap=dict(type='bool'),
|
||||||
roles=dict(default=None, aliases=['role']),
|
roles=dict(aliases=['role']),
|
||||||
state=dict(default='present', choices=['absent', 'present', 'locked']),
|
state=dict(default='present', choices=['absent', 'present', 'locked']),
|
||||||
db=dict(default=None),
|
db=dict(),
|
||||||
cluster=dict(default='localhost'),
|
cluster=dict(default='localhost'),
|
||||||
port=dict(default='5433'),
|
port=dict(default='5433'),
|
||||||
login_user=dict(default='dbadmin'),
|
login_user=dict(default='dbadmin'),
|
||||||
login_password=dict(default=None, no_log=True),
|
login_password=dict(no_log=True),
|
||||||
), supports_check_mode=True)
|
), supports_check_mode=True)
|
||||||
|
|
||||||
if not pyodbc_found:
|
if not pyodbc_found:
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ options:
|
|||||||
executable:
|
executable:
|
||||||
description:
|
description:
|
||||||
- The path to the C(7z) executable to use for extracting files from the ISO.
|
- 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
|
type: path
|
||||||
default: '7z'
|
|
||||||
notes:
|
notes:
|
||||||
- Only the file checksum (content) is taken into account when extracting files
|
- 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.
|
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']),
|
image=dict(type='path', required=True, aliases=['path', 'src']),
|
||||||
dest=dict(type='path', required=True),
|
dest=dict(type='path', required=True),
|
||||||
files=dict(type='list', elements='str', 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
|
executable=dict(type='path'), # No default on purpose
|
||||||
),
|
),
|
||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
@@ -112,10 +113,6 @@ def main():
|
|||||||
force = module.params['force']
|
force = module.params['force']
|
||||||
executable = module.params['executable']
|
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(
|
result = dict(
|
||||||
changed=False,
|
changed=False,
|
||||||
dest=dest,
|
dest=dest,
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ options:
|
|||||||
or a hash where the key is an element name and the value is the element value.
|
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.
|
- This parameter requires C(xpath) to be set.
|
||||||
type: list
|
type: list
|
||||||
|
elements: raw
|
||||||
set_children:
|
set_children:
|
||||||
description:
|
description:
|
||||||
- Set the child-element(s) of a selected element for a given C(xpath).
|
- 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).
|
- Child elements must be specified as in C(add_children).
|
||||||
- This parameter requires C(xpath) to be set.
|
- This parameter requires C(xpath) to be set.
|
||||||
type: list
|
type: list
|
||||||
|
elements: raw
|
||||||
count:
|
count:
|
||||||
description:
|
description:
|
||||||
- Search for a given C(xpath) and provide the count of any matches.
|
- 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']),
|
state=dict(type='str', default='present', choices=['absent', 'present'], aliases=['ensure']),
|
||||||
value=dict(type='raw'),
|
value=dict(type='raw'),
|
||||||
attribute=dict(type='raw'),
|
attribute=dict(type='raw'),
|
||||||
add_children=dict(type='list'),
|
add_children=dict(type='list', elements='raw'),
|
||||||
set_children=dict(type='list'),
|
set_children=dict(type='list', elements='raw'),
|
||||||
count=dict(type='bool', default=False),
|
count=dict(type='bool', default=False),
|
||||||
print_match=dict(type='bool', default=False),
|
print_match=dict(type='bool', default=False),
|
||||||
pretty_print=dict(type='bool', default=False),
|
pretty_print=dict(type='bool', default=False),
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ options:
|
|||||||
aliases:
|
aliases:
|
||||||
- defaultRoles
|
- defaultRoles
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
|
|
||||||
redirect_uris:
|
redirect_uris:
|
||||||
description:
|
description:
|
||||||
@@ -145,6 +146,7 @@ options:
|
|||||||
aliases:
|
aliases:
|
||||||
- redirectUris
|
- redirectUris
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
|
|
||||||
web_origins:
|
web_origins:
|
||||||
description:
|
description:
|
||||||
@@ -153,6 +155,7 @@ options:
|
|||||||
aliases:
|
aliases:
|
||||||
- webOrigins
|
- webOrigins
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
|
|
||||||
not_before:
|
not_before:
|
||||||
description:
|
description:
|
||||||
@@ -708,9 +711,9 @@ def main():
|
|||||||
client_authenticator_type=dict(type='str', choices=['client-secret', 'client-jwt'], aliases=['clientAuthenticatorType']),
|
client_authenticator_type=dict(type='str', choices=['client-secret', 'client-jwt'], aliases=['clientAuthenticatorType']),
|
||||||
secret=dict(type='str', no_log=True),
|
secret=dict(type='str', no_log=True),
|
||||||
registration_access_token=dict(type='str', aliases=['registrationAccessToken'], no_log=True),
|
registration_access_token=dict(type='str', aliases=['registrationAccessToken'], no_log=True),
|
||||||
default_roles=dict(type='list', aliases=['defaultRoles']),
|
default_roles=dict(type='list', elements='str', aliases=['defaultRoles']),
|
||||||
redirect_uris=dict(type='list', aliases=['redirectUris']),
|
redirect_uris=dict(type='list', elements='str', aliases=['redirectUris']),
|
||||||
web_origins=dict(type='list', aliases=['webOrigins']),
|
web_origins=dict(type='list', elements='str', aliases=['webOrigins']),
|
||||||
not_before=dict(type='int', aliases=['notBefore']),
|
not_before=dict(type='int', aliases=['notBefore']),
|
||||||
bearer_only=dict(type='bool', aliases=['bearerOnly']),
|
bearer_only=dict(type='bool', aliases=['bearerOnly']),
|
||||||
consent_required=dict(type='bool', aliases=['consentRequired']),
|
consent_required=dict(type='bool', aliases=['consentRequired']),
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ description:
|
|||||||
options:
|
options:
|
||||||
search_terms:
|
search_terms:
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
description:
|
description:
|
||||||
- A list of one or more search terms.
|
- 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.
|
- 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),
|
master_password=dict(required=True, type='str', no_log=True),
|
||||||
secret_key=dict(type='str', no_log=True),
|
secret_key=dict(type='str', no_log=True),
|
||||||
), default=None),
|
), default=None),
|
||||||
search_terms=dict(required=True, type='list')
|
search_terms=dict(required=True, type='list', elements='dict'),
|
||||||
),
|
),
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -22,46 +22,56 @@ options:
|
|||||||
- The path to the bin directory of OpenDJ.
|
- The path to the bin directory of OpenDJ.
|
||||||
required: false
|
required: false
|
||||||
default: /opt/opendj/bin
|
default: /opt/opendj/bin
|
||||||
|
type: path
|
||||||
hostname:
|
hostname:
|
||||||
description:
|
description:
|
||||||
- The hostname of the OpenDJ server.
|
- The hostname of the OpenDJ server.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- The Admin port on which the OpenDJ instance is available.
|
- The Admin port on which the OpenDJ instance is available.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- The username to connect to.
|
- The username to connect to.
|
||||||
required: false
|
required: false
|
||||||
default: cn=Directory Manager
|
default: cn=Directory Manager
|
||||||
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- The password for the cn=Directory Manager user.
|
- The password for the cn=Directory Manager user.
|
||||||
- Either password or passwordfile is needed.
|
- Either password or passwordfile is needed.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
passwordfile:
|
passwordfile:
|
||||||
description:
|
description:
|
||||||
- Location to the password file which holds the password for the cn=Directory Manager user.
|
- Location to the password file which holds the password for the cn=Directory Manager user.
|
||||||
- Either password or passwordfile is needed.
|
- Either password or passwordfile is needed.
|
||||||
required: false
|
required: false
|
||||||
|
type: path
|
||||||
backend:
|
backend:
|
||||||
description:
|
description:
|
||||||
- The name of the backend on which the property needs to be updated.
|
- The name of the backend on which the property needs to be updated.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The configuration setting to update.
|
- The configuration setting to update.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
value:
|
value:
|
||||||
description:
|
description:
|
||||||
- The value for the configuration item.
|
- The value for the configuration item.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- If configuration needs to be added/updated
|
- If configuration needs to be added/updated
|
||||||
required: false
|
required: false
|
||||||
default: "present"
|
default: "present"
|
||||||
|
type: str
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ options:
|
|||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- The type of the monitor.
|
- 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
|
type: str
|
||||||
query:
|
query:
|
||||||
description:
|
description:
|
||||||
@@ -208,7 +209,9 @@ def main():
|
|||||||
api_host=dict(required=False),
|
api_host=dict(required=False),
|
||||||
app_key=dict(required=True, no_log=True),
|
app_key=dict(required=True, no_log=True),
|
||||||
state=dict(required=True, choices=['present', 'absent', 'mute', 'unmute']),
|
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),
|
name=dict(required=True),
|
||||||
query=dict(required=False),
|
query=dict(required=False),
|
||||||
notification_message=dict(required=False, no_log=True, default=None, aliases=['message'],
|
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":
|
if module.params['type'] == "service check":
|
||||||
options["thresholds"] = module.params['thresholds'] or {'ok': 1, 'critical': 1, 'warning': 1}
|
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']
|
options["thresholds"] = module.params['thresholds']
|
||||||
|
|
||||||
monitor = _get_monitor(module)
|
monitor = _get_monitor(module)
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ options:
|
|||||||
required: false
|
required: false
|
||||||
links:
|
links:
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
description:
|
description:
|
||||||
- See examples
|
- See examples
|
||||||
'''
|
'''
|
||||||
@@ -155,7 +156,7 @@ def main():
|
|||||||
description=dict(required=False),
|
description=dict(required=False),
|
||||||
start_time=dict(required=False, default=None, type='int'),
|
start_time=dict(required=False, default=None, type='int'),
|
||||||
end_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')
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -138,11 +138,11 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
name=dict(required=True),
|
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"),
|
plugin_bin=dict(default="/usr/share/logstash/bin/logstash-plugin", type="path"),
|
||||||
proxy_host=dict(default=None),
|
proxy_host=dict(),
|
||||||
proxy_port=dict(default=None),
|
proxy_port=dict(),
|
||||||
version=dict(default=None)
|
version=dict()
|
||||||
),
|
),
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ options:
|
|||||||
- ID of user making the request. Only needed when creating a maintenance_window.
|
- ID of user making the request. Only needed when creating a maintenance_window.
|
||||||
service:
|
service:
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
description:
|
description:
|
||||||
- A comma separated list of PagerDuty service IDs.
|
- A comma separated list of PagerDuty service IDs.
|
||||||
aliases: [ services ]
|
aliases: [ services ]
|
||||||
@@ -233,7 +234,7 @@ def main():
|
|||||||
name=dict(required=False),
|
name=dict(required=False),
|
||||||
user=dict(required=False),
|
user=dict(required=False),
|
||||||
token=dict(required=True, no_log=True),
|
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),
|
window_id=dict(required=False),
|
||||||
requester_id=dict(required=False),
|
requester_id=dict(required=False),
|
||||||
hours=dict(default='1', required=False), # @TODO change to int?
|
hours=dict(default='1', required=False), # @TODO change to int?
|
||||||
|
|||||||
170
plugins/modules/monitoring/statsd.py
Normal file
170
plugins/modules/monitoring/statsd.py
Normal 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()
|
||||||
@@ -59,11 +59,13 @@ options:
|
|||||||
default: "https://api.status.io"
|
default: "https://api.status.io"
|
||||||
components:
|
components:
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
description:
|
description:
|
||||||
- The given name of your component (server name)
|
- The given name of your component (server name)
|
||||||
aliases: ['component']
|
aliases: ['component']
|
||||||
containers:
|
containers:
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
description:
|
description:
|
||||||
- The given name of your container (data center)
|
- The given name of your container (data center)
|
||||||
aliases: ['container']
|
aliases: ['container']
|
||||||
@@ -339,9 +341,9 @@ def main():
|
|||||||
state=dict(required=False, default='present',
|
state=dict(required=False, default='present',
|
||||||
choices=['present', 'absent']),
|
choices=['present', 'absent']),
|
||||||
url=dict(default='https://api.status.io', required=False),
|
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']),
|
aliases=['component']),
|
||||||
containers=dict(type='list', required=False, default=None,
|
containers=dict(type='list', elements='str', required=False, default=None,
|
||||||
aliases=['container']),
|
aliases=['container']),
|
||||||
all_infrastructure_affected=dict(type='bool', default=False,
|
all_infrastructure_affected=dict(type='bool', default=False,
|
||||||
required=False),
|
required=False),
|
||||||
@@ -423,7 +425,7 @@ def main():
|
|||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
module.exit_json(changed=True)
|
module.exit_json(changed=True)
|
||||||
else:
|
else:
|
||||||
(rc, _, error) = create_maintenance(
|
(rc, dummy, error) = create_maintenance(
|
||||||
auth_headers, url, statuspage, host_ids,
|
auth_headers, url, statuspage, host_ids,
|
||||||
all_infrastructure_affected, automation,
|
all_infrastructure_affected, automation,
|
||||||
title, desc, returned_date, maintenance_notify_now,
|
title, desc, returned_date, maintenance_notify_now,
|
||||||
@@ -449,7 +451,7 @@ def main():
|
|||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
module.exit_json(changed=True)
|
module.exit_json(changed=True)
|
||||||
else:
|
else:
|
||||||
(rc, _, error) = delete_maintenance(
|
(rc, dummy, error) = delete_maintenance(
|
||||||
auth_headers, url, statuspage, maintenance_id)
|
auth_headers, url, statuspage, maintenance_id)
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
module.exit_json(
|
module.exit_json(
|
||||||
|
|||||||
@@ -40,10 +40,11 @@ options:
|
|||||||
description:
|
description:
|
||||||
- List of records to ensure they either exist or do not exist.
|
- List of records to ensure they either exist or do not exist.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- The type of DNS record to create.
|
- 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
|
type: str
|
||||||
ttl:
|
ttl:
|
||||||
description:
|
description:
|
||||||
@@ -167,9 +168,9 @@ def main():
|
|||||||
account_api_token=dict(type='str', no_log=True),
|
account_api_token=dict(type='str', no_log=True),
|
||||||
domain=dict(type='str'),
|
domain=dict(type='str'),
|
||||||
record=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',
|
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),
|
ttl=dict(type='int', default=3600),
|
||||||
value=dict(type='str'),
|
value=dict(type='str'),
|
||||||
priority=dict(type='int'),
|
priority=dict(type='int'),
|
||||||
|
|||||||
@@ -28,51 +28,64 @@ options:
|
|||||||
- Manage DNS record.
|
- Manage DNS record.
|
||||||
choices: ['present', 'absent']
|
choices: ['present', 'absent']
|
||||||
default: 'present'
|
default: 'present'
|
||||||
|
type: str
|
||||||
server:
|
server:
|
||||||
description:
|
description:
|
||||||
- Apply DNS modification on this server, specified by IPv4 or IPv6 address.
|
- Apply DNS modification on this server, specified by IPv4 or IPv6 address.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Use this TCP port when connecting to C(server).
|
- Use this TCP port when connecting to C(server).
|
||||||
default: 53
|
default: 53
|
||||||
|
type: int
|
||||||
key_name:
|
key_name:
|
||||||
description:
|
description:
|
||||||
- Use TSIG key name to authenticate against DNS C(server)
|
- Use TSIG key name to authenticate against DNS C(server)
|
||||||
|
type: str
|
||||||
key_secret:
|
key_secret:
|
||||||
description:
|
description:
|
||||||
- Use TSIG key secret, associated with C(key_name), to authenticate against C(server)
|
- Use TSIG key secret, associated with C(key_name), to authenticate against C(server)
|
||||||
|
type: str
|
||||||
key_algorithm:
|
key_algorithm:
|
||||||
description:
|
description:
|
||||||
- Specify key algorithm used by C(key_secret).
|
- 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',
|
choices: ['HMAC-MD5.SIG-ALG.REG.INT', 'hmac-md5', 'hmac-sha1', 'hmac-sha224', 'hmac-sha256', 'hmac-sha384',
|
||||||
'hmac-sha512']
|
'hmac-sha512']
|
||||||
default: 'hmac-md5'
|
default: 'hmac-md5'
|
||||||
|
type: str
|
||||||
zone:
|
zone:
|
||||||
description:
|
description:
|
||||||
- DNS record will be modified on this C(zone).
|
- DNS record will be modified on this C(zone).
|
||||||
- When omitted DNS will be queried to attempt finding the correct zone.
|
- When omitted DNS will be queried to attempt finding the correct zone.
|
||||||
- Starting with Ansible 2.7 this parameter is optional.
|
- Starting with Ansible 2.7 this parameter is optional.
|
||||||
|
type: str
|
||||||
record:
|
record:
|
||||||
description:
|
description:
|
||||||
- Sets the DNS record to modify. When zone is omitted this has to be absolute (ending with a dot).
|
- Sets the DNS record to modify. When zone is omitted this has to be absolute (ending with a dot).
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- Sets the record type.
|
- Sets the record type.
|
||||||
default: 'A'
|
default: 'A'
|
||||||
|
type: str
|
||||||
ttl:
|
ttl:
|
||||||
description:
|
description:
|
||||||
- Sets the record TTL.
|
- Sets the record TTL.
|
||||||
default: 3600
|
default: 3600
|
||||||
|
type: int
|
||||||
value:
|
value:
|
||||||
description:
|
description:
|
||||||
- Sets the record value.
|
- Sets the record value.
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
protocol:
|
protocol:
|
||||||
description:
|
description:
|
||||||
- Sets the transport protocol (TCP or UDP). TCP is the recommended and a more robust option.
|
- Sets the transport protocol (TCP or UDP). TCP is the recommended and a more robust option.
|
||||||
default: 'tcp'
|
default: 'tcp'
|
||||||
choices: ['tcp', 'udp']
|
choices: ['tcp', 'udp']
|
||||||
|
type: str
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
@@ -432,7 +445,7 @@ def main():
|
|||||||
record=dict(required=True, type='str'),
|
record=dict(required=True, type='str'),
|
||||||
type=dict(required=False, default='A', type='str'),
|
type=dict(required=False, default='A', type='str'),
|
||||||
ttl=dict(required=False, default=3600, type='int'),
|
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')
|
protocol=dict(required=False, default='tcp', choices=['tcp', 'udp'], type='str')
|
||||||
),
|
),
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Attach a list of OMAPI DHCP statements with host lease (without ending semicolon).
|
- Attach a list of OMAPI DHCP statements with host lease (without ending semicolon).
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
default: []
|
default: []
|
||||||
ddns:
|
ddns:
|
||||||
description:
|
description:
|
||||||
@@ -282,7 +283,7 @@ def main():
|
|||||||
hostname=dict(type='str', aliases=['name']),
|
hostname=dict(type='str', aliases=['name']),
|
||||||
ip=dict(type='str'),
|
ip=dict(type='str'),
|
||||||
ddns=dict(type='bool', default=False),
|
ddns=dict(type='bool', default=False),
|
||||||
statements=dict(type='list', default=[]),
|
statements=dict(type='list', elements='str', default=[]),
|
||||||
),
|
),
|
||||||
supports_check_mode=False,
|
supports_check_mode=False,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ options:
|
|||||||
- The email-address(es) the mail is being sent to.
|
- The email-address(es) the mail is being sent to.
|
||||||
- This is a list, which may contain address and phrase portions.
|
- This is a list, which may contain address and phrase portions.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
default: root
|
default: root
|
||||||
aliases: [ recipients ]
|
aliases: [ recipients ]
|
||||||
cc:
|
cc:
|
||||||
@@ -46,11 +47,13 @@ options:
|
|||||||
- The email-address(es) the mail is being copied to.
|
- The email-address(es) the mail is being copied to.
|
||||||
- This is a list, which may contain address and phrase portions.
|
- This is a list, which may contain address and phrase portions.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
bcc:
|
bcc:
|
||||||
description:
|
description:
|
||||||
- The email-address(es) the mail is being 'blind' copied to.
|
- The email-address(es) the mail is being 'blind' copied to.
|
||||||
- This is a list, which may contain address and phrase portions.
|
- This is a list, which may contain address and phrase portions.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
subject:
|
subject:
|
||||||
description:
|
description:
|
||||||
- The subject of the email being sent.
|
- The subject of the email being sent.
|
||||||
@@ -85,12 +88,14 @@ options:
|
|||||||
- A list of pathnames of files to attach to the message.
|
- A list of pathnames of files to attach to the message.
|
||||||
- Attached files will have their content-type set to C(application/octet-stream).
|
- Attached files will have their content-type set to C(application/octet-stream).
|
||||||
type: list
|
type: list
|
||||||
|
elements: path
|
||||||
default: []
|
default: []
|
||||||
headers:
|
headers:
|
||||||
description:
|
description:
|
||||||
- A list of headers which should be added to the message.
|
- A list of headers which should be added to the message.
|
||||||
- Each individual header is specified as C(header=value) (see example below).
|
- Each individual header is specified as C(header=value) (see example below).
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
default: []
|
default: []
|
||||||
charset:
|
charset:
|
||||||
description:
|
description:
|
||||||
@@ -211,13 +216,13 @@ def main():
|
|||||||
host=dict(type='str', default='localhost'),
|
host=dict(type='str', default='localhost'),
|
||||||
port=dict(type='int', default=25),
|
port=dict(type='int', default=25),
|
||||||
sender=dict(type='str', default='root', aliases=['from']),
|
sender=dict(type='str', default='root', aliases=['from']),
|
||||||
to=dict(type='list', default=['root'], aliases=['recipients']),
|
to=dict(type='list', elements='str', default=['root'], aliases=['recipients']),
|
||||||
cc=dict(type='list', default=[]),
|
cc=dict(type='list', elements='str', default=[]),
|
||||||
bcc=dict(type='list', default=[]),
|
bcc=dict(type='list', elements='str', default=[]),
|
||||||
subject=dict(type='str', required=True, aliases=['msg']),
|
subject=dict(type='str', required=True, aliases=['msg']),
|
||||||
body=dict(type='str'),
|
body=dict(type='str'),
|
||||||
attach=dict(type='list', default=[]),
|
attach=dict(type='list', elements='path', default=[]),
|
||||||
headers=dict(type='list', default=[]),
|
headers=dict(type='list', elements='str', default=[]),
|
||||||
charset=dict(type='str', default='utf-8'),
|
charset=dict(type='str', default='utf-8'),
|
||||||
subtype=dict(type='str', default='plain', choices=['html', 'plain']),
|
subtype=dict(type='str', default='plain', choices=['html', 'plain']),
|
||||||
secure=dict(type='str', default='try', choices=['always', 'never', 'starttls', 'try']),
|
secure=dict(type='str', default='try', choices=['always', 'never', 'starttls', 'try']),
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ options:
|
|||||||
required: true
|
required: true
|
||||||
dest:
|
dest:
|
||||||
type: list
|
type: list
|
||||||
|
elements: int
|
||||||
description:
|
description:
|
||||||
- Phone number(s) to send SMS message to
|
- Phone number(s) to send SMS message to
|
||||||
required: true
|
required: true
|
||||||
@@ -119,7 +120,7 @@ def main():
|
|||||||
api_key=dict(required=True, no_log=True),
|
api_key=dict(required=True, no_log=True),
|
||||||
api_secret=dict(required=True, no_log=True),
|
api_secret=dict(required=True, no_log=True),
|
||||||
src=dict(required=True, type='int'),
|
src=dict(required=True, type='int'),
|
||||||
dest=dict(required=True, type='list'),
|
dest=dict(required=True, type='list', elements='int'),
|
||||||
msg=dict(required=True),
|
msg=dict(required=True),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -45,11 +45,13 @@ options:
|
|||||||
- and above any sections or actions present.
|
- and above any sections or actions present.
|
||||||
actions:
|
actions:
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
description:
|
description:
|
||||||
- This array of objects will power the action links
|
- This array of objects will power the action links
|
||||||
- found at the bottom of the card.
|
- found at the bottom of the card.
|
||||||
sections:
|
sections:
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
description:
|
description:
|
||||||
- Contains a list of sections to display in the card.
|
- Contains a list of sections to display in the card.
|
||||||
- For more information see https://dev.outlook.com/Connectors/reference.
|
- For more information see https://dev.outlook.com/Connectors/reference.
|
||||||
@@ -264,8 +266,8 @@ def main():
|
|||||||
color=dict(type='str'),
|
color=dict(type='str'),
|
||||||
title=dict(type='str'),
|
title=dict(type='str'),
|
||||||
text=dict(type='str'),
|
text=dict(type='str'),
|
||||||
actions=dict(type='list'),
|
actions=dict(type='list', elements='dict'),
|
||||||
sections=dict(type='list')
|
sections=dict(type='list', elements='dict')
|
||||||
),
|
),
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ options:
|
|||||||
- 'danger'
|
- 'danger'
|
||||||
attachments:
|
attachments:
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
description:
|
description:
|
||||||
- Define a list of attachments.
|
- Define a list of attachments.
|
||||||
'''
|
'''
|
||||||
@@ -215,7 +216,7 @@ def main():
|
|||||||
link_names=dict(type='int', default=1, choices=[0, 1]),
|
link_names=dict(type='int', default=1, choices=[0, 1]),
|
||||||
validate_certs=dict(default=True, type='bool'),
|
validate_certs=dict(default=True, type='bool'),
|
||||||
color=dict(type='str', default='normal', choices=['normal', 'good', 'warning', 'danger']),
|
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)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ options:
|
|||||||
required: true
|
required: true
|
||||||
to_addresses:
|
to_addresses:
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
description:
|
description:
|
||||||
- A list with one or more recipient email addresses.
|
- A list with one or more recipient email addresses.
|
||||||
required: true
|
required: true
|
||||||
@@ -58,14 +59,17 @@ options:
|
|||||||
- Sendgrid API key to use instead of username/password.
|
- Sendgrid API key to use instead of username/password.
|
||||||
cc:
|
cc:
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
description:
|
description:
|
||||||
- A list of email addresses to cc.
|
- A list of email addresses to cc.
|
||||||
bcc:
|
bcc:
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
description:
|
description:
|
||||||
- A list of email addresses to bcc.
|
- A list of email addresses to bcc.
|
||||||
attachments:
|
attachments:
|
||||||
type: list
|
type: list
|
||||||
|
elements: path
|
||||||
description:
|
description:
|
||||||
- A list of relative or explicit paths of files you want to attach (7MB limit as per SendGrid docs).
|
- A list of relative or explicit paths of files you want to attach (7MB limit as per SendGrid docs).
|
||||||
from_name:
|
from_name:
|
||||||
@@ -209,16 +213,16 @@ def main():
|
|||||||
username=dict(required=False),
|
username=dict(required=False),
|
||||||
password=dict(required=False, no_log=True),
|
password=dict(required=False, no_log=True),
|
||||||
api_key=dict(required=False, no_log=True),
|
api_key=dict(required=False, no_log=True),
|
||||||
bcc=dict(required=False, type='list'),
|
bcc=dict(required=False, type='list', elements='str'),
|
||||||
cc=dict(required=False, type='list'),
|
cc=dict(required=False, type='list', elements='str'),
|
||||||
headers=dict(required=False, type='dict'),
|
headers=dict(required=False, type='dict'),
|
||||||
from_address=dict(required=True),
|
from_address=dict(required=True),
|
||||||
from_name=dict(required=False),
|
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),
|
subject=dict(required=True),
|
||||||
body=dict(required=True),
|
body=dict(required=True),
|
||||||
html_body=dict(required=False, default=False, type='bool'),
|
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,
|
supports_check_mode=True,
|
||||||
mutually_exclusive=[
|
mutually_exclusive=[
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ options:
|
|||||||
default: 'normal'
|
default: 'normal'
|
||||||
attachments:
|
attachments:
|
||||||
type: list
|
type: list
|
||||||
|
elements: dict
|
||||||
description:
|
description:
|
||||||
- Define a list of attachments. This list mirrors the Slack JSON API.
|
- Define a list of attachments. This list mirrors the Slack JSON API.
|
||||||
- For more information, see U(https://api.slack.com/docs/attachments).
|
- 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']),
|
parse=dict(type='str', default=None, choices=['none', 'full']),
|
||||||
validate_certs=dict(default=True, type='bool'),
|
validate_certs=dict(default=True, type='bool'),
|
||||||
color=dict(type='str', default='normal'),
|
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'),
|
blocks=dict(type='list', elements='dict'),
|
||||||
message_id=dict(type='str', default=None),
|
message_id=dict(type='str', default=None),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ options:
|
|||||||
required: true
|
required: true
|
||||||
to_numbers:
|
to_numbers:
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
description:
|
description:
|
||||||
one or more phone numbers to send the text message to,
|
one or more phone numbers to send the text message to,
|
||||||
format +15551112222
|
format +15551112222
|
||||||
@@ -143,7 +144,7 @@ def main():
|
|||||||
auth_token=dict(required=True, no_log=True),
|
auth_token=dict(required=True, no_log=True),
|
||||||
msg=dict(required=True),
|
msg=dict(required=True),
|
||||||
from_number=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),
|
media_url=dict(default=None, required=False),
|
||||||
),
|
),
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
|
|||||||
@@ -45,6 +45,12 @@ options:
|
|||||||
required: false
|
required: false
|
||||||
default: 'present'
|
default: 'present'
|
||||||
type: str
|
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 ]
|
requirements: [ homebrew ]
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@@ -127,7 +133,7 @@ def add_tap(module, brew_path, tap, url=None):
|
|||||||
|
|
||||||
def add_taps(module, brew_path, taps):
|
def add_taps(module, brew_path, taps):
|
||||||
'''Adds one or more 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:
|
for tap in taps:
|
||||||
(failed, changed, msg) = add_tap(module, brew_path, tap)
|
(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):
|
def remove_taps(module, brew_path, taps):
|
||||||
'''Removes one or more 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:
|
for tap in taps:
|
||||||
(failed, changed, msg) = remove_tap(module, brew_path, tap)
|
(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'),
|
name=dict(aliases=['tap'], type='list', required=True, elements='str'),
|
||||||
url=dict(default=None, required=False),
|
url=dict(default=None, required=False),
|
||||||
state=dict(default='present', choices=['present', 'absent']),
|
state=dict(default='present', choices=['present', 'absent']),
|
||||||
|
path=dict(
|
||||||
|
default="/usr/local/bin:/opt/homebrew/bin",
|
||||||
|
required=False,
|
||||||
|
type='path',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
path = module.params['path']
|
||||||
|
if path:
|
||||||
|
path = path.split(':')
|
||||||
|
|
||||||
brew_path = module.get_bin_path(
|
brew_path = module.get_bin_path(
|
||||||
'brew',
|
'brew',
|
||||||
required=True,
|
required=True,
|
||||||
opt_dirs=['/usr/local/bin', '/opt/homebrew/bin']
|
opt_dirs=path,
|
||||||
)
|
)
|
||||||
|
|
||||||
taps = module.params['name']
|
taps = module.params['name']
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ def get_package_state(names, pkg_spec, module):
|
|||||||
if stdout:
|
if stdout:
|
||||||
# If the requested package name is just a stem, like "python", we may
|
# If the requested package name is just a stem, like "python", we may
|
||||||
# find multiple packages with that name.
|
# 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'])
|
module.debug("get_package_state(): installed_names = %s" % pkg_spec[name]['installed_names'])
|
||||||
pkg_spec[name]['installed_state'] = True
|
pkg_spec[name]['installed_state'] = True
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ options:
|
|||||||
entitlements from a pool (the pool must support this). Mutually exclusive with I(pool).
|
entitlements from a pool (the pool must support this). Mutually exclusive with I(pool).
|
||||||
default: []
|
default: []
|
||||||
type: list
|
type: list
|
||||||
|
elements: raw
|
||||||
consumer_type:
|
consumer_type:
|
||||||
description:
|
description:
|
||||||
- The type of unit to register, defaults to system
|
- The type of unit to register, defaults to system
|
||||||
@@ -153,6 +154,7 @@ options:
|
|||||||
addons:
|
addons:
|
||||||
description: Syspurpose attribute addons
|
description: Syspurpose attribute addons
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
sync:
|
sync:
|
||||||
description:
|
description:
|
||||||
- When this option is true, then syspurpose attributes are synchronized with
|
- When this option is true, then syspurpose attributes are synchronized with
|
||||||
@@ -787,7 +789,7 @@ def main():
|
|||||||
'org_id': {},
|
'org_id': {},
|
||||||
'environment': {},
|
'environment': {},
|
||||||
'pool': {'default': '^$'},
|
'pool': {'default': '^$'},
|
||||||
'pool_ids': {'default': [], 'type': 'list'},
|
'pool_ids': {'default': [], 'type': 'list', 'elements': 'raw'},
|
||||||
'consumer_type': {},
|
'consumer_type': {},
|
||||||
'consumer_name': {},
|
'consumer_name': {},
|
||||||
'consumer_id': {},
|
'consumer_id': {},
|
||||||
@@ -803,7 +805,7 @@ def main():
|
|||||||
'role': {},
|
'role': {},
|
||||||
'usage': {},
|
'usage': {},
|
||||||
'service_level_agreement': {},
|
'service_level_agreement': {},
|
||||||
'addons': {'type': 'list'},
|
'addons': {'type': 'list', 'elements': 'str'},
|
||||||
'sync': {'type': 'bool', 'default': False}
|
'sync': {'type': 'bool', 'default': False}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -814,7 +816,7 @@ def main():
|
|||||||
mutually_exclusive=[['activationkey', 'username'],
|
mutually_exclusive=[['activationkey', 'username'],
|
||||||
['activationkey', 'consumer_id'],
|
['activationkey', 'consumer_id'],
|
||||||
['activationkey', 'environment'],
|
['activationkey', 'environment'],
|
||||||
['activationkey', 'autosubscribe'],
|
['activationkey', 'auto_attach'],
|
||||||
['pool', 'pool_ids']],
|
['pool', 'pool_ids']],
|
||||||
required_if=[['state', 'present', ['username', 'activationkey'], True]],
|
required_if=[['state', 'present', ['username', 'activationkey'], True]],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,18 +19,22 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Hostname or ip address of the BMC.
|
- Hostname or ip address of the BMC.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Remote RMCP port.
|
- Remote RMCP port.
|
||||||
default: 623
|
default: 623
|
||||||
|
type: int
|
||||||
user:
|
user:
|
||||||
description:
|
description:
|
||||||
- Username to use to connect to the BMC.
|
- Username to use to connect to the BMC.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password to connect to the BMC.
|
- Password to connect to the BMC.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
bootdev:
|
bootdev:
|
||||||
description:
|
description:
|
||||||
- Set boot device to use on next reboot
|
- Set boot device to use on next reboot
|
||||||
@@ -51,6 +55,7 @@ options:
|
|||||||
- optical
|
- optical
|
||||||
- setup
|
- setup
|
||||||
- default
|
- default
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether to ensure that boot devices is desired.
|
- Whether to ensure that boot devices is desired.
|
||||||
@@ -59,6 +64,7 @@ options:
|
|||||||
- absent -- Request system turn on"
|
- absent -- Request system turn on"
|
||||||
default: present
|
default: present
|
||||||
choices: [ present, absent ]
|
choices: [ present, absent ]
|
||||||
|
type: str
|
||||||
persistent:
|
persistent:
|
||||||
description:
|
description:
|
||||||
- If set, ask that system firmware uses this device beyond next boot.
|
- If set, ask that system firmware uses this device beyond next boot.
|
||||||
|
|||||||
@@ -19,18 +19,22 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Hostname or ip address of the BMC.
|
- Hostname or ip address of the BMC.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- Remote RMCP port.
|
- Remote RMCP port.
|
||||||
default: 623
|
default: 623
|
||||||
|
type: int
|
||||||
user:
|
user:
|
||||||
description:
|
description:
|
||||||
- Username to use to connect to the BMC.
|
- Username to use to connect to the BMC.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password to connect to the BMC.
|
- Password to connect to the BMC.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether to ensure that the machine in desired state.
|
- Whether to ensure that the machine in desired state.
|
||||||
@@ -42,10 +46,12 @@ options:
|
|||||||
- boot -- If system is off, then 'on', else 'reset'"
|
- boot -- If system is off, then 'on', else 'reset'"
|
||||||
choices: ['on', 'off', shutdown, reset, boot]
|
choices: ['on', 'off', shutdown, reset, boot]
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Maximum number of seconds before interrupt request.
|
- Maximum number of seconds before interrupt request.
|
||||||
default: 300
|
default: 300
|
||||||
|
type: int
|
||||||
requirements:
|
requirements:
|
||||||
- "python >= 2.6"
|
- "python >= 2.6"
|
||||||
- pyghmi
|
- pyghmi
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- List of commands to execute on OOB controller
|
- List of commands to execute on OOB controller
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
@@ -134,7 +135,7 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
category=dict(required=True),
|
category=dict(required=True),
|
||||||
command=dict(required=True, type='list'),
|
command=dict(required=True, type='list', elements='str'),
|
||||||
baseuri=dict(required=True),
|
baseuri=dict(required=True),
|
||||||
username=dict(required=True),
|
username=dict(required=True),
|
||||||
password=dict(required=True, no_log=True),
|
password=dict(required=True, no_log=True),
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ options:
|
|||||||
I(SetSystemAttributes) are mutually exclusive commands when C(category)
|
I(SetSystemAttributes) are mutually exclusive commands when C(category)
|
||||||
is I(Manager)
|
is I(Manager)
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
@@ -245,7 +246,7 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
category=dict(required=True),
|
category=dict(required=True),
|
||||||
command=dict(required=True, type='list'),
|
command=dict(required=True, type='list', elements='str'),
|
||||||
baseuri=dict(required=True),
|
baseuri=dict(required=True),
|
||||||
username=dict(required=True),
|
username=dict(required=True),
|
||||||
password=dict(required=True, no_log=True),
|
password=dict(required=True, no_log=True),
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ options:
|
|||||||
- C(GetManagerAttributes) returns the list of dicts containing iDRAC,
|
- C(GetManagerAttributes) returns the list of dicts containing iDRAC,
|
||||||
LifecycleController and System attributes
|
LifecycleController and System attributes
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
@@ -171,7 +172,7 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
category=dict(required=True),
|
category=dict(required=True),
|
||||||
command=dict(required=True, type='list'),
|
command=dict(required=True, type='list', elements='str'),
|
||||||
baseuri=dict(required=True),
|
baseuri=dict(required=True),
|
||||||
username=dict(required=True),
|
username=dict(required=True),
|
||||||
password=dict(required=True, no_log=True),
|
password=dict(required=True, no_log=True),
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- List of commands to execute on OOB controller
|
- List of commands to execute on OOB controller
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
@@ -550,7 +551,7 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
category=dict(required=True),
|
category=dict(required=True),
|
||||||
command=dict(required=True, type='list'),
|
command=dict(required=True, type='list', elements='str'),
|
||||||
baseuri=dict(required=True),
|
baseuri=dict(required=True),
|
||||||
username=dict(required=True),
|
username=dict(required=True),
|
||||||
password=dict(required=True, no_log=True),
|
password=dict(required=True, no_log=True),
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- List of commands to execute on OOB controller
|
- List of commands to execute on OOB controller
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
@@ -228,7 +229,7 @@ def main():
|
|||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
category=dict(required=True),
|
category=dict(required=True),
|
||||||
command=dict(required=True, type='list'),
|
command=dict(required=True, type='list', elements='str'),
|
||||||
baseuri=dict(required=True),
|
baseuri=dict(required=True),
|
||||||
username=dict(required=True),
|
username=dict(required=True),
|
||||||
password=dict(required=True, no_log=True),
|
password=dict(required=True, no_log=True),
|
||||||
|
|||||||
@@ -24,11 +24,13 @@ options:
|
|||||||
- List of categories to execute on OOB controller
|
- List of categories to execute on OOB controller
|
||||||
default: ['Systems']
|
default: ['Systems']
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
command:
|
command:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- List of commands to execute on OOB controller
|
- List of commands to execute on OOB controller
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
@@ -296,8 +298,8 @@ def main():
|
|||||||
category_list = []
|
category_list = []
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
category=dict(type='list', default=['Systems']),
|
category=dict(type='list', elements='str', default=['Systems']),
|
||||||
command=dict(type='list'),
|
command=dict(type='list', elements='str'),
|
||||||
baseuri=dict(required=True),
|
baseuri=dict(required=True),
|
||||||
username=dict(required=True),
|
username=dict(required=True),
|
||||||
password=dict(required=True, no_log=True),
|
password=dict(required=True, no_log=True),
|
||||||
|
|||||||
@@ -22,15 +22,18 @@ options:
|
|||||||
- SSH or HTTP protocol address of the parent branch.
|
- SSH or HTTP protocol address of the parent branch.
|
||||||
aliases: [ parent ]
|
aliases: [ parent ]
|
||||||
required: yes
|
required: yes
|
||||||
|
type: str
|
||||||
dest:
|
dest:
|
||||||
description:
|
description:
|
||||||
- Absolute path of where the branch should be cloned to.
|
- Absolute path of where the branch should be cloned to.
|
||||||
required: yes
|
required: yes
|
||||||
|
type: path
|
||||||
version:
|
version:
|
||||||
description:
|
description:
|
||||||
- What version of the branch to clone. This can be the
|
- What version of the branch to clone. This can be the
|
||||||
bzr revno or revid.
|
bzr revno or revid.
|
||||||
default: head
|
default: head
|
||||||
|
type: str
|
||||||
force:
|
force:
|
||||||
description:
|
description:
|
||||||
- If C(yes), any modified files in the working
|
- If C(yes), any modified files in the working
|
||||||
@@ -42,6 +45,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Path to bzr executable to use. If not supplied,
|
- Path to bzr executable to use. If not supplied,
|
||||||
the normal mechanism for resolving binary paths will be used.
|
the normal mechanism for resolving binary paths will be used.
|
||||||
|
type: str
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ config_values:
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.six.moves import shlex_quote
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@@ -230,7 +229,7 @@ def main():
|
|||||||
# Run from root directory to avoid accidentally picking up any local config settings
|
# Run from root directory to avoid accidentally picking up any local config settings
|
||||||
dir = "/"
|
dir = "/"
|
||||||
|
|
||||||
(rc, out, err) = module.run_command(' '.join(args), cwd=dir)
|
(rc, out, err) = module.run_command(args, cwd=dir, expand_user_and_vars=False)
|
||||||
if params['list_all'] and scope and rc == 128 and 'unable to read config file' in err:
|
if params['list_all'] and scope and rc == 128 and 'unable to read config file' in err:
|
||||||
# This just means nothing has been set at the given scope
|
# This just means nothing has been set at the given scope
|
||||||
module.exit_json(changed=False, msg='', config_values={})
|
module.exit_json(changed=False, msg='', config_values={})
|
||||||
@@ -259,15 +258,14 @@ def main():
|
|||||||
args.insert(len(args) - 1, "--" + unset)
|
args.insert(len(args) - 1, "--" + unset)
|
||||||
cmd = args
|
cmd = args
|
||||||
else:
|
else:
|
||||||
new_value_quoted = shlex_quote(new_value)
|
cmd = args + [new_value]
|
||||||
cmd = args + [new_value_quoted]
|
|
||||||
try: # try using extra parameter from ansible-base 2.10.4 onwards
|
try: # try using extra parameter from ansible-base 2.10.4 onwards
|
||||||
(rc, out, err) = module.run_command(cmd, cwd=dir, ignore_invalid_cwd=False)
|
(rc, out, err) = module.run_command(cmd, cwd=dir, ignore_invalid_cwd=False, expand_user_and_vars=False)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
# @TODO remove try/except when community.general drop support for 2.10.x
|
# @TODO remove try/except when community.general drop support for 2.10.x
|
||||||
if not os.path.isdir(dir):
|
if not os.path.isdir(dir):
|
||||||
module.fail_json(msg="Cannot find directory '{0}'".format(dir))
|
module.fail_json(msg="Cannot find directory '{0}'".format(dir))
|
||||||
(rc, out, err) = module.run_command(cmd, cwd=dir)
|
(rc, out, err) = module.run_command(cmd, cwd=dir, expand_user_and_vars=False)
|
||||||
if err:
|
if err:
|
||||||
module.fail_json(rc=rc, msg=err, cmd=cmd)
|
module.fail_json(rc=rc, msg=err, cmd=cmd)
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ options:
|
|||||||
registration_token:
|
registration_token:
|
||||||
description:
|
description:
|
||||||
- The registration token is used to register new runners.
|
- The registration token is used to register new runners.
|
||||||
required: True
|
- Required if I(state) is C(present).
|
||||||
type: str
|
type: str
|
||||||
owned:
|
owned:
|
||||||
description:
|
description:
|
||||||
@@ -99,6 +99,7 @@ options:
|
|||||||
required: False
|
required: False
|
||||||
default: []
|
default: []
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
@@ -304,12 +305,12 @@ def main():
|
|||||||
description=dict(type='str', required=True, aliases=["name"]),
|
description=dict(type='str', required=True, aliases=["name"]),
|
||||||
active=dict(type='bool', default=True),
|
active=dict(type='bool', default=True),
|
||||||
owned=dict(type='bool', default=False),
|
owned=dict(type='bool', default=False),
|
||||||
tag_list=dict(type='list', default=[]),
|
tag_list=dict(type='list', elements='str', default=[]),
|
||||||
run_untagged=dict(type='bool', default=True),
|
run_untagged=dict(type='bool', default=True),
|
||||||
locked=dict(type='bool', default=False),
|
locked=dict(type='bool', default=False),
|
||||||
access_level=dict(type='str', default='ref_protected', choices=["not_protected", "ref_protected"]),
|
access_level=dict(type='str', default='ref_protected', choices=["not_protected", "ref_protected"]),
|
||||||
maximum_timeout=dict(type='int', default=3600),
|
maximum_timeout=dict(type='int', default=3600),
|
||||||
registration_token=dict(type='str', required=True, no_log=True),
|
registration_token=dict(type='str', no_log=True),
|
||||||
state=dict(type='str', default="present", choices=["absent", "present"]),
|
state=dict(type='str', default="present", choices=["absent", "present"]),
|
||||||
))
|
))
|
||||||
|
|
||||||
@@ -325,6 +326,9 @@ def main():
|
|||||||
required_one_of=[
|
required_one_of=[
|
||||||
['api_username', 'api_token'],
|
['api_username', 'api_token'],
|
||||||
],
|
],
|
||||||
|
required_if=[
|
||||||
|
('state', 'present', ['registration_token']),
|
||||||
|
],
|
||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -21,15 +21,18 @@ options:
|
|||||||
- The repository address.
|
- The repository address.
|
||||||
required: yes
|
required: yes
|
||||||
aliases: [ name ]
|
aliases: [ name ]
|
||||||
|
type: str
|
||||||
dest:
|
dest:
|
||||||
description:
|
description:
|
||||||
- Absolute path of where the repository should be cloned to.
|
- Absolute path of where the repository should be cloned to.
|
||||||
This parameter is required, unless clone and update are set to no
|
This parameter is required, unless clone and update are set to no
|
||||||
|
type: path
|
||||||
revision:
|
revision:
|
||||||
description:
|
description:
|
||||||
- Equivalent C(-r) option in hg command which could be the changeset, revision number,
|
- Equivalent C(-r) option in hg command which could be the changeset, revision number,
|
||||||
branch name or even tag.
|
branch name or even tag.
|
||||||
aliases: [ version ]
|
aliases: [ version ]
|
||||||
|
type: str
|
||||||
force:
|
force:
|
||||||
description:
|
description:
|
||||||
- Discards uncommitted changes. Runs C(hg update -C). Prior to
|
- Discards uncommitted changes. Runs C(hg update -C). Prior to
|
||||||
@@ -55,6 +58,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Path to hg executable to use. If not supplied,
|
- Path to hg executable to use. If not supplied,
|
||||||
the normal mechanism for resolving binary paths will be used.
|
the normal mechanism for resolving binary paths will be used.
|
||||||
|
type: str
|
||||||
notes:
|
notes:
|
||||||
- This module does not support push capability. See U(https://github.com/ansible/ansible/issues/31156).
|
- This module does not support push capability. See U(https://github.com/ansible/ansible/issues/31156).
|
||||||
- "If the task seems to be hanging, first verify remote host is in C(known_hosts).
|
- "If the task seems to be hanging, first verify remote host is in C(known_hosts).
|
||||||
|
|||||||
1
plugins/modules/statsd.py
Symbolic link
1
plugins/modules/statsd.py
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
monitoring/statsd.py
|
||||||
@@ -29,10 +29,12 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Name of the Storage group to manage.
|
- Name of the Storage group to manage.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
lunid:
|
lunid:
|
||||||
description:
|
description:
|
||||||
- Lun id to be added.
|
- Lun id to be added.
|
||||||
required: true
|
required: true
|
||||||
|
type: int
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Indicates the desired lunid state.
|
- Indicates the desired lunid state.
|
||||||
@@ -40,6 +42,7 @@ options:
|
|||||||
- C(absent) ensures specified lunid is absent from Storage Group.
|
- C(absent) ensures specified lunid is absent from Storage Group.
|
||||||
default: present
|
default: present
|
||||||
choices: [ "present", "absent"]
|
choices: [ "present", "absent"]
|
||||||
|
type: str
|
||||||
|
|
||||||
|
|
||||||
author:
|
author:
|
||||||
|
|||||||
@@ -23,51 +23,63 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Name of the domain to be managed.
|
- Name of the domain to be managed.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- The desired state of the domain.
|
- The desired state of the domain.
|
||||||
default: "present"
|
default: "present"
|
||||||
choices: [ "present", "absent" ]
|
choices: [ "present", "absent" ]
|
||||||
|
type: str
|
||||||
ldap_id:
|
ldap_id:
|
||||||
description:
|
description:
|
||||||
- ldap id to add to the domain.
|
- ldap id to add to the domain.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
size:
|
size:
|
||||||
description:
|
description:
|
||||||
- Size of the domain.
|
- Size of the domain.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
hard_capacity:
|
hard_capacity:
|
||||||
description:
|
description:
|
||||||
- Hard capacity of the domain.
|
- Hard capacity of the domain.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
soft_capacity:
|
soft_capacity:
|
||||||
description:
|
description:
|
||||||
- Soft capacity of the domain.
|
- Soft capacity of the domain.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
max_cgs:
|
max_cgs:
|
||||||
description:
|
description:
|
||||||
- Number of max cgs.
|
- Number of max cgs.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
max_dms:
|
max_dms:
|
||||||
description:
|
description:
|
||||||
- Number of max dms.
|
- Number of max dms.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
max_mirrors:
|
max_mirrors:
|
||||||
description:
|
description:
|
||||||
- Number of max_mirrors.
|
- Number of max_mirrors.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
max_pools:
|
max_pools:
|
||||||
description:
|
description:
|
||||||
- Number of max_pools.
|
- Number of max_pools.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
max_volumes:
|
max_volumes:
|
||||||
description:
|
description:
|
||||||
- Number of max_volumes.
|
- Number of max_volumes.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
perf_class:
|
perf_class:
|
||||||
description:
|
description:
|
||||||
- Add the domain to a performance class.
|
- Add the domain to a performance class.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.ibm_storage
|
- community.general.ibm_storage
|
||||||
|
|||||||
@@ -22,15 +22,18 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Host name.
|
- Host name.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Host state.
|
- Host state.
|
||||||
default: "present"
|
default: "present"
|
||||||
choices: [ "present", "absent" ]
|
choices: [ "present", "absent" ]
|
||||||
|
type: str
|
||||||
cluster:
|
cluster:
|
||||||
description:
|
description:
|
||||||
- The name of the cluster to include the host.
|
- The name of the cluster to include the host.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
domain:
|
domain:
|
||||||
description:
|
description:
|
||||||
- The domains the cluster will be attached to.
|
- The domains the cluster will be attached to.
|
||||||
@@ -38,15 +41,18 @@ options:
|
|||||||
separate domain names with commas.
|
separate domain names with commas.
|
||||||
To include all existing domains, use an asterisk ("*").
|
To include all existing domains, use an asterisk ("*").
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
iscsi_chap_name:
|
iscsi_chap_name:
|
||||||
description:
|
description:
|
||||||
- The host's CHAP name identifier
|
- The host's CHAP name identifier
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
iscsi_chap_secret:
|
iscsi_chap_secret:
|
||||||
description:
|
description:
|
||||||
- The password of the initiator used to
|
- The password of the initiator used to
|
||||||
authenticate to the system when CHAP is enable
|
authenticate to the system when CHAP is enable
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.ibm_storage
|
- community.general.ibm_storage
|
||||||
|
|||||||
@@ -23,28 +23,32 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Host name.
|
- Host name.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Host ports state.
|
- Host ports state.
|
||||||
default: "present"
|
default: "present"
|
||||||
choices: [ "present", "absent" ]
|
choices: [ "present", "absent" ]
|
||||||
|
type: str
|
||||||
iscsi_name:
|
iscsi_name:
|
||||||
description:
|
description:
|
||||||
- iSCSI initiator name.
|
- iSCSI initiator name.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
fcaddress:
|
fcaddress:
|
||||||
description:
|
description:
|
||||||
- Fiber channel address.
|
- Fiber channel address.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
num_of_visible_targets:
|
num_of_visible_targets:
|
||||||
description:
|
description:
|
||||||
- Number of visible targets.
|
- Number of visible targets.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.ibm_storage
|
- community.general.ibm_storage
|
||||||
|
|
||||||
|
|
||||||
author:
|
author:
|
||||||
- Tzur Eliyahu (@tzure)
|
- Tzur Eliyahu (@tzure)
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -22,27 +22,33 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Pool name.
|
- Pool name.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Pool state.
|
- Pool state.
|
||||||
default: "present"
|
default: "present"
|
||||||
choices: [ "present", "absent" ]
|
choices: [ "present", "absent" ]
|
||||||
|
type: str
|
||||||
size:
|
size:
|
||||||
description:
|
description:
|
||||||
- Pool size in GB
|
- Pool size in GB
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
snapshot_size:
|
snapshot_size:
|
||||||
description:
|
description:
|
||||||
- Pool snapshot size in GB
|
- Pool snapshot size in GB
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
domain:
|
domain:
|
||||||
description:
|
description:
|
||||||
- Adds the pool to the specified domain.
|
- Adds the pool to the specified domain.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
perf_class:
|
perf_class:
|
||||||
description:
|
description:
|
||||||
- Assigns a perf_class to the pool.
|
- Assigns a perf_class to the pool.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.ibm_storage
|
- community.general.ibm_storage
|
||||||
|
|||||||
@@ -22,19 +22,23 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Volume name.
|
- Volume name.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
pool:
|
pool:
|
||||||
description:
|
description:
|
||||||
- Volume pool.
|
- Volume pool.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Volume state.
|
- Volume state.
|
||||||
default: "present"
|
default: "present"
|
||||||
choices: [ "present", "absent" ]
|
choices: [ "present", "absent" ]
|
||||||
|
type: str
|
||||||
size:
|
size:
|
||||||
description:
|
description:
|
||||||
- Volume size.
|
- Volume size.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.ibm_storage
|
- community.general.ibm_storage
|
||||||
|
|||||||
@@ -24,29 +24,35 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Volume name.
|
- Volume name.
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
default: "present"
|
default: "present"
|
||||||
choices: [ "present", "absent" ]
|
choices: [ "present", "absent" ]
|
||||||
description:
|
description:
|
||||||
- When the state is present the volume is mapped.
|
- When the state is present the volume is mapped.
|
||||||
When the state is absent, the volume is meant to be unmapped.
|
When the state is absent, the volume is meant to be unmapped.
|
||||||
|
type: str
|
||||||
|
|
||||||
cluster:
|
cluster:
|
||||||
description:
|
description:
|
||||||
- Maps the volume to a cluster.
|
- Maps the volume to a cluster.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
host:
|
host:
|
||||||
description:
|
description:
|
||||||
- Maps the volume to a host.
|
- Maps the volume to a host.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
lun:
|
lun:
|
||||||
description:
|
description:
|
||||||
- The LUN identifier.
|
- The LUN identifier.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
override:
|
override:
|
||||||
description:
|
description:
|
||||||
- Overrides the existing volume mapping.
|
- Overrides the existing volume mapping.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.ibm_storage
|
- community.general.ibm_storage
|
||||||
|
|||||||
@@ -26,25 +26,28 @@ options:
|
|||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Returns "info"
|
- Returns "info"
|
||||||
default: "info"
|
default: info
|
||||||
choices: ['info']
|
choices: [info]
|
||||||
|
type: str
|
||||||
gather_subset:
|
gather_subset:
|
||||||
description:
|
description:
|
||||||
- When supplied, this argument will restrict the facts collected
|
- When supplied, this argument will restrict the facts collected
|
||||||
to a given subset. Possible values for this argument include
|
to a given subset. Possible values for this argument include
|
||||||
"aggregate_info", "cluster_node_info", "igroup_info", "lun_info", "net_dns_info",
|
C(aggregate_info), C(cluster_node_info), C(igroup_info), C(lun_info), C(net_dns_info),
|
||||||
"net_ifgrp_info",
|
C(net_ifgrp_info),
|
||||||
"net_interface_info", "net_port_info", "nvme_info", "nvme_interface_info",
|
C(net_interface_info), C(net_port_info), C(nvme_info), C(nvme_interface_info),
|
||||||
"nvme_namespace_info", "nvme_subsystem_info", "ontap_version",
|
C(nvme_namespace_info), C(nvme_subsystem_info), C(ontap_version),
|
||||||
"qos_adaptive_policy_info", "qos_policy_info", "security_key_manager_key_info",
|
C(qos_adaptive_policy_info), C(qos_policy_info), C(security_key_manager_key_info),
|
||||||
"security_login_account_info", "storage_failover_info", "volume_info",
|
C(security_login_account_info), C(storage_failover_info), C(volume_info),
|
||||||
"vserver_info", "vserver_login_banner_info", "vserver_motd_info", "vserver_nfs_info"
|
C(vserver_info), C(vserver_login_banner_info), C(vserver_motd_info), C(vserver_nfs_info)
|
||||||
Can specify a list of values to include a larger subset. Values can also be used
|
Can specify a list of values to include a larger subset. Values can also be used
|
||||||
with an initial C(M(!)) to specify that a specific subset should
|
with an initial C(M(!)) to specify that a specific subset should
|
||||||
not be collected.
|
not be collected.
|
||||||
- nvme is supported with ONTAP 9.4 onwards.
|
- nvme is supported with ONTAP 9.4 onwards.
|
||||||
- use "help" to get a list of supported facts for your system.
|
- use C(help) to get a list of supported facts for your system.
|
||||||
default: "all"
|
default: all
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
@@ -582,7 +585,7 @@ def main():
|
|||||||
argument_spec = netapp_utils.na_ontap_host_argument_spec()
|
argument_spec = netapp_utils.na_ontap_host_argument_spec()
|
||||||
argument_spec.update(dict(
|
argument_spec.update(dict(
|
||||||
state=dict(default='info', choices=['info']),
|
state=dict(default='info', choices=['info']),
|
||||||
gather_subset=dict(default=['all'], type='list'),
|
gather_subset=dict(default=['all'], type='list', elements='str'),
|
||||||
))
|
))
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- File system, snapshot or volume name e.g. C(rpool/myfs).
|
- File system, snapshot or volume name e.g. C(rpool/myfs).
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether to create (C(present)), or remove (C(absent)) a
|
- Whether to create (C(present)), or remove (C(absent)) a
|
||||||
@@ -26,13 +27,16 @@ options:
|
|||||||
will be created/destroyed as needed to reach the desired state.
|
will be created/destroyed as needed to reach the desired state.
|
||||||
choices: [ absent, present ]
|
choices: [ absent, present ]
|
||||||
required: true
|
required: true
|
||||||
|
type: str
|
||||||
origin:
|
origin:
|
||||||
description:
|
description:
|
||||||
- Snapshot from which to create a clone.
|
- Snapshot from which to create a clone.
|
||||||
|
type: str
|
||||||
extra_zfs_properties:
|
extra_zfs_properties:
|
||||||
description:
|
description:
|
||||||
- A dictionary of zfs properties to be set.
|
- A dictionary of zfs properties to be set.
|
||||||
- See the zfs(8) man page for more information.
|
- See the zfs(8) man page for more information.
|
||||||
|
type: dict
|
||||||
author:
|
author:
|
||||||
- Johan Wiren (@johanwiren)
|
- Johan Wiren (@johanwiren)
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -32,14 +32,17 @@ options:
|
|||||||
- When set to C(absent), removes permissions from the specified entities, or removes all permissions if no entity params are specified.
|
- When set to C(absent), removes permissions from the specified entities, or removes all permissions if no entity params are specified.
|
||||||
choices: [ absent, present ]
|
choices: [ absent, present ]
|
||||||
default: present
|
default: present
|
||||||
|
type: str
|
||||||
users:
|
users:
|
||||||
description:
|
description:
|
||||||
- List of users to whom permission(s) should be granted.
|
- List of users to whom permission(s) should be granted.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
groups:
|
groups:
|
||||||
description:
|
description:
|
||||||
- List of groups to whom permission(s) should be granted.
|
- List of groups to whom permission(s) should be granted.
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
everyone:
|
everyone:
|
||||||
description:
|
description:
|
||||||
- Apply permissions to everyone.
|
- Apply permissions to everyone.
|
||||||
@@ -50,6 +53,7 @@ options:
|
|||||||
- The list of permission(s) to delegate (required if C(state) is C(present)).
|
- The list of permission(s) to delegate (required if C(state) is C(present)).
|
||||||
type: list
|
type: list
|
||||||
choices: [ allow, clone, create, destroy, diff, hold, mount, promote, readonly, receive, release, rename, rollback, send, share, snapshot, unallow ]
|
choices: [ allow, clone, create, destroy, diff, hold, mount, promote, readonly, receive, release, rename, rollback, send, share, snapshot, unallow ]
|
||||||
|
elements: str
|
||||||
local:
|
local:
|
||||||
description:
|
description:
|
||||||
- Apply permissions to C(name) locally (C(zfs allow -l)).
|
- Apply permissions to C(name) locally (C(zfs allow -l)).
|
||||||
@@ -241,10 +245,10 @@ def main():
|
|||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
name=dict(type='str', required=True),
|
name=dict(type='str', required=True),
|
||||||
state=dict(type='str', default='present', choices=['absent', 'present']),
|
state=dict(type='str', default='present', choices=['absent', 'present']),
|
||||||
users=dict(type='list'),
|
users=dict(type='list', elements='str'),
|
||||||
groups=dict(type='list'),
|
groups=dict(type='list', elements='str'),
|
||||||
everyone=dict(type='bool', default=False),
|
everyone=dict(type='bool', default=False),
|
||||||
permissions=dict(type='list',
|
permissions=dict(type='list', elements='str',
|
||||||
choices=['allow', 'clone', 'create', 'destroy', 'diff', 'hold', 'mount', 'promote',
|
choices=['allow', 'clone', 'create', 'destroy', 'diff', 'hold', 'mount', 'promote',
|
||||||
'readonly', 'receive', 'release', 'rename', 'rollback', 'send', 'share',
|
'readonly', 'receive', 'release', 'rename', 'rollback', 'send', 'share',
|
||||||
'snapshot', 'unallow']),
|
'snapshot', 'unallow']),
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ options:
|
|||||||
- ZFS dataset name.
|
- ZFS dataset name.
|
||||||
required: yes
|
required: yes
|
||||||
aliases: [ "ds", "dataset" ]
|
aliases: [ "ds", "dataset" ]
|
||||||
|
type: str
|
||||||
recurse:
|
recurse:
|
||||||
description:
|
description:
|
||||||
- Specifies if properties for any children should be recursively
|
- Specifies if properties for any children should be recursively
|
||||||
@@ -38,15 +39,18 @@ options:
|
|||||||
- Specifies which dataset properties should be queried in comma-separated format.
|
- Specifies which dataset properties should be queried in comma-separated format.
|
||||||
For more information about dataset properties, check zfs(1M) man page.
|
For more information about dataset properties, check zfs(1M) man page.
|
||||||
default: all
|
default: all
|
||||||
|
type: str
|
||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- Specifies which datasets types to display. Multiple values have to be
|
- Specifies which datasets types to display. Multiple values have to be
|
||||||
provided in comma-separated form.
|
provided in comma-separated form.
|
||||||
choices: [ 'all', 'filesystem', 'volume', 'snapshot', 'bookmark' ]
|
choices: [ 'all', 'filesystem', 'volume', 'snapshot', 'bookmark' ]
|
||||||
default: all
|
default: all
|
||||||
|
type: str
|
||||||
depth:
|
depth:
|
||||||
description:
|
description:
|
||||||
- Specifies recursion depth.
|
- Specifies recursion depth.
|
||||||
|
type: int
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ options:
|
|||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- ZFS pool name.
|
- ZFS pool name.
|
||||||
|
type: str
|
||||||
aliases: [ "pool", "zpool" ]
|
aliases: [ "pool", "zpool" ]
|
||||||
required: false
|
required: false
|
||||||
parsable:
|
parsable:
|
||||||
@@ -32,6 +33,7 @@ options:
|
|||||||
description:
|
description:
|
||||||
- Specifies which dataset properties should be queried in comma-separated format.
|
- Specifies which dataset properties should be queried in comma-separated format.
|
||||||
For more information about dataset properties, check zpool(1M) man page.
|
For more information about dataset properties, check zpool(1M) man page.
|
||||||
|
type: str
|
||||||
default: all
|
default: all
|
||||||
required: false
|
required: false
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ def main():
|
|||||||
all_alternatives = []
|
all_alternatives = []
|
||||||
|
|
||||||
# Run `update-alternatives --display <name>` to find existing alternatives
|
# Run `update-alternatives --display <name>` to find existing alternatives
|
||||||
(rc, display_output, _) = module.run_command(
|
(rc, display_output, dummy) = module.run_command(
|
||||||
['env', 'LC_ALL=C', UPDATE_ALTERNATIVES, '--display', name]
|
['env', 'LC_ALL=C', UPDATE_ALTERNATIVES, '--display', name]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ def main():
|
|||||||
#
|
#
|
||||||
# This is only compatible on Debian-based systems, as the other
|
# This is only compatible on Debian-based systems, as the other
|
||||||
# alternatives don't have --query available
|
# alternatives don't have --query available
|
||||||
rc, query_output, _ = module.run_command(
|
rc, query_output, dummy = module.run_command(
|
||||||
['env', 'LC_ALL=C', UPDATE_ALTERNATIVES, '--query', name]
|
['env', 'LC_ALL=C', UPDATE_ALTERNATIVES, '--query', name]
|
||||||
)
|
)
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ class BE(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def exists(self):
|
def exists(self):
|
||||||
(rc, out, _) = self._beadm_list()
|
(rc, out, dummy) = self._beadm_list()
|
||||||
|
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
if self._find_be_by_name(out):
|
if self._find_be_by_name(out):
|
||||||
@@ -202,7 +202,7 @@ class BE(object):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def is_activated(self):
|
def is_activated(self):
|
||||||
(rc, out, _) = self._beadm_list()
|
(rc, out, dummy) = self._beadm_list()
|
||||||
|
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
line = self._find_be_by_name(out)
|
line = self._find_be_by_name(out)
|
||||||
@@ -257,7 +257,7 @@ class BE(object):
|
|||||||
return self.module.run_command(cmd)
|
return self.module.run_command(cmd)
|
||||||
|
|
||||||
def is_mounted(self):
|
def is_mounted(self):
|
||||||
(rc, out, _) = self._beadm_list()
|
(rc, out, dummy) = self._beadm_list()
|
||||||
|
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
line = self._find_be_by_name(out)
|
line = self._find_be_by_name(out)
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ class CronVar(object):
|
|||||||
var_names = []
|
var_names = []
|
||||||
for l in self.lines:
|
for l in self.lines:
|
||||||
try:
|
try:
|
||||||
(var_name, _) = self.parse_for_var(l)
|
var_name, dummy = self.parse_for_var(l)
|
||||||
var_names.append(var_name)
|
var_names.append(var_name)
|
||||||
except CronVarError:
|
except CronVarError:
|
||||||
pass
|
pass
|
||||||
@@ -242,7 +242,7 @@ class CronVar(object):
|
|||||||
newlines = []
|
newlines = []
|
||||||
for l in self.lines:
|
for l in self.lines:
|
||||||
try:
|
try:
|
||||||
(varname, _) = self.parse_for_var(l) # Throws if not a var line
|
varname, dummy = self.parse_for_var(l) # Throws if not a var line
|
||||||
if varname == insertbefore:
|
if varname == insertbefore:
|
||||||
newlines.append("%s=%s" % (name, value))
|
newlines.append("%s=%s" % (name, value))
|
||||||
newlines.append(l)
|
newlines.append(l)
|
||||||
@@ -263,7 +263,7 @@ class CronVar(object):
|
|||||||
newlines = []
|
newlines = []
|
||||||
for l in self.lines:
|
for l in self.lines:
|
||||||
try:
|
try:
|
||||||
(varname, _) = self.parse_for_var(l) # Throws if not a var line
|
varname, dummy = self.parse_for_var(l) # Throws if not a var line
|
||||||
if varname != name:
|
if varname != name:
|
||||||
raise CronVarError # Append.
|
raise CronVarError # Append.
|
||||||
if not remove:
|
if not remove:
|
||||||
@@ -377,7 +377,7 @@ def main():
|
|||||||
|
|
||||||
# if requested make a backup before making a change
|
# if requested make a backup before making a change
|
||||||
if backup:
|
if backup:
|
||||||
(_, backup_file) = tempfile.mkstemp(prefix='cronvar')
|
dummy, backup_file = tempfile.mkstemp(prefix='cronvar')
|
||||||
cronvar.write(backup_file)
|
cronvar.write(backup_file)
|
||||||
|
|
||||||
if cronvar.cron_file and not name and not ensure_present:
|
if cronvar.cron_file and not name and not ensure_present:
|
||||||
|
|||||||
@@ -181,14 +181,14 @@ class DBusWrapper(object):
|
|||||||
|
|
||||||
for pid in psutil.pids():
|
for pid in psutil.pids():
|
||||||
process = psutil.Process(pid)
|
process = psutil.Process(pid)
|
||||||
process_real_uid, _, _ = process.uids()
|
process_real_uid, dummy, dummy = process.uids()
|
||||||
try:
|
try:
|
||||||
if process_real_uid == uid and 'DBUS_SESSION_BUS_ADDRESS' in process.environ():
|
if process_real_uid == uid and 'DBUS_SESSION_BUS_ADDRESS' in process.environ():
|
||||||
dbus_session_bus_address_candidate = process.environ()['DBUS_SESSION_BUS_ADDRESS']
|
dbus_session_bus_address_candidate = process.environ()['DBUS_SESSION_BUS_ADDRESS']
|
||||||
self.module.debug("Found D-Bus user session candidate at address: %s" % dbus_session_bus_address_candidate)
|
self.module.debug("Found D-Bus user session candidate at address: %s" % dbus_session_bus_address_candidate)
|
||||||
dbus_send_cmd = self.module.get_bin_path('dbus-send', required=True)
|
dbus_send_cmd = self.module.get_bin_path('dbus-send', required=True)
|
||||||
command = [dbus_send_cmd, '--address=%s' % dbus_session_bus_address_candidate, '--type=signal', '/', 'com.example.test']
|
command = [dbus_send_cmd, '--address=%s' % dbus_session_bus_address_candidate, '--type=signal', '/', 'com.example.test']
|
||||||
rc, _, _ = self.module.run_command(command)
|
rc, dummy, dummy = self.module.run_command(command)
|
||||||
|
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
self.module.debug("Verified D-Bus user session candidate as usable at address: %s" % dbus_session_bus_address_candidate)
|
self.module.debug("Verified D-Bus user session candidate as usable at address: %s" % dbus_session_bus_address_candidate)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user