mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-28 09:26:44 +00:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80fbcf2f98 | ||
|
|
a722e038cc | ||
|
|
19c8d2164d | ||
|
|
d4656ffca2 | ||
|
|
b49607f12d | ||
|
|
af0ce4284f | ||
|
|
f5f862617a | ||
|
|
a1a4ba4337 | ||
|
|
b0b783f8ff | ||
|
|
e670ca666a | ||
|
|
49b991527e | ||
|
|
e6cc671a0d | ||
|
|
797ea23e50 | ||
|
|
4d23b7a48b | ||
|
|
020b47a1a9 | ||
|
|
0da9d956a0 | ||
|
|
5691e3aff3 | ||
|
|
007333dbfe | ||
|
|
05666b0e4d | ||
|
|
c934d9aeb5 | ||
|
|
5b15e4089a | ||
|
|
a6379e45ce | ||
|
|
b95176dbc8 | ||
|
|
b752fea121 | ||
|
|
cf50990fed | ||
|
|
45343e6bc0 | ||
|
|
51540f6345 | ||
|
|
74eba52028 | ||
|
|
b920e8abf2 | ||
|
|
75c0004e1e | ||
|
|
be42fd4af7 | ||
|
|
1c05908ff6 | ||
|
|
ea42b75378 | ||
|
|
0330f4b52c | ||
|
|
1d8c659ba2 |
@@ -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
|
||||
|
||||
@@ -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
14
.github/BOTMETA.yml
vendored
@@ -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
|
||||
|
||||
@@ -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
|
||||
======
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -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 = '''
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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'
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'''
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'])):
|
||||
|
||||
@@ -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
0
scripts/inventory/abiquo.py
Normal file → Executable file
0
scripts/inventory/apache-libcloud.py
Normal file → Executable file
0
scripts/inventory/apache-libcloud.py
Normal file → Executable file
0
scripts/inventory/apstra_aos.py
Normal file → Executable file
0
scripts/inventory/apstra_aos.py
Normal file → Executable file
0
scripts/inventory/azure_rm.py
Normal file → Executable file
0
scripts/inventory/azure_rm.py
Normal file → Executable file
0
scripts/inventory/brook.py
Normal file → Executable file
0
scripts/inventory/brook.py
Normal file → Executable file
0
scripts/inventory/cloudforms.py
Normal file → Executable file
0
scripts/inventory/cloudforms.py
Normal file → Executable file
0
scripts/inventory/cobbler.py
Normal file → Executable file
0
scripts/inventory/cobbler.py
Normal file → Executable file
0
scripts/inventory/collins.py
Normal file → Executable file
0
scripts/inventory/collins.py
Normal file → Executable file
0
scripts/inventory/consul_io.py
Normal file → Executable file
0
scripts/inventory/consul_io.py
Normal file → Executable file
0
scripts/inventory/docker.py
Normal file → Executable file
0
scripts/inventory/docker.py
Normal file → Executable file
0
scripts/inventory/fleet.py
Normal file → Executable file
0
scripts/inventory/fleet.py
Normal file → Executable file
0
scripts/inventory/foreman.py
Normal file → Executable file
0
scripts/inventory/foreman.py
Normal file → Executable file
0
scripts/inventory/freeipa.py
Normal file → Executable file
0
scripts/inventory/freeipa.py
Normal file → Executable file
0
scripts/inventory/infoblox.py
Normal file → Executable file
0
scripts/inventory/infoblox.py
Normal file → Executable file
0
scripts/inventory/jail.py
Normal file → Executable file
0
scripts/inventory/jail.py
Normal file → Executable file
0
scripts/inventory/landscape.py
Normal file → Executable file
0
scripts/inventory/landscape.py
Normal file → Executable file
0
scripts/inventory/linode.py
Normal file → Executable file
0
scripts/inventory/linode.py
Normal file → Executable file
0
scripts/inventory/lxc_inventory.py
Normal file → Executable file
0
scripts/inventory/lxc_inventory.py
Normal file → Executable file
0
scripts/inventory/lxd.py
Normal file → Executable file
0
scripts/inventory/lxd.py
Normal file → Executable file
0
scripts/inventory/mdt_dynamic_inventory.py
Normal file → Executable file
0
scripts/inventory/mdt_dynamic_inventory.py
Normal file → Executable file
0
scripts/inventory/nagios_livestatus.py
Normal file → Executable file
0
scripts/inventory/nagios_livestatus.py
Normal file → Executable file
0
scripts/inventory/nagios_ndo.py
Normal file → Executable file
0
scripts/inventory/nagios_ndo.py
Normal file → Executable file
0
scripts/inventory/nsot.py
Normal file → Executable file
0
scripts/inventory/nsot.py
Normal file → Executable file
0
scripts/inventory/openshift.py
Normal file → Executable file
0
scripts/inventory/openshift.py
Normal file → Executable file
0
scripts/inventory/openvz.py
Normal file → Executable file
0
scripts/inventory/openvz.py
Normal file → Executable file
0
scripts/inventory/ovirt.py
Normal file → Executable file
0
scripts/inventory/ovirt.py
Normal file → Executable file
0
scripts/inventory/ovirt4.py
Normal file → Executable file
0
scripts/inventory/ovirt4.py
Normal file → Executable file
0
scripts/inventory/packet_net.py
Normal file → Executable file
0
scripts/inventory/packet_net.py
Normal file → Executable file
0
scripts/inventory/proxmox.py
Normal file → Executable file
0
scripts/inventory/proxmox.py
Normal file → Executable file
0
scripts/inventory/rackhd.py
Normal file → Executable file
0
scripts/inventory/rackhd.py
Normal file → Executable file
0
scripts/inventory/rax.py
Normal file → Executable file
0
scripts/inventory/rax.py
Normal file → Executable file
0
scripts/inventory/rudder.py
Normal file → Executable file
0
scripts/inventory/rudder.py
Normal file → Executable file
0
scripts/inventory/scaleway.py
Normal file → Executable file
0
scripts/inventory/scaleway.py
Normal file → Executable file
0
scripts/inventory/serf.py
Normal file → Executable file
0
scripts/inventory/serf.py
Normal file → Executable file
0
scripts/inventory/softlayer.py
Normal file → Executable file
0
scripts/inventory/softlayer.py
Normal file → Executable file
0
scripts/inventory/spacewalk.py
Normal file → Executable file
0
scripts/inventory/spacewalk.py
Normal file → Executable file
0
scripts/inventory/ssh_config.py
Normal file → Executable file
0
scripts/inventory/ssh_config.py
Normal file → Executable file
0
scripts/inventory/stacki.py
Normal file → Executable file
0
scripts/inventory/stacki.py
Normal file → Executable file
0
scripts/inventory/vagrant.py
Normal file → Executable file
0
scripts/inventory/vagrant.py
Normal file → Executable file
0
scripts/inventory/vbox.py
Normal file → Executable file
0
scripts/inventory/vbox.py
Normal file → Executable file
0
scripts/inventory/zone.py
Normal file → Executable file
0
scripts/inventory/zone.py
Normal file → Executable file
0
scripts/vault/azure_vault.py
Normal file → Executable file
0
scripts/vault/azure_vault.py
Normal file → Executable file
0
scripts/vault/vault-keyring-client.py
Normal file → Executable file
0
scripts/vault/vault-keyring-client.py
Normal file → Executable file
0
scripts/vault/vault-keyring.py
Normal file → Executable file
0
scripts/vault/vault-keyring.py
Normal file → Executable 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
5
tests/config.yml
Normal 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
|
||||
@@ -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: ''
|
||||
|
||||
@@ -3,4 +3,3 @@ needs/root
|
||||
skip/docker
|
||||
skip/osx
|
||||
skip/rhel
|
||||
disabled # FIXME
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}" \
|
||||
|
||||
Reference in New Issue
Block a user