Compare commits

..

35 Commits
3.0.0 ... 3.0.2

Author SHA1 Message Date
Felix Fontein
80fbcf2f98 Release 3.0.2. 2021-05-11 07:08:11 +02:00
patchback[bot]
a722e038cc Avoid incorrectly marking zfs tasks as changed (#2454) (#2484)
* Avoid incorrectly marking zfs tasks as changed

The zfs module will incorrectly mark certain tasks as having been
changed. For example, if a dataset has a quota of "1G" and the user
changes it to "1024M", the actual quota vale has not changed, but since
the module is doing a simple string comparison between "1G" and "1024M",
it marks the step as "changed".

Instead of trying to handle all the corner cases of zfs (another example
is when the zpool "altroot" property has been set), this change simply
compares the output of "zfs-get" from before and after "zfs-set" is
called

* update changelog format

* Update changelogs/fragments/2454-detect_zfs_changed.yml

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

* add note about check_mode

* Update plugins/modules/storage/zfs/zfs.py

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

* Update plugins/modules/storage/zfs/zfs.py

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

* clarify check mode qualifications

* rephrase to avoid hypothetical

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

Co-authored-by: sam-lunt <samuel.j.lunt@gmail.com>
2021-05-10 18:17:03 +02:00
Felix Fontein
19c8d2164d Prepare 3.0.2 release. 2021-05-10 18:00:08 +02:00
patchback[bot]
d4656ffca2 Clarify Windows (non-)support. (#2476) (#2482)
(cherry picked from commit 2e58dfe52a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-10 17:14:34 +02:00
patchback[bot]
b49607f12d fix stackpath_compute validate_config (#2448) (#2475)
* fix stackpath_compute validate_config

get the lenght for the client_id / client_secret to validate inventory configuration

* Add changelog fragment.

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

Co-authored-by: vbarba <victor.barba@gmail.com>
2021-05-09 22:46:17 +02:00
patchback[bot]
af0ce4284f Small Documentation Example Of Cask Leveraging (#2462) (#2470)
* Small Documentation Example Of Cask Leveraging

- Just a lil' demo showing that we can utilize homebrew/cask/foo syntax
for given name of package to grab associated cask pacakge

Resolves: patch/sml-doc-example-update

* Slight Documentation Example Edit

- adjusting documentation example to provide better info surrounding installing
a given formula from brew via cask

Resolves: patch/sml-doc-example-update

* Small Edits To Make PEP8 Happy

- format code with autopep8 in vs code

Resolves: patch/sml-doc-example-update

* Only Making Small PEP8 Change

- reverting previous mass PEP8 format, focus on trimming whitespace on
doc example entry

Resolves: patch/sml-doc-example-update

* Remove Trailing Whitespace PEP8

- removed trailing whitespace on doc example chunk

Resolves: patch/sml-doc-example-update
(cherry picked from commit 7386326258)

Co-authored-by: Mike Russell <michael.j.russell.email@gmail.com>
2021-05-08 12:18:28 +02:00
patchback[bot]
f5f862617a Add more plugin authors to BOTMETA. (#2451) (#2453)
(cherry picked from commit 188a4eeb0c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-05 07:52:09 +02:00
Felix Fontein
a1a4ba4337 Next expected release is 3.0.2 next week. 2021-05-04 13:21:05 +02:00
Felix Fontein
b0b783f8ff Release 3.0.1. 2021-05-04 12:45:19 +02:00
patchback[bot]
e670ca666a OpenNebula one_vm.py: Fix missing keys (#2435) (#2447)
* OpenNebula one_vm.py: Fix missing keys

* fixup OpenNebula one_vm.py: Fix missing keys

(cherry picked from commit aaa561163b)

Co-authored-by: Jan Orel <jorel@opennebula.io>
2021-05-04 12:43:25 +02:00
patchback[bot]
49b991527e Remove shippable config. (#2440) (#2444)
(cherry picked from commit 1f41e66f09)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-03 22:56:40 +02:00
patchback[bot]
e6cc671a0d lvol - bug fix - Convert units to lowercase when using LVS or VGS command (#2369) (#2439)
* Added lower call for units when checking lvs/vgs size

* Changelog

* Size roudning correction

* Rounding

* Changelog

* Remove whitespace

(cherry picked from commit 06bdabcad9)

Co-authored-by: zigaSRC <65527456+zigaSRC@users.noreply.github.com>
2021-05-03 22:07:52 +02:00
patchback[bot]
797ea23e50 Clean up test entries from sysrc tests (#2330) (#2438)
* Clean up test entries from sysrc tests

* sysrc: enable tests

* sysrc: cache the files to be changed and restore them

* Update the ezjail archive host and remove obsolete file

* sysrc: set ezjail to use archives for 12.0 or less

* sysrc: Detect the version to use ftp vs ftp-archive using http

* sysrc: Skip ezjail test on FreeBSD 12.0

(cherry picked from commit 7007c68ab7)

Co-authored-by: David Lundgren <dlundgren@syberisle.net>
2021-05-03 21:34:19 +02:00
patchback[bot]
4d23b7a48b linode_v4 - fixed error message (#2430) (#2433)
* fixed error message

* added changelog fragment

(cherry picked from commit 5064aa8ec6)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-05-03 13:51:38 +02:00
patchback[bot]
020b47a1a9 Make plugins pass validation. (#2414) (#2431)
(cherry picked from commit 6a72c3b338)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-03 13:51:10 +02:00
patchback[bot]
0da9d956a0 nmcli: Compare MAC addresses case insensitively (#2416) (#2425)
* nmcli: Compare MAC addresses case insensitively

* Update changelogs/fragments/2416-nmcli_compare_mac_addresses_case_insensitively.yml

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

* Update plugins/modules/net_tools/nmcli.py

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

* Add mac to TESTCASE_BRIDGE so test_bridge_connection_unchanged covers case sensitive mac address comparison

* Update plugins/modules/net_tools/nmcli.py

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

* Convert current_value to uppercase as well in case nmcli changes behaviour

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

Co-authored-by: spike77453 <spike77453@users.noreply.github.com>
2021-05-03 08:17:32 +02:00
patchback[bot]
5691e3aff3 nmcli: Add 'slave-type bridge' to nmcli command if type is bridge-slave (#2409) (#2423)
(cherry picked from commit b5f8ae4320)

Co-authored-by: spike77453 <spike77453@users.noreply.github.com>
2021-05-03 08:16:19 +02:00
patchback[bot]
007333dbfe 📝 Document nested node addition with "_" in xml module (#2371) (#2427)
* 📝 Document nested node addition with "_" in xml module

Nested node addition using "_" to indicate sub nodes, and attributes are only documented in tests and issues, where is hard to find.

* 🚨 Fix trailing space

* Apply suggestions from code review

Add missing collection prefix for modules.

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

* Add missing comments

* Update xml.py

* Fix linter warnings

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

Co-authored-by: Daniel-Sanchez-Fabregas <33929811+Daniel-Sanchez-Fabregas@users.noreply.github.com>
2021-05-03 08:12:31 +02:00
patchback[bot]
05666b0e4d puppet - replace stdout with console in logdest option (#2407) (#2421)
* Change stdout to console

* readd stdout, resulting in console

* add changelog

* readd stdout to docs and add a warning when it is used

* version of what???

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

* postpone deprecation in another PR

* remove console option, so it can be backported

* change changelog respectively

* Fix changelog formatting

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

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

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-05-03 07:59:33 +02:00
patchback[bot]
c934d9aeb5 Fix #2373 - TypeError: a bytes-like object is required, not 'str' (#2375) (#2419)
* Fix #2373

* Changelog fragment for #2373

* Update changelogs/fragments/2373-svr4pkg-fix-typeerror.yml

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update changelogs/fragments/2373-svr4pkg-fix-typeerror.yml

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

Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit cd957fae4c)

Co-authored-by: Daniel Werner <srmlsrml@gmail.com>
2021-05-03 07:56:05 +02:00
Felix Fontein
5b15e4089a Revert "spotinst_aws_elastigroup - fixed elements for many lists (#2355) (#2363)"
This reverts commit ea42b75378.

(Will be re-reverted after the 3.0.1 release.)
2021-05-03 07:48:12 +02:00
Felix Fontein
a6379e45ce Prepare 3.0.1 release. 2021-05-03 07:47:48 +02:00
Felix Fontein
b95176dbc8 Copy schedule to stable branches. 2021-05-02 13:35:45 +02:00
patchback[bot]
b752fea121 BOTMETA.yml: terraform - add a new maintainer (#2290) (#2413)
(cherry picked from commit c0221b75af)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-05-02 13:27:43 +02:00
patchback[bot]
cf50990fed Add ansible-test config file. (#2404) (#2406)
(cherry picked from commit 4e90ee752e)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-01 22:54:44 +02:00
patchback[bot]
45343e6bc0 composer: --no-interaction when discovering available options (#2348) (#2403)
The composer module always uses the no-interaction option if it
discovers it _after_ calling "composer help ..." but not on the help
call itself. The lack of this option caused composer to not exit when
called through the ansible module.

The same example command when ran interactively does not prompt for user
interaction and exits immediately. It is therefore currently unknown why
the same command hangs when called through the ansible composer module
or even directly with the command module.

Example command which hangs:
php /usr/local/bin/composer help install --format=json

(cherry picked from commit eb455c69a2)

Co-authored-by: George Angelopoulos <george@usermod.net>
2021-05-01 18:46:16 +02:00
patchback[bot]
51540f6345 influxdb_retention_policy: fix duration parsing to support INF values (#2396) (#2401)
* influxdb_retention_policy: fix duration parsing to support INF values

* add changelog

(cherry picked from commit 26c3bd25f6)

Co-authored-by: Xabier Napal <xabiernapal@pm.me>
2021-05-01 14:37:19 +02:00
patchback[bot]
74eba52028 Remove resmo as composer maintainer. (#2392) (#2395)
(cherry picked from commit 276880aac1)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-01 14:11:16 +02:00
patchback[bot]
b920e8abf2 Add Fedora 34 to CI (#2384) (#2391)
* Add fedora 34 and fix typo

* Remove Fedora 32 from devel testing

* Use one newer version of Fedora for fixed ansible versions

* Revert "Use one newer version of Fedora for fixed ansible versions"

This reverts commit cbd006bd38.

* Try to skip task.

* Revert "Try to skip task."

This reverts commit ff0c899a86.

* Temporary disable Fedora 34 on setup_postgresql_db

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

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-05-01 14:10:07 +02:00
patchback[bot]
75c0004e1e Use Ansible's codecov uploader. (#2377) (#2380)
(cherry picked from commit b3f436aa63)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-30 05:32:23 +02:00
patchback[bot]
be42fd4af7 No longer required for devel's ansible-test. (#2365) (#2367)
ci_complete

(cherry picked from commit 77d4bc2942)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-27 22:44:21 +02:00
patchback[bot]
1c05908ff6 BOTMETA.yml: team_suse - add a maintainer (#2354) (#2362)
(cherry picked from commit 9d13acd68e)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-27 13:46:28 +02:00
patchback[bot]
ea42b75378 spotinst_aws_elastigroup - fixed elements for many lists (#2355) (#2363)
* fixed elements for many lists

* added changelog fragment

* Removed verbose types in description - still missing formatting and properly documenting dicts

(cherry picked from commit 48ef05def3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-04-27 11:46:17 +00:00
patchback[bot]
0330f4b52c Make inventory scripts executable (#2337) (#2359)
* Make inventory scripts executable

* Mark inventory scripts in vault folder as executable

* Add changelog entry for making inventory scripts exectuable

* Update changelogs/fragments/2337-mark-inventory-scripts-executable.yml

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

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

Co-authored-by: Alan Rominger <arominge@redhat.com>
2021-04-26 22:24:42 +02:00
Felix Fontein
1d8c659ba2 Next expected release is 3.0.0. 2021-04-26 21:19:55 +02:00
75 changed files with 241 additions and 100 deletions

View File

@@ -14,12 +14,24 @@ pr:
schedules:
- cron: 0 8 * * *
displayName: Nightly
displayName: Nightly (main)
always: true
branches:
include:
- main
- stable-*
- cron: 0 10 * * *
displayName: Nightly (active stable branches)
always: true
branches:
include:
- stable-2
- stable-3
- cron: 0 11 * * 0
displayName: Weekly (old stable branches)
always: true
branches:
include:
- stable-1
variables:
- name: checkoutPath
@@ -256,10 +268,10 @@ stages:
test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 32
test: fedora32
- name: Fedora 33
test: fedora33
- name: Fedora 34
test: fedora34
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
@@ -282,7 +294,7 @@ stages:
targets:
- name: CentOS 8
test: centos8
- name: Fedora 32
- name: Fedora 33
test: fedora33
- name: openSUSE 15 py3
test: opensuse15

View File

@@ -7,7 +7,7 @@ set -o pipefail -eu
output_path="$1"
curl --silent --show-error https://codecov.io/bash > codecov.sh
curl --silent --show-error https://ansible-ci-files.s3.us-east-1.amazonaws.com/codecov/codecov.sh > codecov.sh
for file in "${output_path}"/reports/coverage*.xml; do
name="${file}"

14
.github/BOTMETA.yml vendored
View File

@@ -88,6 +88,8 @@ files:
maintainers: $team_linode
labels: cloud linode
keywords: linode dynamic inventory script
$inventories/lxd.py:
maintainers: conloos
$inventories/proxmox.py:
maintainers: $team_virt ilijamt
$inventories/scaleway.py:
@@ -225,7 +227,7 @@ files:
$modules/cloud/misc/:
ignore: ryansb
$modules/cloud/misc/terraform.py:
maintainers: m-yosefpor
maintainers: m-yosefpor rainerleber
$modules/cloud/misc/xenserver_facts.py:
maintainers: caphrim007 cheese
labels: xenserver_facts
@@ -373,6 +375,8 @@ files:
maintainers: $team_keycloak
$modules/identity/keycloak/keycloak_group.py:
maintainers: adamgoossens
$modules/identity/keycloak/keycloak_realm.py:
maintainers: kris2kris
$modules/identity/onepassword_info.py:
maintainers: Rylon
$modules/identity/opendj/opendj_backendprop.py:
@@ -560,7 +564,8 @@ files:
$modules/packaging/language/bundler.py:
maintainers: thoiberg
$modules/packaging/language/composer.py:
maintainers: dmtrs resmo
maintainers: dmtrs
ignore: resmo
$modules/packaging/language/cpanm.py:
maintainers: fcuny russoz
$modules/packaging/language/easy_install.py:
@@ -707,7 +712,8 @@ files:
labels: zypper
ignore: dirtyharrycallahan robinro
$modules/packaging/os/zypper_repository.py:
maintainers: matze
maintainers: $team_suse matze
labels: zypper
$modules/remote_management/cobbler/:
maintainers: dagwieers
$modules/remote_management/hpilo/:
@@ -1025,5 +1031,5 @@ macros:
team_rhn: FlossWare alikins barnabycourt vritant
team_scaleway: QuentinBrosse abarbare jerome-quere kindermoumoute remyleone sieben
team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l
team_suse: commel dcermak evrardjp lrupp toabctl AnderEnder alxgu andytom
team_suse: commel dcermak evrardjp lrupp toabctl AnderEnder alxgu andytom sealor
team_virt: joshainglis karmab tleguern Thulium-Drake Ajpantuso

View File

@@ -6,6 +6,43 @@ Community General Release Notes
This changelog describes changes after version 2.0.0.
v3.0.2
======
Release Summary
---------------
Bugfix release for the first Ansible 4.0.0 release candidate.
Bugfixes
--------
- stackpath_compute inventory script - fix broken validation checks for client ID and client secret (https://github.com/ansible-collections/community.general/pull/2448).
- zfs - certain ZFS properties, especially sizes, would lead to a task being falsely marked as "changed" even when no actual change was made (https://github.com/ansible-collections/community.general/issues/975, https://github.com/ansible-collections/community.general/pull/2454).
v3.0.1
======
Release Summary
---------------
Bugfix release for the next Ansible 4.0.0 beta.
Bugfixes
--------
- composer - use ``no-interaction`` option when discovering available options to avoid an issue where composer hangs (https://github.com/ansible-collections/community.general/pull/2348).
- influxdb_retention_policy - fix bug where ``INF`` duration values failed parsing (https://github.com/ansible-collections/community.general/pull/2385).
- inventory and vault scripts - change file permissions to make vendored inventory and vault scripts exectuable (https://github.com/ansible-collections/community.general/pull/2337).
- linode_v4 - changed the error message to point to the correct bugtracker URL (https://github.com/ansible-collections/community.general/pull/2430).
- lvol - fixed rounding errors (https://github.com/ansible-collections/community.general/issues/2370).
- lvol - fixed size unit capitalization to match units used between different tools for comparison (https://github.com/ansible-collections/community.general/issues/2360).
- nmcli - compare MAC addresses case insensitively to fix idempotency issue (https://github.com/ansible-collections/community.general/issues/2409).
- nmcli - if type is ``bridge-slave`` add ``slave-type bridge`` to ``nmcli`` command (https://github.com/ansible-collections/community.general/issues/2408).
- one_vm - Allow missing NIC keys (https://github.com/ansible-collections/community.general/pull/2435).
- puppet - replace ``console` with ``stdout`` in ``logdest`` option when ``all`` has been chosen (https://github.com/ansible-collections/community.general/issues/1190).
- svr4pkg - convert string to a bytes-like object to avoid ``TypeError`` with Python 3 (https://github.com/ansible-collections/community.general/issues/2373).
v3.0.0
======

View File

@@ -7,6 +7,8 @@ This repo contains the `community.general` Ansible Collection. The collection in
You can find [documentation for this collection on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
Please note that this collection does **not** support Windows targets. Only connection plugins included in this collection might support Windows targets, and will explicitly mention that in their documentation if they do so.
## Tested with Ansible
Tested with the current Ansible 2.9, ansible-base 2.10 and ansible-core 2.11 releases and the current development version of ansible-core. Ansible versions before 2.9.10 are not supported.

View File

@@ -973,3 +973,54 @@ releases:
name: lxd
namespace: null
release_date: '2021-04-26'
3.0.1:
changes:
bugfixes:
- composer - use ``no-interaction`` option when discovering available options
to avoid an issue where composer hangs (https://github.com/ansible-collections/community.general/pull/2348).
- influxdb_retention_policy - fix bug where ``INF`` duration values failed parsing
(https://github.com/ansible-collections/community.general/pull/2385).
- inventory and vault scripts - change file permissions to make vendored inventory
and vault scripts exectuable (https://github.com/ansible-collections/community.general/pull/2337).
- linode_v4 - changed the error message to point to the correct bugtracker URL
(https://github.com/ansible-collections/community.general/pull/2430).
- lvol - fixed rounding errors (https://github.com/ansible-collections/community.general/issues/2370).
- lvol - fixed size unit capitalization to match units used between different
tools for comparison (https://github.com/ansible-collections/community.general/issues/2360).
- nmcli - compare MAC addresses case insensitively to fix idempotency issue
(https://github.com/ansible-collections/community.general/issues/2409).
- nmcli - if type is ``bridge-slave`` add ``slave-type bridge`` to ``nmcli``
command (https://github.com/ansible-collections/community.general/issues/2408).
- one_vm - Allow missing NIC keys (https://github.com/ansible-collections/community.general/pull/2435).
- puppet - replace ``console` with ``stdout`` in ``logdest`` option when ``all``
has been chosen (https://github.com/ansible-collections/community.general/issues/1190).
- svr4pkg - convert string to a bytes-like object to avoid ``TypeError`` with
Python 3 (https://github.com/ansible-collections/community.general/issues/2373).
release_summary: Bugfix release for the next Ansible 4.0.0 beta.
fragments:
- 2284-influxdb_retention_policy-fix_duration_parsing.yml
- 2337-mark-inventory-scripts-executable.yml
- 2348-composer-no-interaction-option-discovery-to-avoid-hang.yaml
- 2369-lvol_size_bug_fixes.yml
- 2373-svr4pkg-fix-typeerror.yml
- 2407-puppet-change_stdout_to_console.yaml
- 2409-nmcli_add_slave-type_bridge_to_nmcli_command_if_type_is_bridge-slave.yml
- 2416-nmcli_compare_mac_addresses_case_insensitively.yml
- 2430-linodev4-error-message.yml
- 2435-one_vm-fix_missing_keys.yml
- 3.0.1.yml
release_date: '2021-05-04'
3.0.2:
changes:
bugfixes:
- stackpath_compute inventory script - fix broken validation checks for client
ID and client secret (https://github.com/ansible-collections/community.general/pull/2448).
- zfs - certain ZFS properties, especially sizes, would lead to a task being
falsely marked as "changed" even when no actual change was made (https://github.com/ansible-collections/community.general/issues/975,
https://github.com/ansible-collections/community.general/pull/2454).
release_summary: Bugfix release for the first Ansible 4.0.0 release candidate.
fragments:
- 2448-stackpath_compute-fix.yml
- 2454-detect_zfs_changed.yml
- 3.0.2.yml
release_date: '2021-05-11'

View File

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

View File

@@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
become: sudosu
name: sudosu
short_description: Run tasks using sudo su -
description:
- This become plugins allows your remote/login user to execute commands as another user via the C(sudo) and C(su) utilities combined.

View File

@@ -4,7 +4,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: loganalytics
name: loganalytics
type: aggregate
short_description: Posts task results to Azure Log Analytics
author: "Cyrus Li (@zhcli) <cyrus1006@gmail.com>"

View File

@@ -6,7 +6,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
name: community.general.lxd
name: lxd
short_description: Returns Ansible inventory from lxd host
description:
- Get inventory from the lxd.
@@ -68,7 +68,7 @@ DOCUMENTATION = r'''
description:
- Create groups by the following keywords C(location), C(pattern), C(network_range), C(os), C(release), C(profile), C(vlanid).
- See example for syntax.
type: json
type: dict
'''
EXAMPLES = '''

View File

@@ -102,13 +102,13 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
raise AnsibleError("plugin doesn't match this plugin")
try:
client_id = config['client_id']
if client_id != 32:
if len(client_id) != 32:
raise AnsibleError("client_id must be 32 characters long")
except KeyError:
raise AnsibleError("config missing client_id, a required option")
try:
client_secret = config['client_secret']
if client_secret != 64:
if len(client_secret) != 64:
raise AnsibleError("client_secret must be 64 characters long")
except KeyError:
raise AnsibleError("config missing client_id, a required option")

View File

@@ -208,9 +208,8 @@ def create_linode(module, client, **kwargs):
else:
return response._raw_json
except TypeError:
module.fail_json(msg='Unable to parse Linode instance creation'
' response. Please raise a bug against this'
' module on https://github.com/ansible/ansible/issues'
module.fail_json(msg='Unable to parse Linode instance creation response. Please raise a bug against this'
' module on https://github.com/ansible-collections/community.general/issues'
)

View File

@@ -752,11 +752,20 @@ def get_vm_info(client, vm):
if 'NIC' in vm.TEMPLATE:
if isinstance(vm.TEMPLATE['NIC'], list):
for nic in vm.TEMPLATE['NIC']:
networks_info.append({'ip': nic['IP'], 'mac': nic['MAC'], 'name': nic['NETWORK'], 'security_groups': nic['SECURITY_GROUPS']})
networks_info.append({
'ip': nic.get('IP', ''),
'mac': nic.get('MAC', ''),
'name': nic.get('NETWORK', ''),
'security_groups': nic.get('SECURITY_GROUPS', '')
})
else:
networks_info.append(
{'ip': vm.TEMPLATE['NIC']['IP'], 'mac': vm.TEMPLATE['NIC']['MAC'],
'name': vm.TEMPLATE['NIC']['NETWORK'], 'security_groups': vm.TEMPLATE['NIC']['SECURITY_GROUPS']})
networks_info.append({
'ip': vm.TEMPLATE['NIC'].get('IP', ''),
'mac': vm.TEMPLATE['NIC'].get('MAC', ''),
'name': vm.TEMPLATE['NIC'].get('NETWORK', ''),
'security_groups':
vm.TEMPLATE['NIC'].get('SECURITY_GROUPS', '')
})
import time
current_time = time.localtime()

View File

@@ -129,7 +129,7 @@ from ansible_collections.community.general.plugins.module_utils.influxdb import
from ansible.module_utils._text import to_native
VALID_DURATION_REGEX = re.compile(r'^(\d+(ns|u|µ|ms|s|m|h|d|w))+$')
VALID_DURATION_REGEX = re.compile(r'^(INF|(\d+(ns|u|µ|ms|s|m|h|d|w)))+$')
DURATION_REGEX = re.compile(r'(\d+)(ns|u|µ|ms|s|m|h|d|w)')
EXTENDED_DURATION_REGEX = re.compile(r'(?:(\d+)(ns|u|µ|ms|m|h|d|w)|(\d+(?:\.\d+)?)(s))')
@@ -217,7 +217,7 @@ def create_retention_policy(module, client):
influxdb_shard_group_duration_format = parse_duration_literal(shard_group_duration)
if influxdb_shard_group_duration_format < 3600000000000:
module.fail_json(msg="shard_group_duration value must be at least 1h")
module.fail_json(msg="shard_group_duration value must be finite and at least 1h")
if not module.check_mode:
try:
@@ -256,7 +256,7 @@ def alter_retention_policy(module, client, retention_policy):
influxdb_shard_group_duration_format = parse_duration_literal(shard_group_duration)
if influxdb_shard_group_duration_format < 3600000000000:
module.fail_json(msg="shard_group_duration value must be at least 1h")
module.fail_json(msg="shard_group_duration value must be finite and at least 1h")
if (retention_policy['duration'] != influxdb_duration_format or
retention_policy['shardGroupDuration'] != influxdb_shard_group_duration_format or

View File

@@ -285,6 +285,22 @@ EXAMPLES = r'''
z: http://z.test
attribute: z:my_namespaced_attribute
value: 'false'
- name: Adding building nodes with floor subnodes from a YAML variable
community.general.xml:
path: /foo/bar.xml
xpath: /business
add_children:
- building:
# Attributes
name: Scumm bar
location: Monkey island
# Subnodes
_:
- floor: Pirate hall
- floor: Grog storage
- construction_date: "1990" # Only strings are valid
- building: Grog factory
'''
RETURN = r'''

View File

@@ -780,6 +780,7 @@ class Nmcli(object):
})
elif self.type == 'bridge-slave':
options.update({
'connection.slave-type': 'bridge',
'bridge-port.path-cost': self.path_cost,
'bridge-port.hairpin-mode': self.hairpin,
'bridge-port.priority': self.slavepriority,
@@ -1041,7 +1042,6 @@ class Nmcli(object):
'con-name': 'connection.id',
'autoconnect': 'connection.autoconnect',
'ifname': 'connection.interface-name',
'mac': self.mac_setting,
'master': 'connection.master',
'slave-type': 'connection.slave-type',
'zone': 'connection.zone',
@@ -1065,6 +1065,11 @@ class Nmcli(object):
current_value = [re.sub(r'^{\s*ip\s*=\s*([^, ]+),\s*nh\s*=\s*([^} ]+),\s*mt\s*=\s*([^} ]+)\s*}', r'\1 \2 \3',
route) for route in current_value]
current_value = [re.sub(r'^{\s*ip\s*=\s*([^, ]+),\s*nh\s*=\s*([^} ]+)\s*}', r'\1 \2', route) for route in current_value]
if key == self.mac_setting:
# MAC addresses are case insensitive, nmcli always reports them in uppercase
value = value.upper()
# ensure current_value is also converted to uppercase in case nmcli changes behaviour
current_value = current_value.upper()
elif key in param_alias:
real_key = param_alias[key]
if real_key in conn_info:

View File

@@ -169,7 +169,7 @@ def has_changed(string):
def get_available_options(module, command='install'):
# get all available options from a composer command using composer help to json
rc, out, err = composer_command(module, "help %s --format=json" % command)
rc, out, err = composer_command(module, "help %s" % command, arguments="--no-interaction --format=json")
if rc != 0:
output = parse_out(err)
module.fail_json(msg=output)

View File

@@ -127,6 +127,11 @@ EXAMPLES = '''
state: present
install_options: with-baz,enable-debug
- name: Install formula foo with 'brew' from cask
community.general.homebrew:
name: homebrew/cask/foo
state: present
- name: Use ignored-pinned option while upgrading all
community.general.homebrew:
upgrade_all: yes

View File

@@ -121,7 +121,7 @@ def package_installed(module, name, category):
def create_admin_file():
(desc, filename) = tempfile.mkstemp(prefix='ansible_svr4pkg', text=True)
fullauto = '''
fullauto = b'''
mail=
instance=unique
partial=nocheck

View File

@@ -37,6 +37,12 @@ options:
- A dictionary of zfs properties to be set.
- See the zfs(8) man page for more information.
type: dict
notes:
- C(check_mode) is supported, but in certain situations it may report a task
as changed that will not be reported as changed when C(check_mode) is disabled.
For example, this might occur when the zpool C(altroot) option is set or when
a size is written using human-readable notation, such as C(1M) or C(1024K),
instead of as an unqualified byte count, such as C(1048576).
author:
- Johan Wiren (@johanwiren)
'''
@@ -184,9 +190,7 @@ class Zfs(object):
return
cmd = [self.zfs_cmd, 'set', prop + '=' + str(value), self.name]
(rc, out, err) = self.module.run_command(cmd)
if rc == 0:
self.changed = True
else:
if rc != 0:
self.module.fail_json(msg=err)
def set_properties_if_changed(self):
@@ -194,15 +198,25 @@ class Zfs(object):
for prop, value in self.properties.items():
if current_properties.get(prop, None) != value:
self.set_property(prop, value)
if self.module.check_mode:
return
updated_properties = self.get_current_properties()
for prop in self.properties:
value = updated_properties.get(prop, None)
if value is None:
self.module.fail_json(msg="zfsprop was not present after being successfully set: %s" % prop)
if current_properties.get(prop, None) != value:
self.changed = True
def get_current_properties(self):
cmd = [self.zfs_cmd, 'get', '-H']
cmd = [self.zfs_cmd, 'get', '-H', '-p', '-o', "property,value,source"]
if self.enhanced_sharing:
cmd += ['-e']
cmd += ['all', self.name]
rc, out, err = self.module.run_command(" ".join(cmd))
properties = dict()
for prop, value, source in [l.split('\t')[1:4] for l in out.splitlines()]:
for line in out.splitlines():
prop, value, source = line.split('\t')
# include source '-' so that creation-only properties are not removed
# to avoids errors when the dataset already exists and the property is not changed
# this scenario is most likely when the same playbook is run more than once

View File

@@ -389,7 +389,7 @@ def main():
# Get information on volume group requested
vgs_cmd = module.get_bin_path("vgs", required=True)
rc, current_vgs, err = module.run_command(
"%s --noheadings --nosuffix -o vg_name,size,free,vg_extent_size --units %s --separator ';' %s" % (vgs_cmd, unit, vg))
"%s --noheadings --nosuffix -o vg_name,size,free,vg_extent_size --units %s --separator ';' %s" % (vgs_cmd, unit.lower(), vg))
if rc != 0:
if state == 'absent':
@@ -403,7 +403,7 @@ def main():
# Get information on logical volume requested
lvs_cmd = module.get_bin_path("lvs", required=True)
rc, current_lvs, err = module.run_command(
"%s -a --noheadings --nosuffix -o lv_name,size,lv_attr --units %s --separator ';' %s" % (lvs_cmd, unit, vg))
"%s -a --noheadings --nosuffix -o lv_name,size,lv_attr --units %s --separator ';' %s" % (lvs_cmd, unit.lower(), vg))
if rc != 0:
if state == 'absent':
@@ -505,16 +505,13 @@ def main():
else: # size_whole == 'FREE':
size_requested = size_percent * this_vg['free'] / 100
# from LVEXTEND(8) - The resulting value is rounded upward.
# from LVREDUCE(8) - The resulting value for the substraction is rounded downward, for the absolute size it is rounded upward.
if size_operator == '+':
size_requested += this_lv['size']
size_requested += this_vg['ext_size'] - (size_requested % this_vg['ext_size'])
elif size_operator == '-':
size_requested = this_lv['size'] - size_requested
size_requested -= (size_requested % this_vg['ext_size'])
else:
size_requested += this_vg['ext_size'] - (size_requested % this_vg['ext_size'])
# According to latest documentation (LVM2-2.03.11) all tools round down
size_requested -= (size_requested % this_vg['ext_size'])
if this_lv['size'] < size_requested:
if (size_free > 0) and (size_free >= (size_requested - this_lv['size'])):

View File

@@ -54,7 +54,8 @@ options:
logdest:
description:
- Where the puppet logs should go, if puppet apply is being used.
- C(all) will go to both C(stdout) and C(syslog).
- C(all) will go to both C(console) and C(syslog).
- C(stdout) will be deprecated and replaced by C(console).
type: str
choices: [ all, stdout, syslog ]
default: stdout
@@ -127,7 +128,7 @@ EXAMPLES = r'''
community.general.puppet:
noop: yes
- name: Run a manifest with debug, log to both syslog and stdout, specify module path
- name: Run a manifest with debug, log to both syslog and console, specify module path
community.general.puppet:
modulepath: /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
logdest: all
@@ -269,7 +270,7 @@ def main():
if p['logdest'] == 'syslog':
cmd += "--logdest syslog "
if p['logdest'] == 'all':
cmd += " --logdest syslog --logdest stdout"
cmd += " --logdest syslog --logdest console"
if p['modulepath']:
cmd += "--modulepath='%s'" % p['modulepath']
if p['environment']:

0
scripts/inventory/abiquo.py Normal file → Executable file
View File

0
scripts/inventory/apache-libcloud.py Normal file → Executable file
View File

0
scripts/inventory/apstra_aos.py Normal file → Executable file
View File

0
scripts/inventory/azure_rm.py Normal file → Executable file
View File

0
scripts/inventory/brook.py Normal file → Executable file
View File

0
scripts/inventory/cloudforms.py Normal file → Executable file
View File

0
scripts/inventory/cobbler.py Normal file → Executable file
View File

0
scripts/inventory/collins.py Normal file → Executable file
View File

0
scripts/inventory/consul_io.py Normal file → Executable file
View File

0
scripts/inventory/docker.py Normal file → Executable file
View File

0
scripts/inventory/fleet.py Normal file → Executable file
View File

0
scripts/inventory/foreman.py Normal file → Executable file
View File

0
scripts/inventory/freeipa.py Normal file → Executable file
View File

0
scripts/inventory/infoblox.py Normal file → Executable file
View File

0
scripts/inventory/jail.py Normal file → Executable file
View File

0
scripts/inventory/landscape.py Normal file → Executable file
View File

0
scripts/inventory/linode.py Normal file → Executable file
View File

0
scripts/inventory/lxc_inventory.py Normal file → Executable file
View File

0
scripts/inventory/lxd.py Normal file → Executable file
View File

0
scripts/inventory/mdt_dynamic_inventory.py Normal file → Executable file
View File

0
scripts/inventory/nagios_livestatus.py Normal file → Executable file
View File

0
scripts/inventory/nagios_ndo.py Normal file → Executable file
View File

0
scripts/inventory/nsot.py Normal file → Executable file
View File

0
scripts/inventory/openshift.py Normal file → Executable file
View File

0
scripts/inventory/openvz.py Normal file → Executable file
View File

0
scripts/inventory/ovirt.py Normal file → Executable file
View File

0
scripts/inventory/ovirt4.py Normal file → Executable file
View File

0
scripts/inventory/packet_net.py Normal file → Executable file
View File

0
scripts/inventory/proxmox.py Normal file → Executable file
View File

0
scripts/inventory/rackhd.py Normal file → Executable file
View File

0
scripts/inventory/rax.py Normal file → Executable file
View File

0
scripts/inventory/rudder.py Normal file → Executable file
View File

0
scripts/inventory/scaleway.py Normal file → Executable file
View File

0
scripts/inventory/serf.py Normal file → Executable file
View File

0
scripts/inventory/softlayer.py Normal file → Executable file
View File

0
scripts/inventory/spacewalk.py Normal file → Executable file
View File

0
scripts/inventory/ssh_config.py Normal file → Executable file
View File

0
scripts/inventory/stacki.py Normal file → Executable file
View File

0
scripts/inventory/vagrant.py Normal file → Executable file
View File

0
scripts/inventory/vbox.py Normal file → Executable file
View File

0
scripts/inventory/zone.py Normal file → Executable file
View File

0
scripts/vault/azure_vault.py Normal file → Executable file
View File

0
scripts/vault/vault-keyring-client.py Normal file → Executable file
View File

0
scripts/vault/vault-keyring.py Normal file → Executable file
View File

View File

@@ -1,48 +0,0 @@
language: python
env:
matrix:
- T=none
matrix:
exclude:
- env: T=none
include:
- env: T=devel/sanity/1
- env: T=devel/sanity/2
- env: T=devel/sanity/3
- env: T=devel/sanity/4
- env: T=2.11/sanity/1
- env: T=2.11/sanity/2
- env: T=2.11/sanity/3
- env: T=2.11/sanity/4
- env: T=2.10/sanity/1
- env: T=2.10/sanity/2
- env: T=2.10/sanity/3
- env: T=2.10/sanity/4
- env: T=2.9/sanity/1
- env: T=2.9/sanity/2
- env: T=2.9/sanity/3
- env: T=2.9/sanity/4
branches:
except:
- "*-patch-*"
- "revert-*-*"
- "patchback/backports/*"
build:
ci:
- tests/utils/shippable/timing.sh tests/utils/shippable/shippable.sh $T
integrations:
notifications:
- integrationName: email
type: email
on_success: never
on_failure: never
on_start: never
on_pull_request: never

5
tests/config.yml Normal file
View File

@@ -0,0 +1,5 @@
---
# See template for more information:
# https://github.com/ansible/ansible/blob/devel/test/lib/ansible_test/config/config.yml
modules:
python_requires: default

View File

@@ -11,6 +11,10 @@
- meta: end_play
when: ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version == '8'
# Temporary disable Fedora 34
- meta: end_play
when: ansible_facts.distribution == 'Fedora' and ansible_facts.distribution_major_version == '34'
- name: python 2
set_fact:
python_suffix: ''

View File

@@ -3,4 +3,3 @@ needs/root
skip/docker
skip/osx
skip/rhel
disabled # FIXME

View File

@@ -6,7 +6,11 @@
block:
- name: Cache original contents of /etc/rc.conf
shell: "cat /etc/rc.conf"
register: sysrc_original_content
register: cached_etc_rcconf_content
- name: Cache original contents of /boot/loader.conf
shell: "cat /boot/loader.conf"
register: cached_boot_loaderconf_content
##
## sysrc - example - set mysqlpidfile
@@ -130,6 +134,11 @@
## sysrc - example - Enable nginx in testjail
##
- name: Test within jail
#
# NOTE: FreeBSD 12.0 test runner receives a "connection reset by peer" after ~20% downloaded so we are
# only running this on 12.1 or higher
#
when: ansible_distribution_version is version('12.01', '>=')
block:
- name: Setup testjail
include: setup-testjail.yml
@@ -316,3 +325,13 @@
- not sysrc_value_absent_idempotent.changed
- "'sysrc_delim=\"t1,t2\"' in sysrc_delim_content.stdout_lines"
- "'sysrc_delim_delete' not in sysrc_delim_content.stdout_lines"
always:
- name: Restore /etc/rc.conf
copy:
content: "{{ cached_etc_rcconf_content }}"
dest: /etc/rc.conf
- name: Restore /boot/loader.conf
copy:
content: "{{ cached_boot_loaderconf_content }}"
dest: /boot/loader.conf

View File

@@ -17,12 +17,19 @@
pkgng:
name: ezjail
- name: Configure ezjail to use http
when: ansible_distribution_version is version('11.01', '>')
lineinfile:
dest: /usr/local/etc/ezjail.conf
regexp: ^ezjail_ftphost
line: ezjail_ftphost=http://ftp.freebsd.org
- name: Configure ezjail to use archive for old freebsd releases
when: ansible_distribution_version is version('11.01', '<=')
lineinfile:
dest: /usr/local/etc/ezjail.conf
regexp: ^ezjail_ftphost
line: ezjail_ftphost=ftp-archive.freebsd.org
line: ezjail_ftphost=http://ftp-archive.freebsd.org
- name: Start ezjail
ignore_errors: yes

View File

@@ -69,7 +69,5 @@ plugins/modules/system/ssh_config.py use-argspec-type-path # Required since modu
plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice
plugins/modules/system/xfconf.py validate-modules:return-syntax-error
plugins/modules/web_infrastructure/jenkins_plugin.py use-argspec-type-path
tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.6 # django generated code
tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.7 # django generated code
tests/utils/shippable/check_matrix.py replace-urlopen
tests/utils/shippable/timing.py shebang

View File

@@ -184,6 +184,7 @@ TESTCASE_BRIDGE = [
'ifname': 'br0_non_existant',
'ip4': '10.10.10.10/24',
'gw4': '10.10.10.1',
'mac': '52:54:00:ab:cd:ef',
'maxage': 100,
'stp': True,
'state': 'present',
@@ -200,6 +201,7 @@ ipv4.addresses: 10.10.10.10/24
ipv4.gateway: 10.10.10.1
ipv4.never-default: no
ipv6.method: auto
bridge.mac-address: 52:54:00:AB:CD:EF
bridge.stp: yes
bridge.max-age: 100
bridge.ageing-time: 300
@@ -223,6 +225,7 @@ TESTCASE_BRIDGE_SLAVE_SHOW_OUTPUT = """\
connection.id: non_existent_nw_device
connection.interface-name: br0_non_existant
connection.autoconnect: yes
connection.slave-type: bridge
ipv4.never-default: no
bridge-port.path-cost: 100
bridge-port.hairpin-mode: yes

View File

@@ -181,7 +181,7 @@ function cleanup
flags="${flags//=/,}"
flags="${flags//[^a-zA-Z0-9_,]/_}"
bash <(curl -s https://codecov.io/bash) \
bash <(curl -s https://ansible-ci-files.s3.us-east-1.amazonaws.com/codecov/codecov.sh) \
-f "${file}" \
-F "${flags}" \
-n "${test}" \