Compare commits

...

27 Commits
main ... 1.1.0

Author SHA1 Message Date
Felix Fontein
d472953e10 Release 1.1.0. 2020-08-18 13:15:39 +02:00
Felix Fontein
c78d6c95d6 Add release summary. 2020-08-18 13:14:33 +02:00
Andrew Klaus
c9cb987eb7 sysupgrade: new module (#341)
* Adding types to sysupgrade documentation
* Apply suggestions from code review
* Adding installurl flag. Changing wording in example.
* Use None for installurl by default
* Changing word case in description
* sysupgrade: use module structure recommended by Ansible unit test docs
* Adding unit test for sysupgrade

Signed-off-by:  Andrew Klaus <andrew@aklaus.ca>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 2aabf5e62b)
2020-08-18 09:11:48 +02:00
Felix Fontein
099a99d288 Fix galaxy.yml (#774)
* Bump dependencies to 1.0.0, fix tags in galaxy.yml.

* Add changelog.

(cherry picked from commit 0ae3d0aecb)
2020-08-18 08:31:14 +02:00
Amin Vakil
26ea01d5b4 Fix MacOS shutdown integration test (#769)
(cherry picked from commit 4e56347fc1)
2020-08-18 08:31:07 +02:00
Felix Fontein
a9afbe59e5 docker_stack_task_info tests: add delay to make sure task is running (#765)
(cherry picked from commit 0e8cc31799)
2020-08-18 08:31:02 +02:00
Felix Fontein
dc9cab36ac Try to fix docker tests (#764)
* Try to limit docker package version if API version is < 1.39.

* Fix error.

* Re-combine to one command.

(cherry picked from commit a00d615d68)
2020-08-18 08:30:57 +02:00
Sam Doran
99265c5126 Remove "rhui-" prefix from RHEL repository (#762)
(cherry picked from commit 0d31899fe7)
2020-08-18 08:30:52 +02:00
Dusan Matejka
57aede6b95 Cleanup changelog for not included zabbix plugins (#760)
* cleanup changelog for not included zabbix plugins

* Re-generate changelog

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit fefc4b3423)
2020-08-18 08:30:46 +02:00
Felix Fontein
e51e41203a Fix author entry for dsv and tss lookup plugin. (#753)
(cherry picked from commit 7f37103df3)
2020-08-18 08:30:42 +02:00
Kelly Brazil
54644179ea JC plugin (#750)
* initial commit

* add contrib info

* remove nonfunctional \n in error messate

* add documentation and optional quiet and raw arguments

* add changelog fragment

* add aliases

* add initial test

* change folder name

* add pip install jc for tests

* simplify changelog since tests were failing

* add newline to end of file

* fix trailing whitespace in comment causing test failure

* use pip3 since tests are failing using python2.6 pip

* skip python 2.7 tests since jc only supports python 3

* use pip instead of pip3

* add python version requirement

(cherry picked from commit b2a222b136)
2020-08-18 08:30:37 +02:00
Guillaume RODRIGUEZ
7d6a1a4483 Scaleway - Fix api_token documentation (#747)
(cherry picked from commit 76174602dc)
2020-08-18 08:30:30 +02:00
Adriaan Callaerts
2715e4456c Update xfconf.py: make locale-independent (#744)
* Update xfconf.py

- ensure correct behaviour, even in desktop environments which don't use English as the default language
- add double as content type

* set environ_update for entire module

* set envvar LANGUAGE instead of LANG because of priority order in evaluating them

(cherry picked from commit d13b026f47)
2020-08-18 08:30:24 +02:00
Abhijeet Kasurde
a335d1cc56 dsv: Use correct dict usage (#743)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 9e039cc4a0)
2020-08-18 08:30:19 +02:00
DenBeke
a89b43b110 bot: remove from team (#742)
(cherry picked from commit d2d4997fa8)
2020-08-18 08:30:14 +02:00
Abhijeet Kasurde
1b599bde37 lookup: Fix minor typos (#740)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 0eb4954339)
2020-08-18 08:30:09 +02:00
David Marthy
7bd987e2b9 ipa module utils: BUGFIX ipa modules Cookie problem with Loadbalanced IPA and Python3 (… (#738)
* BUGFIX ipa modules Cookie problem with Loadbalanced IPA and Python3 (#737)

* Update changelogs/fragments/738-ipa-python3.yml

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

* Update plugins/module_utils/ipa.py

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 0951833a6c)
2020-08-18 08:30:04 +02:00
Jose Angel Munoz
8b0896a43d New Docker Stack Task Info Module with Tests (#732)
* Add docker_stack_task_info with tests

* Change link

* Change ln

* Fix Documentation

* Small doc changes

* Remove node for RH

(cherry picked from commit 107e956565)
2020-08-18 08:29:59 +02:00
Abhijeet Kasurde
402bb01501 filetree: Update example and documentation for plugin (#728)
Fixes: #727

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit ce48751033)
2020-08-18 08:29:53 +02:00
Felix Fontein
75afd83508 Fix plugins (names, constants, FQCNs in examples) (#722)
* cobbler inventory: fix NAME

* oc transport: fix transport name

* Inventory plugins: fix plugin identifications

* Use FQCN in lookup plugin examples.

* Use FQCN in callback plugins.

* Add changelog fragment.

* Adjust documentation.

* Fix lookup plugin linting errors.

* Fix quotes.

(cherry picked from commit ea21341686)
2020-08-18 08:29:44 +02:00
Amin Vakil
b25f0f3cd2 New module: shutdown (#700)
* New module: shutdown

* Add symlink to plugin

* Fix

Signed-off-by: Amin Vakil <info@aminvakil.com>

* Fix

* Fix

* Add seealso

* Fix seealso

* Add future-import, metaclass boilerplate

* Change pre_shutdown_delay to delay

* Cleanup before executing shutdown

* Fix

* Remove unused connect_timeout paramater

* Improve documentation

* Remove deprecated function and calling it

* Remove double calling delay function

* Remove unneeded call in check delay function

* Make check mode more realistic

* Remove extra blank line

* Remove unnecessary imports and fix copyright year

* Add shutdown_command and integration test

* Fix integration test

* Don't fail on local AND enabled check_mode

* Add copyright

* Skip ubuntu1804 as systemd-sysv is not installed on container

* Ignore ubuntu 18 on task

* Readd integration tests

* Do not run integration test on ubuntu 18

* Improve integration test and add delay, msg testing

* Fix ubuntu 18 integration test

* Remove unnecessary condition

(cherry picked from commit c475effeed)
2020-08-18 08:29:38 +02:00
quidame
9226c4b0d5 New module: iptables_state (#271)
* restart from last state

* test (sanity) doc fragment placeholder

* test (sanity) remove doc fragment placeholder

* remove internal params from DOCUMENTATION

* update ignore-2.10.txt

* doc: add changelog fragment

* shorten changelog fragment

* Revert "shorten changelog fragment"

This reverts commit f9aea0d1eaefda139fd5b79bd0eb127c09a433fb.

* test with posix/group1

* test with posix/group3

* test with posix/group5

* test with posix/group4

* test with posix/group3

* New modules/action plugins automatically get a changelog entry

* fix: styles

* Revert "remove internal params from DOCUMENTATION"

This reverts commit 7d5fcf4b17e4cd5b0afc08fd1bd3fcef5fcaee26.

* drop neutral/informative/stateless behaviour

* update tasks after changes in module

* use FQCN in EXAMPLES

* add tests to validate error handling about required params

* doc: remove outdated sentence

* do not document internal parameters

* display timeout value in failure message

* remove inapropriate comment

* merge results and clean them up only once

* conditionally remove tmp path

* at least one iteration is required

* remove deprecated code

* move variables declaration to conditional block

* dissociate async and connection timeout

* improve warnings (conditions + values)

* remove ANSIBLE_METADATA (no more needed); fix typo

* update DOCUMENTATION

* Drop field 'version_added' (no more needed).
* Add a note about check_mode support.

* catch early errors before resetting connection and processing the loop

* fix typo

* change posix group (due to xtables locks); add 'version_added' in doc

* update deprecation (replace Ansible 2.12 by community.general 2.0.0)

* bump version_added to 1.0.0

* update ignore-2.11.txt

* ignore errors for 2.9 as for 2.10 & 2.11

* move action plugin to system/ and replace it by a symlink

* remove action-plugin-docs override in tests/sanity/ignore*.txt

* update action plugin docstrings

* bump version_added to 1.1.0
* use lowercase booleans
* extend usage of namespaces to ansible builtin modules

(cherry picked from commit 92242d898d)
2020-08-18 08:29:31 +02:00
Andrew Klychkov
fe3e262209 postgresql_set: allow to pass an empty string as a value (#776) (#784)
* postgresql_set: allow to pass an empty string as a value

* add check_mode to CI for the case

* add changelog fragment

* add pause

* fix

* fix ci

* fix

* fix

* add suggested
(cherry picked from commit 05556dc671)
2020-08-17 22:46:10 +03:00
Felix Fontein
b9fac26dcd Rename changelogs/fragments/.empty -> changelogs/fragments/.keep
(cherry picked from commit d0879bfaf9)
2020-08-07 08:18:40 +02:00
Felix Fontein
343e5a03a7 Next release will be 1.1.0. 2020-07-31 13:55:27 +02:00
Felix Fontein
acea082a7c Add changelog for 1.0.0. 2020-07-31 13:54:10 +02:00
Felix Fontein
0cff1f116f Add release summary. 2020-07-31 13:52:28 +02:00
144 changed files with 3328 additions and 442 deletions

2
.github/BOTMETA.yml vendored
View File

@@ -1325,7 +1325,7 @@ macros:
team_rabbitmq: chrishoffman manuel-sousa
team_redfish: billdodd mraineri tomasg2012
team_rhn: FlossWare alikins barnabycourt vritant
team_scaleway: DenBeke QuentinBrosse abarbare jerome-quere kindermoumoute remyleone
team_scaleway: QuentinBrosse abarbare jerome-quere kindermoumoute remyleone
team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l
team_suse: commel dcermak evrardjp lrupp toabctl
team_virt: joshainglis karmab

View File

@@ -5,6 +5,178 @@ Community General Release Notes
.. contents:: Topics
v1.1.0
======
Release Summary
---------------
Release for Ansible 2.10.0.
Minor Changes
-------------
- The collection dependencies where adjusted so that ``community.kubernetes`` and ``google.cloud`` are required to be of version 1.0.0 or newer (https://github.com/ansible-collections/community.general/pull/774).
- jc - new filter to convert the output of many shell commands and file-types to JSON. Uses the jc library at https://github.com/kellyjonbrazil/jc. For example, filtering the STDOUT output of ``uname -a`` via ``{{ result.stdout | community.general.jc('uname') }}``. Requires Python 3.6+ (https://github.com/ansible-collections/community.general/pull/750).
- xfconf - add support for ``double`` type (https://github.com/ansible-collections/community.general/pull/744).
Bugfixes
--------
- cobbler inventory plugin - ``name`` needed FQCN (https://github.com/ansible-collections/community.general/pull/722).
- dsv lookup - use correct dict usage (https://github.com/ansible-collections/community.general/pull/743).
- inventory plugins - allow FQCN in ``plugin`` option (https://github.com/ansible-collections/community.general/pull/722).
- ipa_hostgroup - fix an issue with load-balanced ipa and cookie handling with Python 3 (https://github.com/ansible-collections/community.general/issues/737).
- oc connection plugin - ``transport`` needed FQCN (https://github.com/ansible-collections/community.general/pull/722).
- postgresql_set - allow to pass an empty string to the ``value`` parameter (https://github.com/ansible-collections/community.general/issues/775).
- xfconf - make it work in non-english locales (https://github.com/ansible-collections/community.general/pull/744).
New Modules
-----------
Cloud
~~~~~
docker
^^^^^^
- docker_stack_task_info - Return information of the tasks on a docker stack
System
~~~~~~
- iptables_state - Save iptables state into a file or restore it from a file
- shutdown - Shut down a machine
- sysupgrade - Manage OpenBSD system upgrades
v1.0.0
======
Release Summary
---------------
This is release 1.0.0 of ``community.general``, released on 2020-07-31.
Minor Changes
-------------
- Add the ``gcpubsub``, ``gcpubsub_info`` and ``gcpubsub_facts`` (to be removed in 3.0.0) modules. These were originally in community.general, but removed on the assumption that they have been moved to google.cloud. Since this turned out to be incorrect, we re-added them for 1.0.0.
- Add the deprecated ``gcp_backend_service``, ``gcp_forwarding_rule`` and ``gcp_healthcheck`` modules, which will be removed in 2.0.0. These were originally in community.general, but removed on the assumption that they have been moved to google.cloud. Since this turned out to be incorrect, we re-added them for 1.0.0.
- The collection is now actively tested in CI with the latest Ansible 2.9 release.
- airbrake_deployment - add ``version`` param; clarified docs on ``revision`` param (https://github.com/ansible-collections/community.general/pull/583).
- apk - added ``no_cache`` option (https://github.com/ansible-collections/community.general/pull/548).
- firewalld - the module has been moved to the ``ansible.posix`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/623).
- gitlab_project - add support for merge_method on projects (https://github.com/ansible/ansible/pull/66813).
- gitlab_runners inventory plugin - permit environment variable input for ``server_url``, ``api_token`` and ``filter`` options (https://github.com/ansible-collections/community.general/pull/611).
- haproxy - add options to dis/enable health and agent checks. When health and agent checks are enabled for a service, a disabled service will re-enable itself automatically. These options also change the state of the agent checks to match the requested state for the backend (https://github.com/ansible-collections/community.general/issues/684).
- log_plays callback - use v2 methods (https://github.com/ansible-collections/community.general/pull/442).
- logstash callback - add ini config (https://github.com/ansible-collections/community.general/pull/610).
- lxd_container - added support of ``--target`` flag for cluster deployments (https://github.com/ansible-collections/community.general/issues/637).
- parted - accept negative numbers in ``part_start`` and ``part_end``
- pkgng - added ``stdout`` and ``stderr`` attributes to the result (https://github.com/ansible-collections/community.general/pull/560).
- pkgng - added support for upgrading all packages using ``name: *, state: latest``, similar to other package providers (https://github.com/ansible-collections/community.general/pull/569).
- postgresql_query - add search_path parameter (https://github.com/ansible-collections/community.general/issues/625).
- rundeck_acl_policy - add check for rundeck_acl_policy name parameter (https://github.com/ansible-collections/community.general/pull/612).
- slack - add support for sending messages built with block kit (https://github.com/ansible-collections/community.general/issues/380).
- splunk callback - add an option to allow not to validate certificate from HEC (https://github.com/ansible-collections/community.general/pull/596).
- xfconf - add arrays support (https://github.com/ansible/ansible/issues/46308).
- xfconf - add support for ``uint`` type (https://github.com/ansible-collections/community.general/pull/696).
Breaking Changes / Porting Guide
--------------------------------
- log_plays callback - add missing information to the logs generated by the callback plugin. This changes the log message format (https://github.com/ansible-collections/community.general/pull/442).
- pkgng - passing ``name: *`` with ``state: absent`` will no longer remove every installed package from the system. It is now a noop. (https://github.com/ansible-collections/community.general/pull/569).
- pkgng - passing ``name: *`` with ``state: latest`` or ``state: present`` will no longer install every package from the configured package repositories. Instead, ``name: *, state: latest`` will upgrade all already-installed packages, and ``name: *, state: present`` is a noop. (https://github.com/ansible-collections/community.general/pull/569).
Deprecated Features
-------------------
- The ldap_attr module has been deprecated and will be removed in a later release; use ldap_attrs instead.
- xbps - the ``force`` option never had any effect. It is now deprecated, and will be removed in 3.0.0 (https://github.com/ansible-collections/community.general/pull/568).
Removed Features (previously deprecated)
----------------------------------------
- conjur_variable lookup - has been moved to the ``cyberark.conjur`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/570).
- digital_ocean_* - all DigitalOcean modules have been moved to the ``community.digitalocean`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/622).
- infini_* - all infinidat modules have been moved to the ``infinidat.infinibox`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/607).
- logicmonitor - the module has been removed in 1.0.0 since it is unmaintained and the API used by the module has been turned off in 2017 (https://github.com/ansible-collections/community.general/issues/539, https://github.com/ansible-collections/community.general/pull/541).
- logicmonitor_facts - the module has been removed in 1.0.0 since it is unmaintained and the API used by the module has been turned off in 2017 (https://github.com/ansible-collections/community.general/issues/539, https://github.com/ansible-collections/community.general/pull/541).
- mysql_* - all MySQL modules have been moved to the ``community.mysql`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/633).
- proxysql_* - all ProxySQL modules have been moved to the ``community.proxysql`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/624).
Bugfixes
--------
- aix_filesystem - fix issues with ismount module_util pathing for Ansible 2.9 (https://github.com/ansible-collections/community.general/pull/567).
- consul_kv lookup - fix ``ANSIBLE_CONSUL_URL`` environment variable handling (https://github.com/ansible/ansible/issues/51960).
- consul_kv lookup - fix arguments handling (https://github.com/ansible-collections/community.general/pull/303).
- digital_ocean_tag_info - fix crash when querying for an individual tag (https://github.com/ansible-collections/community.general/pull/615).
- doas become plugin - address a bug with the parameters handling that was breaking the plugin in community.general when ``become_flags`` and ``become_user`` were not explicitly specified (https://github.com/ansible-collections/community.general/pull/704).
- docker_compose - add a condition to prevent service startup if parameter ``stopped`` is true. Otherwise, the service will be started on each play and stopped again immediately due to the ``stopped`` parameter and breaks the idempotency of the module (https://github.com/ansible-collections/community.general/issues/532).
- docker_compose - disallow usage of the parameters ``stopped`` and ``restarted`` at the same time. This breaks also the idempotency (https://github.com/ansible-collections/community.general/issues/532).
- docker_container - use Config MacAddress by default instead of Networks. Networks MacAddress is empty in some cases (https://github.com/ansible/ansible/issues/70206).
- docker_container - various error fixes in string handling for Python 2 to avoid crashes when non-ASCII characters are used in strings (https://github.com/ansible-collections/community.general/issues/640).
- docker_swarm - removes ``advertise_addr`` from list of required arguments when ``state`` is ``"join"`` (https://github.com/ansible-collections/community.general/issues/439).
- dzdo become plugin - address a bug with the parameters handling that was breaking the plugin in community.general when ``become_user`` was not explicitly specified (https://github.com/ansible-collections/community.general/pull/708).
- filesystem - resizefs of xfs filesystems is fixed. Filesystem needs to be mounted.
- jenkins_plugin - replace MD5 checksum verification with SHA1 due to MD5 being disabled on systems with FIPS-only algorithms enabled (https://github.com/ansible/ansible/issues/34304).
- jira - improve error message handling (https://github.com/ansible-collections/community.general/pull/311).
- jira - improve error message handling with multiple errors (https://github.com/ansible-collections/community.general/pull/707).
- kubevirt - Add aliases 'interface_name' for network_name (https://github.com/ansible/ansible/issues/55641).
- nmcli - fix idempotetency when modifying an existing connection (https://github.com/ansible-collections/community.general/issues/481).
- osx_defaults - fix handling negative integers (https://github.com/ansible-collections/community.general/issues/134).
- pacman - treat package names containing .zst as package files during installation (https://www.archlinux.org/news/now-using-zstandard-instead-of-xz-for-package-compression/, https://github.com/ansible-collections/community.general/pull/650).
- pbrun become plugin - address a bug with the parameters handling that was breaking the plugin in community.general when ``become_user`` was not explicitly specified (https://github.com/ansible-collections/community.general/pull/708).
- postgresql_privs - fix crash when set privileges on schema with hyphen in the name (https://github.com/ansible-collections/community.general/issues/656).
- postgresql_set - only display a warning about restarts, when restarting is needed (https://github.com/ansible-collections/community.general/pull/651).
- redfish_info, redfish_config, redfish_command - Fix Redfish response payload decode on Python 3.5 (https://github.com/ansible-collections/community.general/issues/686)
- selective - mark task failed correctly (https://github.com/ansible/ansible/issues/63767).
- snmp_facts - skip ``EndOfMibView`` values (https://github.com/ansible/ansible/issues/49044).
- yarn - fixed an index out of range error when no outdated packages where returned by yarn executable (see https://github.com/ansible-collections/community.general/pull/474).
- yarn - fixed an too many values to unpack error when scoped packages are installed (see https://github.com/ansible-collections/community.general/pull/474).
New Plugins
-----------
Inventory
~~~~~~~~~
- cobbler - Cobbler inventory source
Lookup
~~~~~~
- dsv - Get secrets from Thycotic DevOps Secrets Vault
- tss - Get secrets from Thycotic Secret Server
New Modules
-----------
Cloud
~~~~~
docker
^^^^^^
- docker_stack_info - Return information on a docker stack
Database
~~~~~~~~
misc
^^^^
- odbc - Execute SQL via ODBC
System
~~~~~~
- launchd - Manage macOS services
v0.2.0
======
@@ -22,7 +194,6 @@ Major Changes
- docker_container - the ``network_mode`` option will be set by default to the name of the first network in ``networks`` if at least one network is given and ``networks_cli_compatible`` is ``true`` (will be default from community.general 2.0.0 on). Set to an explicit value to avoid deprecation warnings if you specify networks and set ``networks_cli_compatible`` to ``true``. The current default (not specifying it) is equivalent to the value ``default``.
- docker_container - the module has a new option, ``container_default_behavior``, whose default value will change from ``compatibility`` to ``no_defaults``. Set to an explicit value to avoid deprecation warnings.
- gitlab_user - no longer requires ``name``, ``email`` and ``password`` arguments when ``state=absent``.
- zabbix_action - no longer requires ``esc_period`` and ``event_source`` arguments when ``state=absent``.
Minor Changes
-------------
@@ -159,16 +330,6 @@ Minor Changes
- terraform - Adds option ``backend_config_files``. This can accept a list of paths to multiple configuration files (https://github.com/ansible-collections/community.general/pull/394).
- terraform - Adds option ``variables_files`` for multiple var-files (https://github.com/ansible-collections/community.general/issues/224).
- ufw - accept ``interface_in`` and ``interface_out`` as parameters.
- zabbix_action - allow str values for ``esc_period`` options (https://github.com/ansible/ansible/pull/66841).
- zabbix_host - now supports configuring user macros and host tags on the managed host (see https://github.com/ansible/ansible/pull/66777)
- zabbix_host_info - ``host_name`` based search results now include host groups.
- zabbix_hostmacro - ``macro_name`` now accepts macros in zabbix native format as well (e.g. ``{$MACRO}``)
- zabbix_hostmacro - ``macro_value`` is no longer required when ``state=absent``
- zabbix_proxy - ``interface`` sub-options ``type`` and ``main`` are now deprecated and will be removed in community.general 3.0.0. Also, the values passed to ``interface`` are now checked for correct types and unexpected keys.
- zabbix_proxy - added option proxy_address for comma-delimited list of IP/CIDR addresses or DNS names to accept active proxy requests from
- zabbix_template - add new option omit_date to remove date from exported/dumped template (https://github.com/ansible/ansible/pull/67302)
- zabbix_template - adding new update rule templateLinkage.deleteMissing for newer zabbix versions (https://github.com/ansible/ansible/pull/66747).
- zabbix_template_info - add new option omit_date to remove date from exported/dumped template (https://github.com/ansible/ansible/pull/67302)
- zypper - Added ``allow_vendor_change`` and ``replacefiles`` zypper options (https://github.com/ansible-collections/community.general/issues/381)
Breaking Changes / Porting Guide
@@ -199,7 +360,6 @@ Deprecated Features
- redfish_config - the ``bios_attribute_name`` and ``bios_attribute_value`` options will be removed. To maintain the existing behavior use the ``bios_attributes`` option instead.
- redfish_config and redfish_command - the behavior to select the first System, Manager, or Chassis resource to modify when multiple are present will be removed. Use the new ``resource_id`` option to specify target resource to modify.
- redfish_config, redfish_command - Behavior to modify the first System, Mananger, or Chassis resource when multiple are present is deprecated. Use the new ``resource_id`` option to specify target resource to modify.
- zabbix_proxy - deprecates ``interface`` sub-options ``type`` and ``main`` when proxy type is set to passive via ``status=passive``. Make sure these suboptions are removed from your playbook as they were never supported by Zabbix in the first place.
Removed Features (previously deprecated)
----------------------------------------
@@ -367,13 +527,6 @@ Bugfixes
- terraform module - fixes usage for providers not supporting workspaces
- yarn - Return correct values when running yarn in check mode (https://github.com/ansible-collections/community.general/pull/153).
- yarn - handle no version when installing module by name (https://github.com/ansible/ansible/issues/55097)
- zabbix_action - arguments ``event_source`` and ``esc_period`` no longer required when ``state=absent``
- zabbix_host - fixed inventory_mode key error, which occurs with Zabbix 4.4.1 or more (https://github.com/ansible/ansible/issues/65304).
- zabbix_host - was not possible to update a host where visible_name was not set in zabbix
- zabbix_mediatype - Fixed to support zabbix 4.4 or more and python3 (https://github.com/ansible/ansible/pull/67693)
- zabbix_template - fixed error when providing empty ``link_templates`` to the module (see https://github.com/ansible/ansible/issues/66417)
- zabbix_template - fixed invalid (non-importable) output provided by exporting XML (see https://github.com/ansible/ansible/issues/66466)
- zabbix_user - Fixed an issue where module failed with zabbix 4.4 or above (see https://github.com/ansible/ansible/pull/67475)
- zfs_delegate_admin - add missing choices diff/hold/release to the permissions parameter (https://github.com/ansible-collections/community.general/pull/278)
New Plugins

View File

@@ -245,19 +245,6 @@ releases:
- terraform module - fixes usage for providers not supporting workspaces
- yarn - Return correct values when running yarn in check mode (https://github.com/ansible-collections/community.general/pull/153).
- yarn - handle no version when installing module by name (https://github.com/ansible/ansible/issues/55097)
- zabbix_action - arguments ``event_source`` and ``esc_period`` no longer required
when ``state=absent``
- zabbix_host - fixed inventory_mode key error, which occurs with Zabbix 4.4.1
or more (https://github.com/ansible/ansible/issues/65304).
- zabbix_host - was not possible to update a host where visible_name was not
set in zabbix
- zabbix_mediatype - Fixed to support zabbix 4.4 or more and python3 (https://github.com/ansible/ansible/pull/67693)
- zabbix_template - fixed error when providing empty ``link_templates`` to the
module (see https://github.com/ansible/ansible/issues/66417)
- zabbix_template - fixed invalid (non-importable) output provided by exporting
XML (see https://github.com/ansible/ansible/issues/66466)
- zabbix_user - Fixed an issue where module failed with zabbix 4.4 or above
(see https://github.com/ansible/ansible/pull/67475)
- zfs_delegate_admin - add missing choices diff/hold/release to the permissions
parameter (https://github.com/ansible-collections/community.general/pull/278)
deprecated_features:
@@ -297,10 +284,6 @@ releases:
- redfish_config, redfish_command - Behavior to modify the first System, Mananger,
or Chassis resource when multiple are present is deprecated. Use the new ``resource_id``
option to specify target resource to modify.
- zabbix_proxy - deprecates ``interface`` sub-options ``type`` and ``main``
when proxy type is set to passive via ``status=passive``. Make sure these
suboptions are removed from your playbook as they were never supported by
Zabbix in the first place.
major_changes:
- docker_container - the ``network_mode`` option will be set by default to the
name of the first network in ``networks`` if at least one network is given
@@ -313,8 +296,6 @@ releases:
Set to an explicit value to avoid deprecation warnings.
- gitlab_user - no longer requires ``name``, ``email`` and ``password`` arguments
when ``state=absent``.
- zabbix_action - no longer requires ``esc_period`` and ``event_source`` arguments
when ``state=absent``.
minor_changes:
- A new filter ``to_time_unit`` with specializations ``to_milliseconds``, ``to_seconds``,
``to_minutes``, ``to_hours``, ``to_days``, ``to_weeks``, ``to_months`` and
@@ -495,24 +476,6 @@ releases:
paths to multiple configuration files (https://github.com/ansible-collections/community.general/pull/394).
- terraform - Adds option ``variables_files`` for multiple var-files (https://github.com/ansible-collections/community.general/issues/224).
- ufw - accept ``interface_in`` and ``interface_out`` as parameters.
- zabbix_action - allow str values for ``esc_period`` options (https://github.com/ansible/ansible/pull/66841).
- zabbix_host - now supports configuring user macros and host tags on the managed
host (see https://github.com/ansible/ansible/pull/66777)
- zabbix_host_info - ``host_name`` based search results now include host groups.
- zabbix_hostmacro - ``macro_name`` now accepts macros in zabbix native format
as well (e.g. ``{$MACRO}``)
- zabbix_hostmacro - ``macro_value`` is no longer required when ``state=absent``
- zabbix_proxy - ``interface`` sub-options ``type`` and ``main`` are now deprecated
and will be removed in community.general 3.0.0. Also, the values passed to
``interface`` are now checked for correct types and unexpected keys.
- zabbix_proxy - added option proxy_address for comma-delimited list of IP/CIDR
addresses or DNS names to accept active proxy requests from
- zabbix_template - add new option omit_date to remove date from exported/dumped
template (https://github.com/ansible/ansible/pull/67302)
- zabbix_template - adding new update rule templateLinkage.deleteMissing for
newer zabbix versions (https://github.com/ansible/ansible/pull/66747).
- zabbix_template_info - add new option omit_date to remove date from exported/dumped
template (https://github.com/ansible/ansible/pull/67302)
- zypper - Added ``allow_vendor_change`` and ``replacefiles`` zypper options
(https://github.com/ansible-collections/community.general/issues/381)
release_summary: 'This is the first proper release of the ``community.general``
@@ -680,10 +643,8 @@ releases:
- 63629-postgresql_db_pgc_support.yaml
- 63887-docker_swarm_service-sort-lists-when-checking-changes.yml
- 63903-ufw.yaml
- 63969-zabbix_action_argsfix.yml
- 63990-replace-deprecated-basic-functions.yml
- 64007-postgresql_db_allow_user_name_with_dots.yml
- 64032-zabbix_template_fix_return_XML_as_a_string_even_python3.yml
- 64059-mysql_user_fix_password_comparison.yaml
- 64288-fix-hashi-vault-kv-v2.yaml
- 64371-postgresql_privs-always-reports-as-changed-when-using-default_privs.yml
@@ -704,7 +665,6 @@ releases:
- 65164-postgres_use_query_params_with_cursor.yml
- 65223-postgresql_db-exception-added.yml
- 65238-fix_pacman_stdout_parsing.yml
- 65304-fix_zabbix_host_inventory_mode_key_error.yml
- 65310-postgresql_owner_use_query_params.yml
- 65372-misc-context-manager.yml
- 65387-homebrew_check_mode_option.yml
@@ -726,13 +686,11 @@ releases:
- 65894-redfish-bios-attributes.yaml
- 65903-postgresql_privs_sort_lists_with_none_elements.yml
- 65993-restart-docker_container-on-restart-policy-updates.yaml
- 66026-zabbix_host_info.yml
- 66048-mysql_add_master_data_parameter.yml
- 66060-redfish-new-resource-id-option.yaml
- 66144-docker_container-removal-timeout.yml
- 66151-docker_swarm_service-healthcheck-start-period.yml
- 66157-postgresql-create-unique-indexes.yml
- 66247-zabbix_proxy-address-field.yaml
- 66252-mysql_replication_fail_on_error.yml
- 66268-cyberarkpassword-fix-invalid-attr.yaml
- 66322-moved_line_causing_terraform_output_suppression.yml
@@ -740,26 +698,20 @@ releases:
- 66357-support-changing-fetch_url-settings-for-rundeck-modules.yaml
- 66382-docker_container-port-range.yml
- 66398-pamd_fix-attributeerror-when-removing-first-line.yml
- 66463-zabbix_template-fix-error-linktemplate-and-importdump.yml
- 66592_ipa_encoding_fix.yml
- 66599-docker-healthcheck.yml
- 66600-docker_container-volumes.yml
- 66688-mysql_db_add_skip_lock_tables_option.yml
- 66711-postgresql_user_add_comment_parameter.yml
- 66717-postgresql_db_add_dump_extra_args_param.yml
- 66747-zabbix_template-newupdaterule-deletemissinglinkedtemplate.yml
- 66777-zabbix_host_tags_macros_support.yml
- 66801-mysql_user_priv_can_be_dict.yml
- 66806-mysql_variables_not_support_variables_with_dot.yml
- 66807-redhat_subscription-no-default-quantity.yaml
- 66837-zabbix-proxy-interface.yml
- 66841-zabbix_action-allowstrfor-esc_period.yml
- 66914-purefa_user_string.yaml
- 66929-pmrun-quote-entire-success-command-string.yml
- 66957-scaleway-jsonify-only-for-json-requests.yml
- 66974-mysql_user_doesnt_support_privs_with_underscore.yml
- 67046-postgresql_modules_make_params_required.yml
- 67302-zabbix_template_info-add-omit_date-field.yml
- 67337-fix-proxysql-mysql-cursor.yaml
- 67353-docker_login-permissions.yml
- 67418-postgresql_set_converts_value_to_uppercase.yml
@@ -767,7 +719,6 @@ releases:
- 67464-postgresql_info_add_collecting_subscription_info.yml
- 67614-postgresql_info_add_collecting_publication_info.yml
- 67655-scaleway_compute-get-image-instead-loop-on-list.yml
- 67693-zabbix_mediatype.yml
- 67747-mysql_db_add_dump_extra_args_param.yml
- 67767-mysql_db_fix_bug_introduced_by_56721.yml
- 67832-run_powershell_modules_on_windows_containers.yml
@@ -786,7 +737,6 @@ releases:
- firewalld-version-0_7_0.yml
- firewalld_zone_target.yml
- fix-oc-conn-plugin-envvar.yml
- fix_zabbix_host_visible_name.yml
- gitlab-project-variable-variable-type.yml
- gitlab_project_variable.yml
- ldap-params-removal.yml
@@ -805,8 +755,6 @@ releases:
- solaris_zone_name_fix.yml
- syslogger-disable-check-mode.yaml
- xml-deprecated-functions.yml
- zabbix-hostmacro.yml
- zabbix_user-mediatype-error.yml
modules:
- description: Override a debian package's version of a file
name: dpkg_divert
@@ -905,3 +853,254 @@ releases:
name: lmdb_kv
namespace: null
release_date: '2020-06-20'
1.0.0:
changes:
breaking_changes:
- log_plays callback - add missing information to the logs generated by the
callback plugin. This changes the log message format (https://github.com/ansible-collections/community.general/pull/442).
- 'pkgng - passing ``name: *`` with ``state: absent`` will no longer remove
every installed package from the system. It is now a noop. (https://github.com/ansible-collections/community.general/pull/569).'
- 'pkgng - passing ``name: *`` with ``state: latest`` or ``state: present``
will no longer install every package from the configured package repositories.
Instead, ``name: *, state: latest`` will upgrade all already-installed packages,
and ``name: *, state: present`` is a noop. (https://github.com/ansible-collections/community.general/pull/569).'
bugfixes:
- aix_filesystem - fix issues with ismount module_util pathing for Ansible 2.9
(https://github.com/ansible-collections/community.general/pull/567).
- consul_kv lookup - fix ``ANSIBLE_CONSUL_URL`` environment variable handling
(https://github.com/ansible/ansible/issues/51960).
- consul_kv lookup - fix arguments handling (https://github.com/ansible-collections/community.general/pull/303).
- digital_ocean_tag_info - fix crash when querying for an individual tag (https://github.com/ansible-collections/community.general/pull/615).
- doas become plugin - address a bug with the parameters handling that was breaking
the plugin in community.general when ``become_flags`` and ``become_user``
were not explicitly specified (https://github.com/ansible-collections/community.general/pull/704).
- docker_compose - add a condition to prevent service startup if parameter ``stopped``
is true. Otherwise, the service will be started on each play and stopped again
immediately due to the ``stopped`` parameter and breaks the idempotency of
the module (https://github.com/ansible-collections/community.general/issues/532).
- docker_compose - disallow usage of the parameters ``stopped`` and ``restarted``
at the same time. This breaks also the idempotency (https://github.com/ansible-collections/community.general/issues/532).
- docker_container - use Config MacAddress by default instead of Networks. Networks
MacAddress is empty in some cases (https://github.com/ansible/ansible/issues/70206).
- docker_container - various error fixes in string handling for Python 2 to
avoid crashes when non-ASCII characters are used in strings (https://github.com/ansible-collections/community.general/issues/640).
- docker_swarm - removes ``advertise_addr`` from list of required arguments
when ``state`` is ``"join"`` (https://github.com/ansible-collections/community.general/issues/439).
- dzdo become plugin - address a bug with the parameters handling that was breaking
the plugin in community.general when ``become_user`` was not explicitly specified
(https://github.com/ansible-collections/community.general/pull/708).
- filesystem - resizefs of xfs filesystems is fixed. Filesystem needs to be
mounted.
- jenkins_plugin - replace MD5 checksum verification with SHA1 due to MD5 being
disabled on systems with FIPS-only algorithms enabled (https://github.com/ansible/ansible/issues/34304).
- jira - improve error message handling (https://github.com/ansible-collections/community.general/pull/311).
- jira - improve error message handling with multiple errors (https://github.com/ansible-collections/community.general/pull/707).
- kubevirt - Add aliases 'interface_name' for network_name (https://github.com/ansible/ansible/issues/55641).
- nmcli - fix idempotetency when modifying an existing connection (https://github.com/ansible-collections/community.general/issues/481).
- osx_defaults - fix handling negative integers (https://github.com/ansible-collections/community.general/issues/134).
- pacman - treat package names containing .zst as package files during installation
(https://www.archlinux.org/news/now-using-zstandard-instead-of-xz-for-package-compression/,
https://github.com/ansible-collections/community.general/pull/650).
- pbrun become plugin - address a bug with the parameters handling that was
breaking the plugin in community.general when ``become_user`` was not explicitly
specified (https://github.com/ansible-collections/community.general/pull/708).
- postgresql_privs - fix crash when set privileges on schema with hyphen in
the name (https://github.com/ansible-collections/community.general/issues/656).
- postgresql_set - only display a warning about restarts, when restarting is
needed (https://github.com/ansible-collections/community.general/pull/651).
- redfish_info, redfish_config, redfish_command - Fix Redfish response payload
decode on Python 3.5 (https://github.com/ansible-collections/community.general/issues/686)
- selective - mark task failed correctly (https://github.com/ansible/ansible/issues/63767).
- snmp_facts - skip ``EndOfMibView`` values (https://github.com/ansible/ansible/issues/49044).
- yarn - fixed an index out of range error when no outdated packages where returned
by yarn executable (see https://github.com/ansible-collections/community.general/pull/474).
- yarn - fixed an too many values to unpack error when scoped packages are installed
(see https://github.com/ansible-collections/community.general/pull/474).
deprecated_features:
- The ldap_attr module has been deprecated and will be removed in a later release;
use ldap_attrs instead.
- xbps - the ``force`` option never had any effect. It is now deprecated, and
will be removed in 3.0.0 (https://github.com/ansible-collections/community.general/pull/568).
minor_changes:
- Add the ``gcpubsub``, ``gcpubsub_info`` and ``gcpubsub_facts`` (to be removed
in 3.0.0) modules. These were originally in community.general, but removed
on the assumption that they have been moved to google.cloud. Since this turned
out to be incorrect, we re-added them for 1.0.0.
- Add the deprecated ``gcp_backend_service``, ``gcp_forwarding_rule`` and ``gcp_healthcheck``
modules, which will be removed in 2.0.0. These were originally in community.general,
but removed on the assumption that they have been moved to google.cloud. Since
this turned out to be incorrect, we re-added them for 1.0.0.
- The collection is now actively tested in CI with the latest Ansible 2.9 release.
- airbrake_deployment - add ``version`` param; clarified docs on ``revision``
param (https://github.com/ansible-collections/community.general/pull/583).
- apk - added ``no_cache`` option (https://github.com/ansible-collections/community.general/pull/548).
- firewalld - the module has been moved to the ``ansible.posix`` collection.
A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/623).
- gitlab_project - add support for merge_method on projects (https://github.com/ansible/ansible/pull/66813).
- gitlab_runners inventory plugin - permit environment variable input for ``server_url``,
``api_token`` and ``filter`` options (https://github.com/ansible-collections/community.general/pull/611).
- haproxy - add options to dis/enable health and agent checks. When health
and agent checks are enabled for a service, a disabled service will re-enable
itself automatically. These options also change the state of the agent checks
to match the requested state for the backend (https://github.com/ansible-collections/community.general/issues/684).
- log_plays callback - use v2 methods (https://github.com/ansible-collections/community.general/pull/442).
- logstash callback - add ini config (https://github.com/ansible-collections/community.general/pull/610).
- lxd_container - added support of ``--target`` flag for cluster deployments
(https://github.com/ansible-collections/community.general/issues/637).
- parted - accept negative numbers in ``part_start`` and ``part_end``
- pkgng - added ``stdout`` and ``stderr`` attributes to the result (https://github.com/ansible-collections/community.general/pull/560).
- 'pkgng - added support for upgrading all packages using ``name: *, state:
latest``, similar to other package providers (https://github.com/ansible-collections/community.general/pull/569).'
- postgresql_query - add search_path parameter (https://github.com/ansible-collections/community.general/issues/625).
- rundeck_acl_policy - add check for rundeck_acl_policy name parameter (https://github.com/ansible-collections/community.general/pull/612).
- slack - add support for sending messages built with block kit (https://github.com/ansible-collections/community.general/issues/380).
- splunk callback - add an option to allow not to validate certificate from
HEC (https://github.com/ansible-collections/community.general/pull/596).
- xfconf - add arrays support (https://github.com/ansible/ansible/issues/46308).
- xfconf - add support for ``uint`` type (https://github.com/ansible-collections/community.general/pull/696).
release_summary: 'This is release 1.0.0 of ``community.general``, released on
2020-07-31.
'
removed_features:
- conjur_variable lookup - has been moved to the ``cyberark.conjur`` collection.
A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/570).
- digital_ocean_* - all DigitalOcean modules have been moved to the ``community.digitalocean``
collection. A redirection is active, which will be removed in version 2.0.0
(https://github.com/ansible-collections/community.general/pull/622).
- infini_* - all infinidat modules have been moved to the ``infinidat.infinibox``
collection. A redirection is active, which will be removed in version 2.0.0
(https://github.com/ansible-collections/community.general/pull/607).
- logicmonitor - the module has been removed in 1.0.0 since it is unmaintained
and the API used by the module has been turned off in 2017 (https://github.com/ansible-collections/community.general/issues/539,
https://github.com/ansible-collections/community.general/pull/541).
- logicmonitor_facts - the module has been removed in 1.0.0 since it is unmaintained
and the API used by the module has been turned off in 2017 (https://github.com/ansible-collections/community.general/issues/539,
https://github.com/ansible-collections/community.general/pull/541).
- mysql_* - all MySQL modules have been moved to the ``community.mysql`` collection.
A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/633).
- proxysql_* - all ProxySQL modules have been moved to the ``community.proxysql``
collection. A redirection is active, which will be removed in version 2.0.0
(https://github.com/ansible-collections/community.general/pull/624).
fragments:
- 1.0.0.yml
- 296-ansible-2.9.yml
- 303-consul_kv-fix-env-variables-handling.yaml
- 311-jira-error-handling.yaml
- 33979-xfs_growfs.yml
- 442-log_plays-add_playbook_task_name_and_action.yml
- 474-yarn_fix-outdated-fix-list.yml
- 547-start-service-condition.yaml
- 548_apk.yml
- 55903_kubevirt.yml
- 560-pkgng-add-stdout-and-stderr.yaml
- 562-nmcli-fix-idempotency.yaml
- 564-docker_container_use_config_macaddress_by_default.yaml
- 568_packaging.yml
- 569-pkgng-add-upgrade-action.yaml
- 596-splunk-add-option-to-not-validate-cert.yaml
- 610_logstash_callback_add_ini_config.yml
- 611-gitlab-runners-env-vars-intput-and-default-item-limit.yaml
- 613-snmp_facts-EndOfMibView.yml
- 615-digital-ocean-tag-info-bugfix.yml
- 63767_selective.yml
- 642-docker_container-python-2.yml
- 646-docker_swarm-remove-advertise_addr-from-join-requirement.yaml
- 650_pacman_support_zst_package_files.yaml
- 651-fix-postgresql_set-warning.yaml
- 653-postgresql_query_add_search_path_param.yml
- 656-name-with-hyphen.yml
- 66813_gitlab_project.yml
- 676-osx_defaults_fix_handling_negative_ints.yml
- 677-jenkins_plugins_sha1.yaml
- 687-fix-redfish-payload-decode-python35.yml
- 689-haproxy_agent_and_health.yml
- 693-big-revamp-on-xfconf-adding-array-values.yml
- 702-slack-support-for-blocks.yaml
- 704-doas-set-correct-default-values.yml
- 707-jira-error-handling.yaml
- 708-set-correct-default-values.yml
- 711-lxd-target.yml
- add_argument_check_for_rundeck.yaml
- airbrake_deployment_add_version.yml
- aix_filesystem-module_util-routing-issue.yml
- cyberarkconjur-removal.yml
- digital-ocean.yml
- firewalld_migration.yml
- google-modules.yml
- infinidat-removal.yml
- logicmonitor-removal.yml
- mysql.yml
- parted_negative_numbers.yml
- porting-guide-2.yml
- proxysql.yml
- xfconf_add_uint_type.yml
modules:
- description: Return information on a docker stack
name: docker_stack_info
namespace: cloud.docker
- description: Manage macOS services
name: launchd
namespace: system
- description: Execute SQL via ODBC
name: odbc
namespace: database.misc
plugins:
inventory:
- description: Cobbler inventory source
name: cobbler
namespace: null
lookup:
- description: Get secrets from Thycotic DevOps Secrets Vault
name: dsv
namespace: null
- description: Get secrets from Thycotic Secret Server
name: tss
namespace: null
release_date: '2020-07-31'
1.1.0:
changes:
bugfixes:
- cobbler inventory plugin - ``name`` needed FQCN (https://github.com/ansible-collections/community.general/pull/722).
- dsv lookup - use correct dict usage (https://github.com/ansible-collections/community.general/pull/743).
- inventory plugins - allow FQCN in ``plugin`` option (https://github.com/ansible-collections/community.general/pull/722).
- ipa_hostgroup - fix an issue with load-balanced ipa and cookie handling with
Python 3 (https://github.com/ansible-collections/community.general/issues/737).
- oc connection plugin - ``transport`` needed FQCN (https://github.com/ansible-collections/community.general/pull/722).
- postgresql_set - allow to pass an empty string to the ``value`` parameter
(https://github.com/ansible-collections/community.general/issues/775).
- xfconf - make it work in non-english locales (https://github.com/ansible-collections/community.general/pull/744).
minor_changes:
- The collection dependencies where adjusted so that ``community.kubernetes``
and ``google.cloud`` are required to be of version 1.0.0 or newer (https://github.com/ansible-collections/community.general/pull/774).
- jc - new filter to convert the output of many shell commands and file-types
to JSON. Uses the jc library at https://github.com/kellyjonbrazil/jc. For
example, filtering the STDOUT output of ``uname -a`` via ``{{ result.stdout
| community.general.jc('uname') }}``. Requires Python 3.6+ (https://github.com/ansible-collections/community.general/pull/750).
- xfconf - add support for ``double`` type (https://github.com/ansible-collections/community.general/pull/744).
release_summary: 'Release for Ansible 2.10.0.
'
fragments:
- 1.1.0.yml
- 722-plugins.yml
- 738-ipa-python3.yml
- 744-xfconf_make_locale-independent.yml
- 750-jc-new-filter.yaml
- 776-postgresql_set_allow_empty_string.yaml
- dsv_fix.yml
- galaxy-yml.yml
modules:
- description: Return information of the tasks on a docker stack
name: docker_stack_task_info
namespace: cloud.docker
- description: Save iptables state into a file or restore it from a file
name: iptables_state
namespace: system
- description: Shut down a machine
name: shutdown
namespace: system
- description: Manage OpenBSD system upgrades
name: sysupgrade
namespace: system
release_date: '2020-08-18'

View File

@@ -1,2 +0,0 @@
minor_changes:
- "The collection is now actively tested in CI with the latest Ansible 2.9 release."

View File

@@ -1,4 +0,0 @@
---
bugfixes:
- consul_kv lookup - fix ``ANSIBLE_CONSUL_URL`` environment variable handling (https://github.com/ansible/ansible/issues/51960).
- consul_kv lookup - fix arguments handling (https://github.com/ansible-collections/community.general/pull/303).

View File

@@ -1,2 +0,0 @@
bugfixes:
- jira - improve error message handling (https://github.com/ansible-collections/community.general/pull/311).

View File

@@ -1,2 +0,0 @@
bugfixes:
- "filesystem - resizefs of xfs filesystems is fixed. Filesystem needs to be mounted."

View File

@@ -1,4 +0,0 @@
minor_changes:
- log_plays callback - use v2 methods (https://github.com/ansible-collections/community.general/pull/442).
breaking_changes:
- log_plays callback - add missing information to the logs generated by the callback plugin. This changes the log message format (https://github.com/ansible-collections/community.general/pull/442).

View File

@@ -1,3 +0,0 @@
bugfixes:
- yarn - fixed an index out of range error when no outdated packages where returned by yarn executable (see https://github.com/ansible-collections/community.general/pull/474).
- yarn - fixed an too many values to unpack error when scoped packages are installed (see https://github.com/ansible-collections/community.general/pull/474).

View File

@@ -1,10 +0,0 @@
---
bugfixes:
- docker_compose - add a condition to prevent service startup
if parameter ``stopped`` is true. Otherwise, the service will be
started on each play and stopped again immediately due to
the ``stopped`` parameter and breaks the idempotency of the module
(https://github.com/ansible-collections/community.general/issues/532).
- docker_compose - disallow usage of the parameters ``stopped`` and ``restarted``
at the same time. This breaks also the idempotency
(https://github.com/ansible-collections/community.general/issues/532).

View File

@@ -1,2 +0,0 @@
minor_changes:
- apk - added ``no_cache`` option (https://github.com/ansible-collections/community.general/pull/548).

View File

@@ -1,3 +0,0 @@
---
bugfixes:
- kubevirt - Add aliases 'interface_name' for network_name (https://github.com/ansible/ansible/issues/55641).

View File

@@ -1,2 +0,0 @@
minor_changes:
- pkgng - added ``stdout`` and ``stderr`` attributes to the result (https://github.com/ansible-collections/community.general/pull/560).

View File

@@ -1,2 +0,0 @@
bugfixes:
- nmcli - fix idempotetency when modifying an existing connection (https://github.com/ansible-collections/community.general/issues/481).

View File

@@ -1,2 +0,0 @@
bugfixes:
- docker_container - use Config MacAddress by default instead of Networks. Networks MacAddress is empty in some cases (https://github.com/ansible/ansible/issues/70206).

View File

@@ -1,2 +0,0 @@
deprecated_features:
- xbps - the ``force`` option never had any effect. It is now deprecated, and will be removed in 3.0.0 (https://github.com/ansible-collections/community.general/pull/568).

View File

@@ -1,6 +0,0 @@
---
minor_changes:
- "pkgng - added support for upgrading all packages using ``name: *, state: latest``, similar to other package providers (https://github.com/ansible-collections/community.general/pull/569)."
breaking_changes:
- "pkgng - passing ``name: *`` with ``state: latest`` or ``state: present`` will no longer install every package from the configured package repositories. Instead, ``name: *, state: latest`` will upgrade all already-installed packages, and ``name: *, state: present`` is a noop. (https://github.com/ansible-collections/community.general/pull/569)."
- "pkgng - passing ``name: *`` with ``state: absent`` will no longer remove every installed package from the system. It is now a noop. (https://github.com/ansible-collections/community.general/pull/569)."

View File

@@ -1,2 +0,0 @@
minor_changes:
- splunk callback - add an option to allow not to validate certificate from HEC (https://github.com/ansible-collections/community.general/pull/596).

View File

@@ -1,2 +0,0 @@
minor_changes:
- "logstash callback - add ini config (https://github.com/ansible-collections/community.general/pull/610)."

View File

@@ -1,2 +0,0 @@
minor_changes:
- gitlab_runners inventory plugin - permit environment variable input for ``server_url``, ``api_token`` and ``filter`` options (https://github.com/ansible-collections/community.general/pull/611).

View File

@@ -1,2 +0,0 @@
bugfixes:
- snmp_facts - skip ``EndOfMibView`` values (https://github.com/ansible/ansible/issues/49044).

View File

@@ -1,2 +0,0 @@
bugfixes:
- digital_ocean_tag_info - fix crash when querying for an individual tag (https://github.com/ansible-collections/community.general/pull/615).

View File

@@ -1,2 +0,0 @@
bugfixes:
- selective - mark task failed correctly (https://github.com/ansible/ansible/issues/63767).

View File

@@ -1,2 +0,0 @@
bugfixes:
- "docker_container - various error fixes in string handling for Python 2 to avoid crashes when non-ASCII characters are used in strings (https://github.com/ansible-collections/community.general/issues/640)."

View File

@@ -1,2 +0,0 @@
bugfixes:
- docker_swarm - removes ``advertise_addr`` from list of required arguments when ``state`` is ``"join"`` (https://github.com/ansible-collections/community.general/issues/439).

View File

@@ -1,4 +0,0 @@
bugfixes:
- pacman - treat package names containing .zst as package files during installation
(https://www.archlinux.org/news/now-using-zstandard-instead-of-xz-for-package-compression/,
https://github.com/ansible-collections/community.general/pull/650).

View File

@@ -1,4 +0,0 @@
---
bugfixes:
- postgresql_set - only display a warning about restarts, when
restarting is needed (https://github.com/ansible-collections/community.general/pull/651).

View File

@@ -1,2 +0,0 @@
minor_changes:
- postgresql_query - add search_path parameter (https://github.com/ansible-collections/community.general/issues/625).

View File

@@ -1,3 +0,0 @@
---
bugfixes:
- postgresql_privs - fix crash when set privileges on schema with hyphen in the name (https://github.com/ansible-collections/community.general/issues/656).

View File

@@ -1,2 +0,0 @@
minor_changes:
- gitlab_project - add support for merge_method on projects (https://github.com/ansible/ansible/pull/66813).

View File

@@ -1,2 +0,0 @@
bugfixes:
- osx_defaults - fix handling negative integers (https://github.com/ansible-collections/community.general/issues/134).

View File

@@ -1,5 +0,0 @@
---
bugfixes:
- jenkins_plugin - replace MD5 checksum verification with SHA1 due to MD5
being disabled on systems with FIPS-only algorithms enabled
(https://github.com/ansible/ansible/issues/34304).

View File

@@ -1,2 +0,0 @@
bugfixes:
- redfish_info, redfish_config, redfish_command - Fix Redfish response payload decode on Python 3.5 (https://github.com/ansible-collections/community.general/issues/686)

View File

@@ -1,7 +0,0 @@
---
minor_changes:
- haproxy - add options to dis/enable health and agent checks. When health
and agent checks are enabled for a service, a disabled service will
re-enable itself automatically. These options also change the state of
the agent checks to match the requested state for the backend
(https://github.com/ansible-collections/community.general/issues/684).

View File

@@ -1,2 +0,0 @@
minor_changes:
- xfconf - add arrays support (https://github.com/ansible/ansible/issues/46308).

View File

@@ -1,2 +0,0 @@
minor_changes:
- slack - add support for sending messages built with block kit (https://github.com/ansible-collections/community.general/issues/380).

View File

@@ -1,2 +0,0 @@
bugfixes:
- doas become plugin - address a bug with the parameters handling that was breaking the plugin in community.general when ``become_flags`` and ``become_user`` were not explicitly specified (https://github.com/ansible-collections/community.general/pull/704).

View File

@@ -1,2 +0,0 @@
bugfixes:
- jira - improve error message handling with multiple errors (https://github.com/ansible-collections/community.general/pull/707).

View File

@@ -1,3 +0,0 @@
bugfixes:
- dzdo become plugin - address a bug with the parameters handling that was breaking the plugin in community.general when ``become_user`` was not explicitly specified (https://github.com/ansible-collections/community.general/pull/708).
- pbrun become plugin - address a bug with the parameters handling that was breaking the plugin in community.general when ``become_user`` was not explicitly specified (https://github.com/ansible-collections/community.general/pull/708).

View File

@@ -1,2 +0,0 @@
minor_changes:
- lxd_container - added support of ``--target`` flag for cluster deployments (https://github.com/ansible-collections/community.general/issues/637).

View File

@@ -1,2 +0,0 @@
minor_changes:
- rundeck_acl_policy - add check for rundeck_acl_policy name parameter (https://github.com/ansible-collections/community.general/pull/612).

View File

@@ -1,3 +0,0 @@
---
minor_changes:
- "airbrake_deployment - add ``version`` param; clarified docs on ``revision`` param (https://github.com/ansible-collections/community.general/pull/583)."

View File

@@ -1,3 +0,0 @@
---
bugfixes:
- aix_filesystem - fix issues with ismount module_util pathing for Ansible 2.9 (https://github.com/ansible-collections/community.general/pull/567).

View File

@@ -1,2 +0,0 @@
removed_features:
- "conjur_variable lookup - has been moved to the ``cyberark.conjur`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/570)."

View File

@@ -1,2 +0,0 @@
removed_features:
- "digital_ocean_* - all DigitalOcean modules have been moved to the ``community.digitalocean`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/622)."

View File

@@ -1,3 +0,0 @@
---
minor_changes:
- firewalld - the module has been moved to the ``ansible.posix`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/623).

View File

@@ -1,3 +0,0 @@
minor_changes:
- Add the deprecated ``gcp_backend_service``, ``gcp_forwarding_rule`` and ``gcp_healthcheck`` modules, which will be removed in 2.0.0. These were originally in community.general, but removed on the assumption that they have been moved to google.cloud. Since this turned out to be incorrect, we re-added them for 1.0.0.
- Add the ``gcpubsub``, ``gcpubsub_info`` and ``gcpubsub_facts`` (to be removed in 3.0.0) modules. These were originally in community.general, but removed on the assumption that they have been moved to google.cloud. Since this turned out to be incorrect, we re-added them for 1.0.0.

View File

@@ -1,2 +0,0 @@
removed_features:
- "infini_* - all infinidat modules have been moved to the ``infinidat.infinibox`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/607)."

View File

@@ -1,3 +0,0 @@
removed_features:
- "logicmonitor - the module has been removed in 1.0.0 since it is unmaintained and the API used by the module has been turned off in 2017 (https://github.com/ansible-collections/community.general/issues/539, https://github.com/ansible-collections/community.general/pull/541)."
- "logicmonitor_facts - the module has been removed in 1.0.0 since it is unmaintained and the API used by the module has been turned off in 2017 (https://github.com/ansible-collections/community.general/issues/539, https://github.com/ansible-collections/community.general/pull/541)."

View File

@@ -1,2 +0,0 @@
removed_features:
- "mysql_* - all MySQL modules have been moved to the ``community.mysql`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/633)."

View File

@@ -1,2 +0,0 @@
minor_changes:
- "parted - accept negative numbers in ``part_start`` and ``part_end``"

View File

@@ -1,2 +0,0 @@
deprecated_features:
- The ldap_attr module has been deprecated and will be removed in a later release; use ldap_attrs instead.

View File

@@ -1,2 +0,0 @@
removed_features:
- "proxysql_* - all ProxySQL modules have been moved to the ``community.proxysql`` collection. A redirection is active, which will be removed in version 2.0.0 (https://github.com/ansible-collections/community.general/pull/624)."

View File

@@ -1,2 +0,0 @@
minor_changes:
- xfconf - add support for ``uint`` type (https://github.com/ansible-collections/community.general/pull/696).

View File

@@ -1,18 +1,18 @@
namespace: community
name: general
version: 1.0.0
version: 1.1.0
readme: README.md
authors:
- Ansible (https://github.com/ansible)
description: null
license_file: COPYING
tags: null
tags: [community]
# NOTE: No more dependencies can be added to this list
dependencies:
ansible.netcommon: '>=1.0.0'
ansible.posix: '>=1.0.0'
community.kubernetes: '>=0.11.1' # check https://galaxy.ansible.com/community/kubernetes
google.cloud: '>=0.10.1' # check https://galaxy.ansible.com/google/cloud
community.kubernetes: '>=1.0.0'
google.cloud: '>=1.0.0'
repository: https://github.com/ansible-collections/community.general
#documentation: https://github.com/ansible-collection-migration/community.general/tree/main/docs
homepage: https://github.com/ansible-collections/community.general

View File

View File

@@ -0,0 +1 @@
./system/iptables_state.py

1
plugins/action/shutdown.py Symbolic link
View File

@@ -0,0 +1 @@
./system/shutdown.py

View File

@@ -0,0 +1,189 @@
# Copyright: (c) 2020, quidame <quidame@poivron.org>
# 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
import time
from ansible.plugins.action import ActionBase
from ansible.errors import AnsibleError, AnsibleActionFail, AnsibleConnectionFailure
from ansible.utils.vars import merge_hash
from ansible.utils.display import Display
display = Display()
class ActionModule(ActionBase):
# Keep internal params away from user interactions
_VALID_ARGS = frozenset(('path', 'state', 'table', 'noflush', 'counters', 'modprobe', 'ip_version', 'wait'))
DEFAULT_SUDOABLE = True
MSG_ERROR__ASYNC_AND_POLL_NOT_ZERO = (
"This module doesn't support async>0 and poll>0 when its 'state' param "
"is set to 'restored'. To enable its rollback feature (that needs the "
"module to run asynchronously on the remote), please set task attribute "
"'poll' (=%s) to 0, and 'async' (=%s) to a value >2 and not greater than "
"'ansible_timeout' (=%s) (recommended).")
MSG_WARNING__NO_ASYNC_IS_NO_ROLLBACK = (
"Attempts to restore iptables state without rollback in case of mistake "
"may lead the ansible controller to loose access to the hosts and never "
"regain it before fixing firewall rules through a serial console, or any "
"other way except SSH. Please set task attribute 'poll' (=%s) to 0, and "
"'async' (=%s) to a value >2 and not greater than 'ansible_timeout' (=%s) "
"(recommended).")
MSG_WARNING__ASYNC_GREATER_THAN_TIMEOUT = (
"You attempt to restore iptables state with rollback in case of mistake, "
"but with settings that will lead this rollback to happen AFTER that the "
"controller will reach its own timeout. Please set task attribute 'poll' "
"(=%s) to 0, and 'async' (=%s) to a value >2 and not greater than "
"'ansible_timeout' (=%s) (recommended).")
def _async_result(self, module_args, task_vars, timeout):
'''
Retrieve results of the asynchonous task, and display them in place of
the async wrapper results (those with the ansible_job_id key).
'''
# At least one iteration is required, even if timeout is 0.
for i in range(max(1, timeout)):
async_result = self._execute_module(
module_name='async_status',
module_args=module_args,
task_vars=task_vars,
wrap_async=False)
if async_result['finished'] == 1:
break
time.sleep(min(1, timeout))
return async_result
def run(self, tmp=None, task_vars=None):
self._supports_check_mode = True
self._supports_async = True
result = super(ActionModule, self).run(tmp, task_vars)
del tmp # tmp no longer has any effect
if not result.get('skipped'):
# FUTURE: better to let _execute_module calculate this internally?
wrap_async = self._task.async_val and not self._connection.has_native_async
# Set short names for values we'll have to compare or reuse
task_poll = self._task.poll
task_async = self._task.async_val
check_mode = self._play_context.check_mode
max_timeout = self._connection._play_context.timeout
module_name = self._task.action
module_args = self._task.args
if module_args.get('state', None) == 'restored':
if not wrap_async:
if not check_mode:
display.warning(self.MSG_WARNING__NO_ASYNC_IS_NO_ROLLBACK % (
task_poll,
task_async,
max_timeout))
elif task_poll:
raise AnsibleActionFail(self.MSG_ERROR__ASYNC_AND_POLL_NOT_ZERO % (
task_poll,
task_async,
max_timeout))
else:
if task_async > max_timeout and not check_mode:
display.warning(self.MSG_WARNING__ASYNC_GREATER_THAN_TIMEOUT % (
task_poll,
task_async,
max_timeout))
# BEGIN snippet from async_status action plugin
env_async_dir = [e for e in self._task.environment if
"ANSIBLE_ASYNC_DIR" in e]
if len(env_async_dir) > 0:
# for backwards compatibility we need to get the dir from
# ANSIBLE_ASYNC_DIR that is defined in the environment. This is
# deprecated and will be removed in favour of shell options
async_dir = env_async_dir[0]['ANSIBLE_ASYNC_DIR']
msg = "Setting the async dir from the environment keyword " \
"ANSIBLE_ASYNC_DIR is deprecated. Set the async_dir " \
"shell option instead"
display.deprecated(msg, version='2.0.0',
collection_name='community.general') # was Ansible 2.12
else:
# inject the async directory based on the shell option into the
# module args
async_dir = self.get_shell_option('async_dir', default="~/.ansible_async")
# END snippet from async_status action plugin
# Bind the loop max duration to consistent values on both
# remote and local sides (if not the same, make the loop
# longer on the controller); and set a backup file path.
module_args['_timeout'] = task_async
module_args['_back'] = '%s/iptables.state' % async_dir
async_status_args = dict(_async_dir=async_dir)
confirm_cmd = 'rm -f %s' % module_args['_back']
remaining_time = max(task_async, max_timeout)
# do work!
result = merge_hash(result, self._execute_module(module_args=module_args, task_vars=task_vars, wrap_async=wrap_async))
# Then the 3-steps "go ahead or rollback":
# - reset connection to ensure a persistent one will not be reused
# - confirm the restored state by removing the backup on the remote
# - retrieve the results of the asynchronous task to return them
if '_back' in module_args:
async_status_args['jid'] = result.get('ansible_job_id', None)
if async_status_args['jid'] is None:
raise AnsibleActionFail("Unable to get 'ansible_job_id'.")
# Catch early errors due to missing mandatory option, bad
# option type/value, missing required system command, etc.
result = merge_hash(result, self._async_result(async_status_args, task_vars, 0))
if not result['finished']:
try:
self._connection.reset()
display.v("%s: reset connection" % (module_name))
except AttributeError:
display.warning("Connection plugin does not allow to reset the connection.")
for x in range(max_timeout):
time.sleep(1)
remaining_time -= 1
# - AnsibleConnectionFailure covers rejected requests (i.e.
# by rules with '--jump REJECT')
# - ansible_timeout is able to cover dropped requests (due
# to a rule or policy DROP) if not lower than async_val.
try:
garbage = self._low_level_execute_command(confirm_cmd, sudoable=self.DEFAULT_SUDOABLE)
break
except AnsibleConnectionFailure:
continue
result = merge_hash(result, self._async_result(async_status_args, task_vars, remaining_time))
# Cleanup async related stuff and internal params
for key in ('ansible_job_id', 'results_file', 'started', 'finished'):
if result.get(key):
del result[key]
if result.get('invocation', {}).get('module_args'):
if '_timeout' in result['invocation']['module_args']:
del result['invocation']['module_args']['_back']
del result['invocation']['module_args']['_timeout']
async_status_args['mode'] = 'cleanup'
garbage = self._execute_module(
module_name='async_status',
module_args=async_status_args,
task_vars=task_vars,
wrap_async=False)
if not wrap_async:
# remove a temporary path we created
self._remove_tmp_path(self._connection._shell.tmpdir)
return result

View File

@@ -0,0 +1,211 @@
# Copyright: (c) 2020, Amin Vakil <info@aminvakil.com>
# Copyright: (c) 2016-2018, Matt Davis <mdavis@ansible.com>
# Copyright: (c) 2018, Sam Doran <sdoran@redhat.com>
# 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
from ansible.errors import AnsibleError, AnsibleConnectionFailure
from ansible.module_utils._text import to_native, to_text
from ansible.module_utils.common.collections import is_string
from ansible.plugins.action import ActionBase
from ansible.utils.display import Display
display = Display()
class TimedOutException(Exception):
pass
class ActionModule(ActionBase):
TRANSFERS_FILES = False
_VALID_ARGS = frozenset((
'msg',
'delay',
'search_paths'
))
DEFAULT_CONNECT_TIMEOUT = None
DEFAULT_PRE_SHUTDOWN_DELAY = 0
DEFAULT_SHUTDOWN_MESSAGE = 'Shut down initiated by Ansible'
DEFAULT_SHUTDOWN_COMMAND = 'shutdown'
DEFAULT_SHUTDOWN_COMMAND_ARGS = '-h {delay_min} "{message}"'
DEFAULT_SUDOABLE = True
SHUTDOWN_COMMANDS = {
'alpine': 'poweroff',
'vmkernel': 'halt',
}
SHUTDOWN_COMMAND_ARGS = {
'alpine': '',
'void': '-h +{delay_min} "{message}"',
'freebsd': '-h +{delay_sec}s "{message}"',
'linux': DEFAULT_SHUTDOWN_COMMAND_ARGS,
'macosx': '-h +{delay_min} "{message}"',
'openbsd': '-h +{delay_min} "{message}"',
'solaris': '-y -g {delay_sec} -i 5 "{message}"',
'sunos': '-y -g {delay_sec} -i 5 "{message}"',
'vmkernel': '-d {delay_sec}',
'aix': '-Fh',
}
def __init__(self, *args, **kwargs):
super(ActionModule, self).__init__(*args, **kwargs)
@property
def delay(self):
return self._check_delay('delay', self.DEFAULT_PRE_SHUTDOWN_DELAY)
def _check_delay(self, key, default):
"""Ensure that the value is positive or zero"""
value = int(self._task.args.get(key, default))
if value < 0:
value = 0
return value
def _get_value_from_facts(self, variable_name, distribution, default_value):
"""Get dist+version specific args first, then distribution, then family, lastly use default"""
attr = getattr(self, variable_name)
value = attr.get(
distribution['name'] + distribution['version'],
attr.get(
distribution['name'],
attr.get(
distribution['family'],
getattr(self, default_value))))
return value
def get_shutdown_command_args(self, distribution):
args = self._get_value_from_facts('SHUTDOWN_COMMAND_ARGS', distribution, 'DEFAULT_SHUTDOWN_COMMAND_ARGS')
# Convert seconds to minutes. If less that 60, set it to 0.
delay_sec = self.delay
shutdown_message = self._task.args.get('msg', self.DEFAULT_SHUTDOWN_MESSAGE)
return args.format(delay_sec=delay_sec, delay_min=delay_sec // 60, message=shutdown_message)
def get_distribution(self, task_vars):
# FIXME: only execute the module if we don't already have the facts we need
distribution = {}
display.debug('{action}: running setup module to get distribution'.format(action=self._task.action))
module_output = self._execute_module(
task_vars=task_vars,
module_name='ansible.legacy.setup',
module_args={'gather_subset': 'min'})
try:
if module_output.get('failed', False):
raise AnsibleError('Failed to determine system distribution. {0}, {1}'.format(
to_native(module_output['module_stdout']).strip(),
to_native(module_output['module_stderr']).strip()))
distribution['name'] = module_output['ansible_facts']['ansible_distribution'].lower()
distribution['version'] = to_text(module_output['ansible_facts']['ansible_distribution_version'].split('.')[0])
distribution['family'] = to_text(module_output['ansible_facts']['ansible_os_family'].lower())
display.debug("{action}: distribution: {dist}".format(action=self._task.action, dist=distribution))
return distribution
except KeyError as ke:
raise AnsibleError('Failed to get distribution information. Missing "{0}" in output.'.format(ke.args[0]))
def get_shutdown_command(self, task_vars, distribution):
shutdown_bin = self._get_value_from_facts('SHUTDOWN_COMMANDS', distribution, 'DEFAULT_SHUTDOWN_COMMAND')
default_search_paths = ['/sbin', '/usr/sbin', '/usr/local/sbin']
search_paths = self._task.args.get('search_paths', default_search_paths)
# FIXME: switch all this to user arg spec validation methods when they are available
# Convert bare strings to a list
if is_string(search_paths):
search_paths = [search_paths]
# Error if we didn't get a list
err_msg = "'search_paths' must be a string or flat list of strings, got {0}"
try:
incorrect_type = any(not is_string(x) for x in search_paths)
if not isinstance(search_paths, list) or incorrect_type:
raise TypeError
except TypeError:
raise AnsibleError(err_msg.format(search_paths))
display.debug('{action}: running find module looking in {paths} to get path for "{command}"'.format(
action=self._task.action,
command=shutdown_bin,
paths=search_paths))
find_result = self._execute_module(
task_vars=task_vars,
# prevent collection search by calling with ansible.legacy (still allows library/ override of find)
module_name='ansible.legacy.find',
module_args={
'paths': search_paths,
'patterns': [shutdown_bin],
'file_type': 'any'
}
)
full_path = [x['path'] for x in find_result['files']]
if not full_path:
raise AnsibleError('Unable to find command "{0}" in search paths: {1}'.format(shutdown_bin, search_paths))
self._shutdown_command = full_path[0]
return self._shutdown_command
def perform_shutdown(self, task_vars, distribution):
result = {}
shutdown_result = {}
shutdown_command = self.get_shutdown_command(task_vars, distribution)
shutdown_command_args = self.get_shutdown_command_args(distribution)
shutdown_command_exec = '{0} {1}'.format(shutdown_command, shutdown_command_args)
self.cleanup(force=True)
try:
display.vvv("{action}: shutting down server...".format(action=self._task.action))
display.debug("{action}: shutting down server with command '{command}'".format(action=self._task.action, command=shutdown_command_exec))
if self._play_context.check_mode:
shutdown_result['rc'] = 0
else:
shutdown_result = self._low_level_execute_command(shutdown_command_exec, sudoable=self.DEFAULT_SUDOABLE)
except AnsibleConnectionFailure as e:
# If the connection is closed too quickly due to the system being shutdown, carry on
display.debug('{action}: AnsibleConnectionFailure caught and handled: {error}'.format(action=self._task.action, error=to_text(e)))
shutdown_result['rc'] = 0
if shutdown_result['rc'] != 0:
result['failed'] = True
result['shutdown'] = False
result['msg'] = "Shutdown command failed. Error was {stdout}, {stderr}".format(
stdout=to_native(shutdown_result['stdout'].strip()),
stderr=to_native(shutdown_result['stderr'].strip()))
return result
result['failed'] = False
result['shutdown_command'] = shutdown_command_exec
return result
def run(self, tmp=None, task_vars=None):
self._supports_check_mode = True
self._supports_async = True
# If running with local connection, fail so we don't shutdown ourself
if self._connection.transport == 'local' and (not self._play_context.check_mode):
msg = 'Running {0} with local connection would shutdown the control node.'.format(self._task.action)
return {'changed': False, 'elapsed': 0, 'shutdown': False, 'failed': True, 'msg': msg}
if task_vars is None:
task_vars = {}
result = super(ActionModule, self).run(tmp, task_vars)
if result.get('skipped', False) or result.get('failed', False):
return result
distribution = self.get_distribution(task_vars)
# Initiate shutdown
shutdown_result = self.perform_shutdown(task_vars, distribution)
if shutdown_result['failed']:
result = shutdown_result
return result
result['shutdown'] = True
result['changed'] = True
result['shutdown_command'] = shutdown_result['shutdown_command']
return result

View File

@@ -75,7 +75,7 @@ examples: >
To enable, add this to your ansible.cfg file in the defaults block
[defaults]
callback_whitelist = logentries
callback_whitelist = community.general.logentries
Either set the environment variables
export LOGENTRIES_API=data.logentries.com

View File

@@ -63,7 +63,7 @@ EXAMPLES = '''
examples: >
To enable, add this to your ansible.cfg file in the defaults block
[defaults]
callback_whitelist = splunk
callback_whitelist = community.general.splunk
Set the environment variable
export SPLUNK_URL=http://mysplunkinstance.datapaas.io:8088/services/collector/event
export SPLUNK_AUTHTOKEN=f23blad6-5965-4537-bf69-5b5a545blabla88

View File

@@ -42,7 +42,7 @@ EXAMPLES = '''
examples: >
To enable, add this to your ansible.cfg file in the defaults block
[defaults]
callback_whitelist = sumologic
callback_whitelist = community.general.sumologic
Set the environment variable
export SUMOLOGIC_URL=https://endpoint1.collection.us2.sumologic.com/receiver/v1/http/R8moSv1d8EW9LAUFZJ6dbxCFxwLH6kfCdcBfddlfxCbLuL-BN5twcTpMk__pYy_cDmp==

View File

@@ -150,7 +150,7 @@ DOCUMENTATION = '''
from ansible_collections.community.kubernetes.plugins.connection.kubectl import Connection as KubectlConnection
CONNECTION_TRANSPORT = 'oc'
CONNECTION_TRANSPORT = 'community.general.oc'
CONNECTION_OPTIONS = {
'oc_container': '-c',

View File

@@ -16,6 +16,7 @@ options:
description:
- Scaleway OAuth token.
type: str
required: true
aliases: [ oauth_token ]
api_url:
description:

94
plugins/filter/jc.py Normal file
View File

@@ -0,0 +1,94 @@
# (c) 2015, Filipe Niero Felisbino <filipenf@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
# contributed by Kelly Brazil <kellyjonbrazil@gmail.com>
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError, AnsibleFilterError
import importlib
try:
import jc
HAS_LIB = True
except ImportError:
HAS_LIB = False
def jc(data, parser, quiet=True, raw=False):
"""Convert returned command output to JSON using the JC library
Arguments:
parser required (string) the correct parser for the input data (e.g. 'ifconfig')
see https://github.com/kellyjonbrazil/jc#parsers for latest list of parsers.
quiet optional (bool) True to suppress warning messages (default is True)
raw optional (bool) True to return pre-processed JSON (default is False)
Returns:
dictionary or list of dictionaries
Example:
- name: run date command
hosts: ubuntu
tasks:
- shell: date
register: result
- set_fact:
myvar: "{{ result.stdout | community.general.jc('date') }}"
- debug:
msg: "{{ myvar }}"
produces:
ok: [192.168.1.239] => {
"msg": {
"day": 9,
"hour": 22,
"minute": 6,
"month": "Aug",
"month_num": 8,
"second": 22,
"timezone": "UTC",
"weekday": "Sun",
"weekday_num": 1,
"year": 2020
}
}
"""
if not HAS_LIB:
raise AnsibleError('You need to install "jc" prior to running jc filter')
try:
jc_parser = importlib.import_module('jc.parsers.' + parser)
return jc_parser.parse(data, quiet=quiet, raw=raw)
except Exception as e:
raise AnsibleFilterError('Error in jc filter plugin: %s' % e)
class FilterModule(object):
''' Query filter '''
def filters(self):
return {
'jc': jc
}

View File

@@ -17,9 +17,9 @@ DOCUMENTATION = '''
- inventory_cache
options:
plugin:
description: The name of this plugin, it should always be set to C(cobbler) for this plugin to recognize it as it's own.
description: The name of this plugin, it should always be set to C(community.general.cobbler) for this plugin to recognize it as it's own.
required: yes
choices: ['cobbler']
choices: [ 'cobbler', 'community.general.cobbler' ]
url:
description: URL to cobbler.
default: 'http://cobbler/cobbler_api'
@@ -92,7 +92,7 @@ except ImportError:
class InventoryModule(BaseInventoryPlugin, Cacheable):
''' Host inventory parser for ansible using cobbler as source. '''
NAME = 'cobbler'
NAME = 'community.general.cobbler'
def __init__(self):

View File

@@ -24,7 +24,7 @@ DOCUMENTATION = '''
plugin:
description: token that ensures this is a source file for the C(docker_machine) plugin.
required: yes
choices: ['docker_machine']
choices: ['docker_machine', 'community.general.docker_machine']
daemon_env:
description:
- Whether docker daemon connection environment variables should be fetched, and how to behave if they cannot be fetched.
@@ -54,7 +54,7 @@ DOCUMENTATION = '''
EXAMPLES = '''
# Minimal example
plugin: docker_machine
plugin: community.general.docker_machine
# Example using constructed features to create a group per Docker Machine driver
# (https://docs.docker.com/machine/drivers/), e.g.:

View File

@@ -26,11 +26,11 @@ DOCUMENTATION = '''
I(nonleaders) - all nodes except the swarm leader."
options:
plugin:
description: The name of this plugin, it should always be set to C(docker_swarm) for this plugin to
recognize it as it's own.
description: The name of this plugin, it should always be set to C(community.general.docker_swarm)
for this plugin to recognize it as it's own.
type: str
required: true
choices: docker_swarm
choices: [ docker_swarm, community.general.docker_swarm ]
docker_host:
description:
- Socket of a Docker swarm manager node (C(tcp), C(unix)).
@@ -101,20 +101,20 @@ DOCUMENTATION = '''
EXAMPLES = '''
# Minimal example using local docker
plugin: docker_swarm
plugin: community.general.docker_swarm
docker_host: unix://var/run/docker.sock
# Minimal example using remote docker
plugin: docker_swarm
plugin: community.general.docker_swarm
docker_host: tcp://my-docker-host:2375
# Example using remote docker with unverified TLS
plugin: docker_swarm
plugin: community.general.docker_swarm
docker_host: tcp://my-docker-host:2376
tls: yes
# Example using remote docker with verified TLS and client certificate verification
plugin: docker_swarm
plugin: community.general.docker_swarm
docker_host: tcp://my-docker-host:2376
validate_certs: yes
ca_cert: /somewhere/ca.pem
@@ -122,7 +122,7 @@ client_key: /somewhere/key.pem
client_cert: /somewhere/cert.pem
# Example using constructed features to create groups and set ansible_host
plugin: docker_swarm
plugin: community.general.docker_swarm
docker_host: tcp://my-docker-host:2375
strict: False
keyed_groups:

View File

@@ -28,6 +28,7 @@ DOCUMENTATION = '''
required: true
choices:
- gitlab_runners
- community.general.gitlab_runners
server_url:
description: The URL of the GitLab server, with protocol (i.e. http or https).
env:
@@ -60,11 +61,11 @@ DOCUMENTATION = '''
EXAMPLES = '''
# gitlab_runners.yml
plugin: gitlab_runners
plugin: community.general.gitlab_runners
host: https://gitlab.com
# Example using constructed features to create groups and set ansible_host
plugin: gitlab_runners
plugin: community.general.gitlab_runners
host: https://gitlab.com
strict: False
keyed_groups:

View File

@@ -24,7 +24,7 @@ DOCUMENTATION = '''
plugin:
description: token that ensures this is a source file for the 'kubevirt' plugin.
required: True
choices: ['kubevirt']
choices: ['kubevirt', 'community.general.kubevirt']
type: str
host_format:
description:
@@ -123,7 +123,7 @@ EXAMPLES = '''
# File must be named kubevirt.yaml or kubevirt.yml
# Authenticate with token, and return all virtual machines for all namespaces
plugin: kubevirt
plugin: community.general.kubevirt
connections:
- host: https://kubevirt.io
token: xxxxxxxxxxxxxxxx
@@ -131,7 +131,7 @@ connections:
# Use default config (~/.kube/config) file and active context, and return vms with interfaces
# connected to network myovsnetwork and from namespace vms
plugin: kubevirt
plugin: community.general.kubevirt
connections:
- namespaces:
- vms

View File

@@ -22,7 +22,7 @@ DOCUMENTATION = r'''
plugin:
description: marks this as an instance of the 'linode' plugin
required: true
choices: ['linode']
choices: ['linode', 'community.general.linode']
access_token:
description: The Linode account personal access token.
required: true
@@ -42,10 +42,10 @@ DOCUMENTATION = r'''
EXAMPLES = r'''
# Minimal example. `LINODE_ACCESS_TOKEN` is exposed in environment.
plugin: linode
plugin: community.general.linode
# Example with regions, types, groups and access token
plugin: linode
plugin: community.general.linode
access_token: foobar
regions:
- eu-west

View File

@@ -19,7 +19,7 @@ DOCUMENTATION = '''
plugin:
description: token that ensures this is a source file for the 'nmap' plugin.
required: True
choices: ['nmap']
choices: ['nmap', 'community.general.nmap']
address:
description: Network IP or range of IPs to scan, you can use a simple range (10.2.2.15-25) or CIDR notation.
required: True
@@ -43,10 +43,10 @@ DOCUMENTATION = '''
- 'TODO: add OS fingerprinting'
'''
EXAMPLES = '''
# inventory.config file in YAML format
plugin: nmap
strict: False
address: 192.168.0.0/24
# inventory.config file in YAML format
plugin: community.general.nmap
strict: False
address: 192.168.0.0/24
'''
import os

View File

@@ -18,7 +18,7 @@ DOCUMENTATION = '''
plugin:
description: token that ensures this is a source file for the 'online' plugin.
required: True
choices: ['online']
choices: ['online', 'community.general.online']
oauth_token:
required: True
description: Online OAuth token.
@@ -49,7 +49,7 @@ EXAMPLES = '''
# online_inventory.yml file in YAML format
# Example command line: ansible-inventory --list -i online_inventory.yml
plugin: online
plugin: community.general.online
hostnames:
- public_ipv4
groups:

View File

@@ -17,7 +17,7 @@ DOCUMENTATION = '''
plugin:
description: token that ensures this is a source file for the 'scaleway' plugin.
required: True
choices: ['scaleway']
choices: ['scaleway', 'community.general.scaleway']
regions:
description: Filter results on a specific Scaleway region
type: list
@@ -60,7 +60,7 @@ EXAMPLES = '''
# use hostname as inventory_hostname
# use the private IP address to connect to the host
plugin: scaleway
plugin: community.general.scaleway
regions:
- ams1
- par1
@@ -73,7 +73,7 @@ variables:
state: state
# use hostname as inventory_hostname and public IP address to connect to the host
plugin: scaleway
plugin: community.general.scaleway
hostnames:
- hostname
regions:

View File

@@ -19,7 +19,7 @@ DOCUMENTATION = '''
plugin:
description: token that ensures this is a source file for the 'virtualbox' plugin
required: True
choices: ['virtualbox']
choices: ['virtualbox', 'community.general.virtualbox']
running_only:
description: toggles showing all vms vs only those currently running
type: boolean
@@ -38,7 +38,7 @@ DOCUMENTATION = '''
EXAMPLES = '''
# file must be named vbox.yaml or vbox.yml
simple_config_file:
plugin: virtualbox
plugin: community.general.virtualbox
settings_password_file: /etc/virtulbox/secrets
query:
logged_in_users: /VirtualBox/GuestInfo/OS/LoggedInUsersList
@@ -46,7 +46,7 @@ simple_config_file:
ansible_connection: ('indows' in vbox_Guest_OS)|ternary('winrm', 'ssh')
# add hosts (all match with minishift vm) to the group container if any of the vms are in ansible_inventory'
plugin: virtualbox
plugin: community.general.virtualbox
groups:
container: "'minis' in (inventory_hostname)"
'''

View File

@@ -20,11 +20,13 @@ DOCUMENTATION = '''
EXAMPLES = """
- name: Example of the change in the description
ansible.builtin.debug: msg="{{ lookup('cartesian', [1,2,3], [a, b])}}"
ansible.builtin.debug:
msg: "{{ lookup('community.general.cartesian', [1,2,3], [a, b])}}"
- name: loops over the cartesian product of the supplied lists
ansible.builtin.debug: msg="{{item}}"
with_cartesian:
ansible.builtin.debug:
msg: "{{item}}"
with_community.general.cartesian:
- "{{list1}}"
- "{{list2}}"
- [1,2,3,4,5,6]

View File

@@ -28,7 +28,7 @@ DOCUMENTATION = '''
EXAMPLES = """
- ansible.builtin.debug:
msg: "{{ lookup('chef_databag', 'name=data_bag_name item=data_bag_item') }}"
msg: "{{ lookup('community.general.chef_databag', 'name=data_bag_name item=data_bag_item') }}"
"""
RETURN = """

View File

@@ -27,7 +27,7 @@ DOCUMENTATION = '''
- If the key has a value with the specified index then this is returned allowing access to historical values.
datacenter:
description:
- Retrieve the key from a consul datatacenter other than the default for the consul host.
- Retrieve the key from a consul datacenter other than the default for the consul host.
token:
description: The acl token to allow access to restricted values.
host:
@@ -80,18 +80,18 @@ DOCUMENTATION = '''
EXAMPLES = """
- ansible.builtin.debug:
msg: 'key contains {{item}}'
with_consul_kv:
with_community.general.consul_kv:
- 'key/to/retrieve'
- name: Parameters can be provided after the key be more specific about what to retrieve
ansible.builtin.debug:
msg: 'key contains {{item}}'
with_consul_kv:
with_community.general.consul_kv:
- 'key/to recurse=true token=E6C060A9-26FB-407A-B83E-12DDAFCB4D98'
- name: retrieving a KV from a remote cluster on non default port
ansible.builtin.debug:
msg: "{{ lookup('consul_kv', 'my/key', host='10.10.10.10', port='2000') }}"
msg: "{{ lookup('community.general.consul_kv', 'my/key', host='10.10.10.10', port='2000') }}"
"""
RETURN = """

View File

@@ -47,13 +47,16 @@ EXAMPLES = """
ansible.builtin.shell: credstash put my-github-password secure123
- name: "Test credstash lookup plugin -- get my github password"
ansible.builtin.debug: msg="Credstash lookup! {{ lookup('credstash', 'my-github-password') }}"
ansible.builtin.debug:
msg: "Credstash lookup! {{ lookup('community.general.credstash', 'my-github-password') }}"
- name: "Test credstash lookup plugin -- get my other password from us-west-1"
ansible.builtin.debug: msg="Credstash lookup! {{ lookup('credstash', 'my-other-password', region='us-west-1') }}"
ansible.builtin.debug:
msg: "Credstash lookup! {{ lookup('community.general.credstash', 'my-other-password', region='us-west-1') }}"
- name: "Test credstash lookup plugin -- get the company's github password"
ansible.builtin.debug: msg="Credstash lookup! {{ lookup('credstash', 'company-github-password', table='company-passwords') }}"
ansible.builtin.debug:
msg: "Credstash lookup! {{ lookup('community.general.credstash', 'company-github-password', table='company-passwords') }}"
- name: Example play using the 'context' feature
hosts: localhost
@@ -64,10 +67,12 @@ EXAMPLES = """
tasks:
- name: "Test credstash lookup plugin -- get the password with a context passed as a variable"
ansible.builtin.debug: msg="{{ lookup('credstash', 'some-password', context=context) }}"
ansible.builtin.debug:
msg: "{{ lookup('community.general.credstash', 'some-password', context=context) }}"
- name: "Test credstash lookup plugin -- get the password with a context defined here"
ansible.builtin.debug: msg="{{ lookup('credstash', 'some-password', context=dict(app='my_app', environment='production')) }}"
ansible.builtin.debug:
msg: "{{ lookup('community.general.credstash', 'some-password', context=dict(app='my_app', environment='production')) }}"
"""
RETURN = """

View File

@@ -29,14 +29,15 @@ DOCUMENTATION = '''
- "They could be: Password, PassProps.<property>, PasswordChangeInProcess"
default: 'password'
_extra:
description: for extra_parms values please check parameters for clipasswordsdk in CyberArk's "Credential Provider and ASCP Implementation Guide"
description: for extra_params values please check parameters for clipasswordsdk in CyberArk's "Credential Provider and ASCP Implementation Guide"
note:
- For Ansible on windows, please change the -parameters (-p, -d, and -o) to /parameters (/p, /d, and /o) and change the location of CLIPasswordSDK.exe
'''
EXAMPLES = """
- name: passing options to the lookup
ansible.builtin.debug: msg={{ lookup("cyberarkpassword", cyquery)}}
ansible.builtin.debug:
msg: '{{ lookup("community.general.cyberarkpassword", cyquery) }}'
vars:
cyquery:
appid: "app_ansible"
@@ -45,8 +46,9 @@ EXAMPLES = """
- name: used in a loop
ansible.builtin.debug: msg={{item}}
with_cyberarkpassword:
ansible.builtin.debug:
msg: "{{item}}"
with_community.general.cyberarkpassword:
appid: 'app_ansible'
query: 'safe=CyberArk_Passwords;folder=root;object=AdminPass'
output: 'Password,PassProps.UserName,PassProps.Address,PasswordChangeInProcess'

View File

@@ -44,31 +44,40 @@ DOCUMENTATION = '''
EXAMPLES = """
- name: Simple A record (IPV4 address) lookup for example.com
ansible.builtin.debug: msg="{{ lookup('dig', 'example.com.')}}"
ansible.builtin.debug:
msg: "{{ lookup('community.general.dig', 'example.com.')}}"
- name: "The TXT record for example.org."
ansible.builtin.debug: msg="{{ lookup('dig', 'example.org.', 'qtype=TXT') }}"
ansible.builtin.debug:
msg: "{{ lookup('community.general.dig', 'example.org.', 'qtype=TXT') }}"
- name: "The TXT record for example.org, alternative syntax."
ansible.builtin.debug: msg="{{ lookup('dig', 'example.org./TXT') }}"
ansible.builtin.debug:
msg: "{{ lookup('community.general.dig', 'example.org./TXT') }}"
- name: use in a loop
ansible.builtin.debug: msg="MX record for gmail.com {{ item }}"
with_items: "{{ lookup('dig', 'gmail.com./MX', wantlist=True) }}"
ansible.builtin.debug:
msg: "MX record for gmail.com {{ item }}"
with_items: "{{ lookup('community.general.dig', 'gmail.com./MX', wantlist=True) }}"
- ansible.builtin.debug: msg="Reverse DNS for 192.0.2.5 is {{ lookup('dig', '192.0.2.5/PTR') }}"
- ansible.builtin.debug: msg="Reverse DNS for 192.0.2.5 is {{ lookup('dig', '5.2.0.192.in-addr.arpa./PTR') }}"
- ansible.builtin.debug: msg="Reverse DNS for 192.0.2.5 is {{ lookup('dig', '5.2.0.192.in-addr.arpa.', 'qtype=PTR') }}"
- ansible.builtin.debug: msg="Querying 198.51.100.23 for IPv4 address for example.com. produces {{ lookup('dig', 'example.com', '@198.51.100.23') }}"
- ansible.builtin.debug:
msg: "Reverse DNS for 192.0.2.5 is {{ lookup('community.general.dig', '192.0.2.5/PTR') }}"
- ansible.builtin.debug:
msg: "Reverse DNS for 192.0.2.5 is {{ lookup('community.general.dig', '5.2.0.192.in-addr.arpa./PTR') }}"
- ansible.builtin.debug:
msg: "Reverse DNS for 192.0.2.5 is {{ lookup('community.general.dig', '5.2.0.192.in-addr.arpa.', 'qtype=PTR') }}"
- ansible.builtin.debug:
msg: "Querying 198.51.100.23 for IPv4 address for example.com. produces {{ lookup('dig', 'example.com', '@198.51.100.23') }}"
- ansible.builtin.debug: msg="XMPP service for gmail.com. is available at {{ item.target }} on port {{ item.port }}"
with_items: "{{ lookup('dig', '_xmpp-server._tcp.gmail.com./SRV', 'flat=0', wantlist=True) }}"
- ansible.builtin.debug:
msg: "XMPP service for gmail.com. is available at {{ item.target }} on port {{ item.port }}"
with_items: "{{ lookup('community.general.dig', '_xmpp-server._tcp.gmail.com./SRV', 'flat=0', wantlist=True) }}"
"""
RETURN = """
_list:
description:
- list of composed strings or dictonaries with key and value
- list of composed strings or dictionaries with key and value
If a dictionary, fields shows the keys returned depending on query type
contains:
ALL:

View File

@@ -21,18 +21,21 @@ DOCUMENTATION = '''
EXAMPLES = """
- name: show txt entry
ansible.builtin.debug: msg="{{lookup('dnstxt', ['test.example.com'])}}"
ansible.builtin.debug:
msg: "{{lookup('community.general.dnstxt', ['test.example.com'])}}"
- name: iterate over txt entries
ansible.builtin.debug: msg="{{item}}"
with_dnstxt:
ansible.builtin.debug:
msg: "{{item}}"
with_community.general.dnstxt:
- 'test.example.com'
- 'other.example.com'
- 'last.example.com'
- name: iterate of a comma delimited DNS TXT entry
ansible.builtin.debug: msg="{{item}}"
with_dnstxt: "{{lookup('dnstxt', ['test.example.com']).split(',')}}"
ansible.builtin.debug:
msg: "{{item}}"
with_community.general.dnstxt: "{{lookup('community.general.dnstxt', ['test.example.com']).split(',')}}"
"""
RETURN = """

View File

@@ -7,7 +7,7 @@ __metaclass__ = type
DOCUMENTATION = r"""
lookup: dsv
author: Adam Migus (adam@migus.org)
author: Adam Migus (@amigus) <adam@migus.org>
short_description: Get secrets from Thycotic DevOps Secrets Vault
version_added: 1.0.0
description:
@@ -112,7 +112,7 @@ class LookupModule(LookupBase):
self.set_options(var_options=variables, direct=kwargs)
vault = LookupModule.Client(
**{
{
"tenant": self.get_option("tenant"),
"client_id": self.get_option("client_id"),
"client_secret": self.get_option("client_secret"),

View File

@@ -53,14 +53,17 @@ DOCUMENTATION = '''
'''
EXAMPLES = '''
- name: "a value from a locally running etcd"
ansible.builtin.debug: msg={{ lookup('etcd', 'foo/bar') }}
- name: "a value from a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd', 'foo/bar') }}"
- name: "values from multiple folders on a locally running etcd"
ansible.builtin.debug: msg={{ lookup('etcd', 'foo', 'bar', 'baz') }}
- name: "values from multiple folders on a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd', 'foo', 'bar', 'baz') }}"
- name: "since Ansible 2.5 you can set server options inline"
ansible.builtin.debug: msg="{{ lookup('etcd', 'foo', version='v2', url='http://192.168.0.27:4001') }}"
- name: "since Ansible 2.5 you can set server options inline"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd', 'foo', version='v2', url='http://192.168.0.27:4001') }}"
'''
RETURN = '''

View File

@@ -31,7 +31,7 @@ DOCUMENTATION = '''
default: False
endpoints:
description:
- Counterpart of C(ETCDCTL_ENDPOINTS) enviroment variable.
- Counterpart of C(ETCDCTL_ENDPOINTS) environment variable.
Specify the etcd3 connection with and URL form eg. C(https://hostname:2379) or C(<host>:<port>) form.
- The C(host) part is overwritten by I(host) option, if defined.
- The C(port) part is overwritten by I(port) option, if defined.
@@ -76,20 +76,20 @@ DOCUMENTATION = '''
type: int
user:
description:
- Authentified user name.
- Authenticated user name.
env:
- name: ETCDCTL_USER
type: str
password:
description:
- Authentified user password.
- Authenticated user password.
env:
- name: ETCDCTL_PASSWORD
type: str
notes:
- I(host) and I(port) options take precedence over (endpoints) option.
- The recommanded way to connect to etcd3 server is using C(ETCDCTL_ENDPOINT)
- The recommended way to connect to etcd3 server is using C(ETCDCTL_ENDPOINT)
environment variable and keep I(endpoints), I(host), and I(port) unused.
seealso:
- module: community.general.etcd3
@@ -100,21 +100,21 @@ DOCUMENTATION = '''
'''
EXAMPLES = '''
- name: "a value from a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', 'foo/bar') }}"
- name: "a value from a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', 'foo/bar') }}"
- name: "values from multiple folders on a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', 'foo', 'bar', 'baz') }}"
- name: "values from multiple folders on a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', 'foo', 'bar', 'baz') }}"
- name: "look for a key prefix"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', '/foo/bar', prefix=True) }}"
- name: "look for a key prefix"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', '/foo/bar', prefix=True) }}"
- name: "connect to etcd3 with a client certificate"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', 'foo/bar', cert_cert='/etc/ssl/etcd/client.pem', cert_key='/etc/ssl/etcd/client.key') }}"
- name: "connect to etcd3 with a client certificate"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', 'foo/bar', cert_cert='/etc/ssl/etcd/client.pem', cert_key='/etc/ssl/etcd/client.key') }}"
'''
RETURN = '''

View File

@@ -4,7 +4,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
DOCUMENTATION = r'''
lookup: filetree
author: Dag Wieers (@dagwieers) <dag@wieers.com>
short_description: recursively match all files in a directory tree
@@ -19,13 +19,13 @@ options:
required: True
'''
EXAMPLES = """
EXAMPLES = r"""
- name: Create directories
ansible.builtin.file:
path: /web/{{ item.path }}
state: directory
mode: '{{ item.mode }}'
with_filetree: web/
with_community.general.filetree: web/
when: item.state == 'directory'
- name: Template files (explicitly skip directories in order to use the 'src' attribute)
@@ -33,7 +33,7 @@ EXAMPLES = """
src: '{{ item.src }}'
dest: /web/{{ item.path }}
mode: '{{ item.mode }}'
with_filetree: web/
with_community.general.filetree: web/
when: item.state == 'file'
- name: Recreate symlinks
@@ -43,48 +43,52 @@ EXAMPLES = """
state: link
force: yes
mode: '{{ item.mode }}'
with_filetree: web/
with_community.general.filetree: web/
when: item.state == 'link'
- name: list all files under web/
ansible.builtin.debug:
msg: "{{ lookup('community.general.filetree', 'web/') }}"
"""
RETURN = """
RETURN = r"""
_raw:
description: list of dictionaries with file information
contains:
src:
description:
- full path to file
- not returned when C(item.state) is set to C(directory)
- full path to file.
- not returned when C(item.state) is set to C(directory).
root:
description: allows filtering by original location
description: allows filtering by original location.
path:
description: contains the relative path to root
description: contains the relative path to root.
mode:
description: TODO
description: The permissions the resulting file or directory.
state:
description: TODO
owner:
description: TODO
description: Name of the user that owns the file/directory.
group:
description: TODO
description: Name of the group that owns the file/directory.
seuser:
description: TODO
description: The user part of the SELinux file context.
serole:
description: TODO
description: The role part of the SELinux file context.
setype:
description: TODO
description: The type part of the SELinux file context.
selevel:
description: TODO
description: The level part of the SELinux file context.
uid:
description: TODO
description: Owner ID of the file/directory.
gid:
description: TODO
description: Group ID of the file/directory.
size:
description: TODO
description: Size of the target.
mtime:
description: TODO
description: Time of last modification.
ctime:
description: TODO
description: Time of last metadata update or creation (depends on OS).
"""
import os
import pwd

View File

@@ -21,7 +21,8 @@ DOCUMENTATION = '''
EXAMPLES = """
- name: "'unnest' all elements into single list"
ansible.builtin.debug: msg="all in one list {{lookup('flattened', [1,2,3,[5,6]], [a,b,c], [[5,6,1,3], [34,a,b,c]])}}"
ansible.builtin.debug:
msg: "all in one list {{lookup('community.general.flattened', [1,2,3,[5,6]], [a,b,c], [[5,6,1,3], [34,a,b,c]])}}"
"""
RETURN = """

View File

@@ -29,9 +29,11 @@ extends_documentation_fragment:
'''
EXAMPLES = '''
- ansible.builtin.debug: msg="the value of foo.txt is {{ lookup('gcp_storage_file',
bucket='gcp-bucket', src='mydir/foo.txt', project='project-name',
auth_kind='serviceaccount', service_account_file='/tmp/myserviceaccountfile.json') }}"
- ansible.builtin.debug:
msg: |
the value of foo.txt is {{ lookup('community.general.gcp_storage_file',
bucket='gcp-bucket', src='mydir/foo.txt', project='project-name',
auth_kind='serviceaccount', service_account_file='/tmp/myserviceaccountfile.json') }}
'''
RETURN = '''
@@ -141,5 +143,5 @@ class GcpFileLookup():
class LookupModule(LookupBase):
def run(self, terms, variables=None, **kwargs):
if not HAS_GOOGLE_CLOUD_COLLECTION:
raise AnsibleError("community.general.gcp_storage_files needs a supported version of the google.cloud collection installed")
raise AnsibleError("community.general.gcp_storage_file needs a supported version of the google.cloud collection installed")
return GcpFileLookup().run(terms, variables=variables, **kwargs)

View File

@@ -39,13 +39,16 @@ EXAMPLES = """
# All this examples depends on hiera.yml that describes the hierarchy
- name: "a value from Hiera 'DB'"
ansible.builtin.debug: msg={{ lookup('hiera', 'foo') }}
ansible.builtin.debug:
msg: "{{ lookup('community.general.hiera', 'foo') }}"
- name: "a value from a Hiera 'DB' on other environment"
ansible.builtin.debug: msg={{ lookup('hiera', 'foo environment=production') }}
ansible.builtin.debug:
msg: "{{ lookup('community.general.hiera', 'foo environment=production') }}"
- name: "a value from a Hiera 'DB' for a concrete node"
ansible.builtin.debug: msg={{ lookup('hiera', 'foo fqdn=puppet01.localdomain') }}
ansible.builtin.debug:
msg: "{{ lookup('community.general.hiera', 'foo fqdn=puppet01.localdomain') }}"
"""
RETURN = """

View File

@@ -20,11 +20,11 @@ EXAMPLES = """
- name : output secrets to screen (BAD IDEA)
ansible.builtin.debug:
msg: "Password: {{item}}"
with_keyring:
with_community.general.keyring:
- 'servicename username'
- name: access mysql with password from keyring
mysql_db: login_password={{lookup('keyring','mysql joe')}} login_user=joe
mysql_db: login_password={{lookup('community.general.keyring','mysql joe')}} login_user=joe
"""
RETURN = """

View File

@@ -26,7 +26,7 @@ DOCUMENTATION = '''
EXAMPLES = """
- name: get 'custom_field' from lastpass entry 'entry-name'
ansible.builtin.debug:
msg: "{{ lookup('lastpass', 'entry-name', field='custom_field') }}"
msg: "{{ lookup('community.general.lastpass', 'entry-name', field='custom_field') }}"
"""
RETURN = """

View File

@@ -25,14 +25,14 @@ DOCUMENTATION = '''
EXAMPLES = """
- name: query LMDB for a list of country codes
ansible.builtin.debug:
msg: "{{ query('lmdb_kv', 'nl', 'be', 'lu', db='jp.mdb') }}"
msg: "{{ query('community.general.lmdb_kv', 'nl', 'be', 'lu', db='jp.mdb') }}"
- name: use list of values in a loop by key wildcard
ansible.builtin.debug:
msg: "Hello from {{ item.0 }} a.k.a. {{ item.1 }}"
vars:
- lmdb_kv_db: jp.mdb
with_lmdb_kv:
with_community.general.lmdb_kv:
- "n*"
- name: get an item by key
@@ -41,7 +41,7 @@ EXAMPLES = """
- item == 'Belgium'
vars:
- lmdb_kv_db: jp.mdb
with_lmdb_kv:
with_community.general.lmdb_kv:
- be
"""

View File

@@ -40,11 +40,14 @@ DOCUMENTATION = '''
EXAMPLES = '''
- name: all available resources
ansible.builtin.debug: msg="{{ lookup('manifold', api_token='SecretToken') }}"
ansible.builtin.debug:
msg: "{{ lookup('community.general.manifold', api_token='SecretToken') }}"
- name: all available resources for a specific project in specific team
ansible.builtin.debug: msg="{{ lookup('manifold', api_token='SecretToken', project='poject-1', team='team-2') }}"
ansible.builtin.debug:
msg: "{{ lookup('community.general.manifold', api_token='SecretToken', project='poject-1', team='team-2') }}"
- name: two specific resources
ansible.builtin.debug: msg="{{ lookup('manifold', 'resource-1', 'resource-2') }}"
ansible.builtin.debug:
msg: "{{ lookup('community.general.manifold', 'resource-1', 'resource-2') }}"
'''
RETURN = '''

View File

@@ -48,11 +48,13 @@ options:
EXAMPLES = """
- name: fetch all networkview objects
ansible.builtin.set_fact:
networkviews: "{{ lookup('nios', 'networkview', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
networkviews: "{{ lookup('community.general.nios', 'networkview',
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: fetch the default dns view
ansible.builtin.set_fact:
dns_views: "{{ lookup('nios', 'view', filter={'name': 'default'}, provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
dns_views: "{{ lookup('community.general.nios', 'view', filter={'name': 'default'},
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
# all of the examples below use credentials that are set using env variables
# export INFOBLOX_HOST=nios01
@@ -61,20 +63,20 @@ EXAMPLES = """
- name: fetch all host records and include extended attributes
ansible.builtin.set_fact:
host_records: "{{ lookup('nios', 'record:host', return_fields=['extattrs', 'name', 'view', 'comment']}) }}"
host_records: "{{ lookup('community.general.nios', 'record:host', return_fields=['extattrs', 'name', 'view', 'comment']}) }}"
- name: use env variables to pass credentials
ansible.builtin.set_fact:
networkviews: "{{ lookup('nios', 'networkview') }}"
networkviews: "{{ lookup('community.general.nios', 'networkview') }}"
- name: get a host record
ansible.builtin.set_fact:
host: "{{ lookup('nios', 'record:host', filter={'name': 'hostname.ansible.com'}) }}"
host: "{{ lookup('community.general.nios', 'record:host', filter={'name': 'hostname.ansible.com'}) }}"
- name: get the authoritative zone from a non default dns view
ansible.builtin.set_fact:
host: "{{ lookup('nios', 'zone_auth', filter={'fqdn': 'ansible.com', 'view': 'ansible-dns'}) }}"
host: "{{ lookup('community.general.nios', 'zone_auth', filter={'fqdn': 'ansible.com', 'view': 'ansible-dns'}) }}"
"""
RETURN = """

View File

@@ -48,15 +48,15 @@ options:
EXAMPLES = """
- name: return next available IP address for network 192.168.10.0/24
ansible.builtin.set_fact:
ipaddr: "{{ lookup('nios_next_ip', '192.168.10.0/24', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
ipaddr: "{{ lookup('community.general.nios_next_ip', '192.168.10.0/24', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the next 3 available IP addresses for network 192.168.10.0/24
ansible.builtin.set_fact:
ipaddr: "{{ lookup('nios_next_ip', '192.168.10.0/24', num=3, provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
ipaddr: "{{ lookup('community.general.nios_next_ip', '192.168.10.0/24', num=3, provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the next 3 available IP addresses for network 192.168.10.0/24 excluding ip addresses - ['192.168.10.1', '192.168.10.2']
ansible.builtin.set_fact:
ipaddr: "{{ lookup('nios_next_ip', '192.168.10.0/24', num=3, exclude=['192.168.10.1', '192.168.10.2'],
ipaddr: "{{ lookup('community.general.nios_next_ip', '192.168.10.0/24', num=3, exclude=['192.168.10.1', '192.168.10.2'],
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
"""

View File

@@ -56,16 +56,17 @@ options:
EXAMPLES = """
- name: return next available network for network-container 192.168.10.0/24
ansible.builtin.set_fact:
networkaddr: "{{ lookup('nios_next_network', '192.168.10.0/24', cidr=25, provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
networkaddr: "{{ lookup('community.general.nios_next_network', '192.168.10.0/24', cidr=25,
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the next 2 available network addresses for network-container 192.168.10.0/24
ansible.builtin.set_fact:
networkaddr: "{{ lookup('nios_next_network', '192.168.10.0/24', cidr=25, num=2,
networkaddr: "{{ lookup('community.general.nios_next_network', '192.168.10.0/24', cidr=25, num=2,
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the available network addresses for network-container 192.168.10.0/24 excluding network range '192.168.10.0/25'
ansible.builtin.set_fact:
networkaddr: "{{ lookup('nios_next_network', '192.168.10.0/24', cidr=25, exclude=['192.168.10.0/25'],
networkaddr: "{{ lookup('community.general.nios_next_network', '192.168.10.0/24', cidr=25, exclude=['192.168.10.0/25'],
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
"""

View File

@@ -56,26 +56,26 @@ EXAMPLES = """
# These examples only work when already signed in to 1Password
- name: Retrieve password for KITT when already signed in to 1Password
ansible.builtin.debug:
var: lookup('onepassword', 'KITT')
var: lookup('community.general.onepassword', 'KITT')
- name: Retrieve password for Wintermute when already signed in to 1Password
ansible.builtin.debug:
var: lookup('onepassword', 'Tessier-Ashpool', section='Wintermute')
var: lookup('community.general.onepassword', 'Tessier-Ashpool', section='Wintermute')
- name: Retrieve username for HAL when already signed in to 1Password
ansible.builtin.debug:
var: lookup('onepassword', 'HAL 9000', field='username', vault='Discovery')
var: lookup('community.general.onepassword', 'HAL 9000', field='username', vault='Discovery')
- name: Retrieve password for HAL when not signed in to 1Password
ansible.builtin.debug:
var: lookup('onepassword'
var: lookup('community.general.onepassword'
'HAL 9000'
subdomain='Discovery'
master_password=vault_master_password)
- name: Retrieve password for HAL when never signed in to 1Password
ansible.builtin.debug:
var: lookup('onepassword'
var: lookup('community.general.onepassword'
'HAL 9000'
subdomain='Discovery'
master_password=vault_master_password

View File

@@ -52,11 +52,11 @@ DOCUMENTATION = '''
EXAMPLES = """
- name: Retrieve all data about Wintermute
ansible.builtin.debug:
var: lookup('onepassword_raw', 'Wintermute')
var: lookup('community.general.onepassword_raw', 'Wintermute')
- name: Retrieve all data about Wintermute when not signed in to 1Password
ansible.builtin.debug:
var: lookup('onepassword_raw', 'Wintermute', subdomain='Turing', vault_password='DmbslfLvasjdl')
var: lookup('community.general.onepassword_raw', 'Wintermute', subdomain='Turing', vault_password='DmbslfLvasjdl')
"""
RETURN = """

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