Compare commits

..

18 Commits
5.2.0 ... 5.3.0

Author SHA1 Message Date
Felix Fontein
a7dbefcaf1 Release 5.3.0. 2022-07-12 11:18:14 +02:00
patchback[bot]
9d5490e510 proxmox inventory: fix for agent enabled (#4910) (#4947)
* Update proxmox.py

* Forgot a debug print.

* pep

* Check if int, old school way.

* pep, once again.

* Create 4910-fix-for-agent-enabled.yml

* Must check the first listentry for enabled=1

* Update changelogs/fragments/4910-fix-for-agent-enabled.yml

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

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

Co-authored-by: ube <ube@alienautopsy.net>
2022-07-12 11:17:40 +02:00
patchback[bot]
2245742255 Misc. typo fixes (#4940) (#4942)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit bf94f08bc4)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-07-11 22:18:22 +02:00
patchback[bot]
6058a5e5b1 added password prompt support for machinectl (#4849) (#4941)
* added password prompt support for machinectl

* include review comments

This includes the review comments as well as changelog fragment. This also gives more information about the polkit rule.

* fix yaml doc with leftover bracket

* include review comments 2

* move regex compile to global scope

(cherry picked from commit 35ddf31b5f)

Co-authored-by: Louis Seubert <louis.seubert.ls@gmail.com>
2022-07-11 22:08:53 +02:00
Felix Fontein
224567e604 Prepare 5.3.0 release. 2022-07-11 22:08:31 +02:00
patchback[bot]
1eb872ccea allow configuring opentelementry callback via config file (#4916) (#4938)
this is especially useful for the `enable_from_environment` option, as
this allows to set a default for the whole project, instead of relying
on everyone setting the environment variable

(cherry picked from commit a5ff53f2ae)

Co-authored-by: Evgeni Golov <evgeni@golov.de>
2022-07-07 22:48:20 +02:00
patchback[bot]
ba18d6232a fix lxd connection plugin inventory_hostname (#4912) (#4935)
* fixes lxd connection plugin issue #4886

remote_addr value was set to literal string 'inventory_hostname' instead
of the value for inventory_hostname variable. solution found in PR
ansible/ansible#77894

* changelog fragment - bugfix - lxd connection plugin

* correct changelog fragment

* Update changelogs/fragments/4886-fix-lxd-inventory-hostname.yml

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

* replace _host instance variable with calls to get 'remote_addr' option

suggested by felixfontein

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

Co-authored-by: antonc42 <antonc42@users.noreply.github.com>
2022-07-07 22:40:16 +02:00
patchback[bot]
6115f18837 Fix syntax in rax_clb_nodes that breaks in Python3 (#4933) (#4937)
* Use syntax that works in both Python 2 and 3 when iterating through a
    dict that's going to be mutated during iteration
  * Fixes `dictionary changed size during iteration` error
  * Fixes #4932

(cherry picked from commit 9a928d5ffb)

Co-authored-by: Teddy Caddy <tcaddy@users.noreply.github.com>
2022-07-07 22:37:10 +02:00
patchback[bot]
3f4e3dd2b6 Fix license filenames. (#4923) (#4925)
(cherry picked from commit 1c06e237c8)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-07-04 20:12:10 +00:00
patchback[bot]
a573661458 Do not ignore tld option in DSV lookup plugin (#4911) (#4921)
* Do not ignore tld option in DSV lookup plugin

* add changelog fragment

* Update changelogs/fragments/4911-dsv-honor-tld-option.yml

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

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

Co-authored-by: andrii-zakurenyi <85106843+andrii-zakurenyi@users.noreply.github.com>
2022-07-04 20:40:25 +02:00
patchback[bot]
0977152b39 Fix GetChassisPower when multiple chassis are present (#4902) (#4915)
* Fix GetChassisPower when multiple chassis are present

When multiple chassis are present, and one or more of those chassis do _not_
report power information, the GetChassisPower command will fail. To address
that, only report a failure if _all_ of the Chassis objects lack power
power reporting functionality.

Fixes #4901

* Update changelogs/fragments/4901-fix-redfish-chassispower.yml

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

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

Co-authored-by: Jacob Yundt <jyundt@gmail.com>
2022-06-30 21:01:52 +02:00
patchback[bot]
91fe881226 Add GetFirmwareVersion command to redfish_info (#4900) (#4913)
* Add GetManagerInventory command to redfish_info

Adding GetManagerInventory command to redfish_info, similar to
GetSystemInventory to report Manager specific information like:
- FirmwareVersion
- Model
- ManagerType

Fixes #4899

* Update changelogs/fragments/4899-add-GetManagerInventory-for-redfish_info.yml

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

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

Co-authored-by: Jacob Yundt <jyundt@gmail.com>
2022-06-30 21:01:37 +02:00
patchback[bot]
b78c0cf64f Improve hwclock support test. (#4904) (#4909)
(cherry picked from commit 674b1da8bf)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-30 07:41:56 +02:00
patchback[bot]
c79ccbbf7e Fix command variable usage in CmdRunner (#4903) (#4906)
* Fix command variable usage

* Add changelog fragment for cmd-runner bugfix (#4903)

(cherry picked from commit 265c052c27)

Co-authored-by: Álvaro García Jaén <garciajaenalvaro@gmail.com>
2022-06-30 07:30:53 +02:00
patchback[bot]
a80761a8a4 Fix various module docs. (#4887) (#4888)
(cherry picked from commit 2dcdd2faca)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-22 22:54:08 +02:00
patchback[bot]
213419fb0c Fix docs. (#4881) (#4884)
(cherry picked from commit aa4c994dfd)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-22 14:44:33 +02:00
patchback[bot]
39a1f280e3 Added additional maintainers for TSS and DSV lookup plugins (#4870) (#4875)
(cherry picked from commit cb58867b57)

Co-authored-by: Ricky White <ricky@migusgroup.com>
2022-06-21 22:55:55 +02:00
Felix Fontein
a13d407247 Next expected release is 5.3.0. 2022-06-21 22:24:51 +02:00
85 changed files with 295 additions and 136 deletions

4
.github/BOTMETA.yml vendored
View File

@@ -214,7 +214,7 @@ files:
$lookups/dnstxt.py:
maintainers: jpmens
$lookups/dsv.py:
maintainers: amigus endlesstrax
maintainers: amigus endlesstrax delineaKrehl tylerezimmerman
$lookups/etcd3.py:
maintainers: eric-belhomme
$lookups/etcd.py:
@@ -251,7 +251,7 @@ files:
maintainers: RevBits
$lookups/shelvefile.py: {}
$lookups/tss.py:
maintainers: amigus endlesstrax
maintainers: amigus endlesstrax delineaKrehl tylerezimmerman
$module_utils/:
labels: module_utils
$module_utils/gconftool2.py:

View File

@@ -105,7 +105,7 @@ body:
attributes:
label: Steps to Reproduce
description: |
Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also pased any playbooks, configs and commands you used.
Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also passed any playbooks, configs and commands you used.
**HINT:** You can paste https://gist.github.com links for larger files.
value: |

View File

@@ -6,6 +6,31 @@ Community General Release Notes
This changelog describes changes after version 4.0.0.
v5.3.0
======
Release Summary
---------------
Regular bugfix and feature release.
Minor Changes
-------------
- machinectl become plugin - can now be used with a password from another user than root, if a polkit rule is present (https://github.com/ansible-collections/community.general/pull/4849).
- opentelemetry callback plugin - allow configuring opentelementry callback via config file (https://github.com/ansible-collections/community.general/pull/4916).
- redfish_info - add ``GetManagerInventory`` to report list of Manager inventory information (https://github.com/ansible-collections/community.general/issues/4899).
Bugfixes
--------
- cmd_runner module utils - fix bug caused by using the ``command`` variable instead of ``self.command`` when looking for binary path (https://github.com/ansible-collections/community.general/pull/4903).
- dsv lookup plugin - do not ignore the ``tld`` parameter (https://github.com/ansible-collections/community.general/pull/4911).
- lxd connection plugin - fix incorrect ``inventory_hostname`` in ``remote_addr``. This is needed for compatibility with ansible-core 2.13 (https://github.com/ansible-collections/community.general/issues/4886).
- proxmox inventory plugin - fix crash when ``enabled=1`` is used in agent config string (https://github.com/ansible-collections/community.general/pull/4910).
- rax_clb_nodes - fix code to be compatible with Python 3 (https://github.com/ansible-collections/community.general/pull/4933).
- redfish_info - fix to ``GetChassisPower`` to correctly report power information when multiple chassis exist, but not all chassis report power information (https://github.com/ansible-collections/community.general/issues/4901).
v5.2.0
======

View File

@@ -913,3 +913,37 @@ releases:
name: scaleway_compute_private_network
namespace: cloud.scaleway
release_date: '2022-06-21'
5.3.0:
changes:
bugfixes:
- cmd_runner module utils - fix bug caused by using the ``command`` variable
instead of ``self.command`` when looking for binary path (https://github.com/ansible-collections/community.general/pull/4903).
- dsv lookup plugin - do not ignore the ``tld`` parameter (https://github.com/ansible-collections/community.general/pull/4911).
- lxd connection plugin - fix incorrect ``inventory_hostname`` in ``remote_addr``.
This is needed for compatibility with ansible-core 2.13 (https://github.com/ansible-collections/community.general/issues/4886).
- proxmox inventory plugin - fix crash when ``enabled=1`` is used in agent config
string (https://github.com/ansible-collections/community.general/pull/4910).
- rax_clb_nodes - fix code to be compatible with Python 3 (https://github.com/ansible-collections/community.general/pull/4933).
- redfish_info - fix to ``GetChassisPower`` to correctly report power information
when multiple chassis exist, but not all chassis report power information
(https://github.com/ansible-collections/community.general/issues/4901).
minor_changes:
- machinectl become plugin - can now be used with a password from another user
than root, if a polkit rule is present (https://github.com/ansible-collections/community.general/pull/4849).
- opentelemetry callback plugin - allow configuring opentelementry callback
via config file (https://github.com/ansible-collections/community.general/pull/4916).
- redfish_info - add ``GetManagerInventory`` to report list of Manager inventory
information (https://github.com/ansible-collections/community.general/issues/4899).
release_summary: Regular bugfix and feature release.
fragments:
- 4849-add-password-prompt-support-for-machinectl.yml
- 4886-fix-lxd-inventory-hostname.yml
- 4899-add-GetManagerInventory-for-redfish_info.yml
- 4901-fix-redfish-chassispower.yml
- 4903-cmdrunner-bugfix.yaml
- 4910-fix-for-agent-enabled.yml
- 4911-dsv-honor-tld-option.yml
- 4916-opentelemetry-ini-options.yaml
- 4933-fix-rax-clb-nodes.yaml
- 5.3.0.yml
release_date: '2022-07-12'

View File

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

View File

@@ -66,15 +66,46 @@ DOCUMENTATION = '''
ini:
- section: machinectl_become_plugin
key: password
notes:
- When not using this plugin with user C(root), it only works correctly with a polkit rule which will alter
the behaviour of machinectl. This rule must alter the prompt behaviour to ask directly for the user credentials,
if the user is allowed to perform the action (take a look at the examples section).
If such a rule is not present the plugin only work if it is used in context with the root user,
because then no further prompt will be shown by machinectl.
'''
EXAMPLES = r'''
# A polkit rule needed to use the module with a non-root user.
# See the Notes section for details.
60-machinectl-fast-user-auth.rules: |
polkit.addRule(function(action, subject) {
if(action.id == "org.freedesktop.machine1.host-shell" && subject.isInGroup("wheel")) {
return polkit.Result.AUTH_SELF_KEEP;
}
});
'''
from re import compile as re_compile
from ansible.plugins.become import BecomeBase
from ansible.module_utils._text import to_bytes
ansi_color_codes = re_compile(to_bytes(r'\x1B\[[0-9;]+m'))
class BecomeModule(BecomeBase):
name = 'community.general.machinectl'
prompt = 'Password: '
fail = ('==== AUTHENTICATION FAILED ====',)
success = ('==== AUTHENTICATION COMPLETE ====',)
@staticmethod
def remove_ansi_codes(line):
return ansi_color_codes.sub(b"", line)
def build_become_command(self, cmd, shell):
super(BecomeModule, self).build_become_command(cmd, shell)
@@ -86,3 +117,15 @@ class BecomeModule(BecomeBase):
flags = self.get_option('become_flags')
user = self.get_option('become_user')
return '%s -q shell %s %s@ %s' % (become, flags, user, cmd)
def check_success(self, b_output):
b_output = self.remove_ansi_codes(b_output)
return super().check_success(b_output)
def check_incorrect_password(self, b_output):
b_output = self.remove_ansi_codes(b_output)
return super().check_incorrect_password(b_output)
def check_missing_password(self, b_output):
b_output = self.remove_ansi_codes(b_output)
return super().check_missing_password(b_output)

View File

@@ -12,7 +12,7 @@ DOCUMENTATION = '''
type: notification
short_description: write playbook output to log file
description:
- This callback writes playbook output to a file per host in the `/var/log/ansible/hosts` directory
- This callback writes playbook output to a file per host in the C(/var/log/ansible/hosts) directory
requirements:
- Whitelist in configuration
- A writeable /var/log/ansible/hosts directory by the user executing Ansible on the controller

View File

@@ -24,6 +24,10 @@ DOCUMENTATION = '''
- Hide the arguments for a task.
env:
- name: ANSIBLE_OPENTELEMETRY_HIDE_TASK_ARGUMENTS
ini:
- section: callback_opentelemetry
key: hide_task_arguments
version_added: 5.3.0
enable_from_environment:
type: str
description:
@@ -34,6 +38,10 @@ DOCUMENTATION = '''
and if set to true this plugin will be enabled.
env:
- name: ANSIBLE_OPENTELEMETRY_ENABLE_FROM_ENVIRONMENT
ini:
- section: callback_opentelemetry
key: enable_from_environment
version_added: 5.3.0
version_added: 3.8.0
otel_service_name:
default: ansible
@@ -42,6 +50,10 @@ DOCUMENTATION = '''
- The service name resource attribute.
env:
- name: OTEL_SERVICE_NAME
ini:
- section: callback_opentelemetry
key: otel_service_name
version_added: 5.3.0
traceparent:
default: None
type: str
@@ -61,11 +73,14 @@ examples: |
Enable the plugin in ansible.cfg:
[defaults]
callbacks_enabled = community.general.opentelemetry
[callback_opentelemetry]
enable_from_environment = ANSIBLE_OPENTELEMETRY_ENABLED
Set the environment variable:
export OTEL_EXPORTER_OTLP_ENDPOINT=<your endpoint (OTLP/HTTP)>
export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer your_otel_token"
export OTEL_SERVICE_NAME=your_service_name
export ANSIBLE_OPENTELEMETRY_ENABLED=true
'''
import getpass

View File

@@ -14,9 +14,9 @@ DOCUMENTATION = '''
- set as main display callback
short_description: only print certain tasks
description:
- This callback only prints tasks that have been tagged with `print_action` or that have failed.
- This callback only prints tasks that have been tagged with C(print_action) or that have failed.
This allows operators to focus on the tasks that provide value only.
- Tasks that are not printed are placed with a '.'.
- Tasks that are not printed are placed with a C(.).
- If you increase verbosity all tasks are printed.
options:
nocolor:

View File

@@ -18,6 +18,7 @@ DOCUMENTATION = '''
- Container identifier.
default: inventory_hostname
vars:
- name: inventory_hostname
- name: ansible_host
- name: ansible_lxd_host
executable:
@@ -61,7 +62,6 @@ class Connection(ConnectionBase):
def __init__(self, play_context, new_stdin, *args, **kwargs):
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
self._host = self._play_context.remote_addr
try:
self._lxc_cmd = get_bin_path("lxc")
except ValueError:
@@ -75,14 +75,14 @@ class Connection(ConnectionBase):
super(Connection, self)._connect()
if not self._connected:
self._display.vvv(u"ESTABLISH LXD CONNECTION FOR USER: root", host=self._host)
self._display.vvv(u"ESTABLISH LXD CONNECTION FOR USER: root", host=self.get_option('remote_addr'))
self._connected = True
def exec_command(self, cmd, in_data=None, sudoable=True):
""" execute a command on the lxd host """
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
self._display.vvv(u"EXEC {0}".format(cmd), host=self._host)
self._display.vvv(u"EXEC {0}".format(cmd), host=self.get_option('remote_addr'))
local_cmd = [self._lxc_cmd]
if self.get_option("project"):
@@ -104,10 +104,10 @@ class Connection(ConnectionBase):
stderr = to_text(stderr)
if stderr == "error: Container is not running.\n":
raise AnsibleConnectionFailure("container not running: %s" % self._host)
raise AnsibleConnectionFailure("container not running: %s" % self.get_option('remote_addr'))
if stderr == "error: not found\n":
raise AnsibleConnectionFailure("container not found: %s" % self._host)
raise AnsibleConnectionFailure("container not found: %s" % self.get_option('remote_addr'))
return process.returncode, stdout, stderr
@@ -115,7 +115,7 @@ class Connection(ConnectionBase):
""" put a file from local to lxd """
super(Connection, self).put_file(in_path, out_path)
self._display.vvv(u"PUT {0} TO {1}".format(in_path, out_path), host=self._host)
self._display.vvv(u"PUT {0} TO {1}".format(in_path, out_path), host=self.get_option('remote_addr'))
if not os.path.isfile(to_bytes(in_path, errors='surrogate_or_strict')):
raise AnsibleFileNotFound("input path is not a file: %s" % in_path)
@@ -138,7 +138,7 @@ class Connection(ConnectionBase):
""" fetch a file from lxd to local """
super(Connection, self).fetch_file(in_path, out_path)
self._display.vvv(u"FETCH {0} TO {1}".format(in_path, out_path), host=self._host)
self._display.vvv(u"FETCH {0} TO {1}".format(in_path, out_path), host=self.get_option('remote_addr'))
local_cmd = [self._lxc_cmd]
if self.get_option("project"):

View File

@@ -21,7 +21,7 @@ DOCUMENTATION = '''
'''
EXAMPLES = '''
- name: Count occurences
- name: Count occurrences
ansible.builtin.debug:
msg: >-
{{ [1, 'a', 2, 2, 'a', 'b', 'a'] | community.general.counter }}
@@ -30,7 +30,7 @@ EXAMPLES = '''
RETURN = '''
_value:
description: A dictionary with the elements of the sequence as keys, and their number of occurance in the sequence as values.
description: A dictionary with the elements of the sequence as keys, and their number of occurrences in the sequence as values.
type: dictionary
'''

View File

@@ -38,7 +38,7 @@ DOCUMENTATION = '''
parser:
description:
- The correct parser for the input data.
- For exmaple C(ifconfig).
- For example C(ifconfig).
- See U(https://github.com/kellyjonbrazil/jc#parsers) for the latest list of parsers.
type: string
required: true

View File

@@ -213,7 +213,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
self.inventory.add_child(parent_group_name, group_name)
else:
self.display.vvvv('Processing profile %s without parent\n' % profile['name'])
# Create a heirarchy of profile names
# Create a hierarchy of profile names
profile_elements = profile['name'].split('-')
i = 0
while i < len(profile_elements) - 1:

View File

@@ -522,7 +522,7 @@ class InventoryModule(BaseInventoryPlugin):
"""Helper to save data
Helper to save the data in self.data
Detect if data is allready in branch and use dict_merge() to prevent that branch is overwritten.
Detect if data is already in branch and use dict_merge() to prevent that branch is overwritten.
Args:
str(instance_name): name of instance

View File

@@ -412,12 +412,20 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
properties[parsed_key] = [tag.strip() for tag in stripped_value.split(",")]
# The first field in the agent string tells you whether the agent is enabled
# the rest of the comma separated string is extra config for the agent
if config == 'agent' and int(value.split(',')[0]):
agent_iface_value = self._get_agent_network_interfaces(node, vmid, vmtype)
if agent_iface_value:
agent_iface_key = self.to_safe('%s%s' % (key, "_interfaces"))
properties[agent_iface_key] = agent_iface_value
# the rest of the comma separated string is extra config for the agent.
# In some (newer versions of proxmox) instances it can be 'enabled=1'.
if config == 'agent':
agent_enabled = 0
try:
agent_enabled = int(value.split(',')[0])
except ValueError:
if value.split(',')[0] == "enabled=1":
agent_enabled = 1
if agent_enabled:
agent_iface_value = self._get_agent_network_interfaces(node, vmid, vmtype)
if agent_iface_value:
agent_iface_key = self.to_safe('%s%s' % (key, "_interfaces"))
properties[agent_iface_key] = agent_iface_value
if config == 'lxc':
out_val = {}

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
The lookup order mirrors the one from Chef, all folders in the base path are walked back looking for the following configuration
file in order : .chef/knife.rb, ~/.chef/knife.rb, /etc/chef/client.rb"
requirements:
- "pychef (python library https://pychef.readthedocs.io `pip install pychef`)"
- "pychef (L(Python library, https://pychef.readthedocs.io), C(pip install pychef))"
options:
name:
description:

View File

@@ -122,6 +122,7 @@ class LookupModule(LookupBase):
"tenant": self.get_option("tenant"),
"client_id": self.get_option("client_id"),
"client_secret": self.get_option("client_secret"),
"tld": self.get_option("tld"),
"url_template": self.get_option("url_template"),
}
)

View File

@@ -191,7 +191,7 @@ class CmdRunner(object):
environ_update = {}
self.environ_update = environ_update
self.command[0] = module.get_bin_path(command[0], opt_dirs=path_prefix, required=True)
self.command[0] = module.get_bin_path(self.command[0], opt_dirs=path_prefix, required=True)
for mod_param_name, spec in iteritems(module.argument_spec):
if mod_param_name not in self.arg_formats:

View File

@@ -351,7 +351,7 @@ def wait_to_finish(target, pending, refresh, timeout, min_interval=1, delay=3):
if pending and status not in pending:
raise HwcModuleException(
"unexpect status(%s) occured" % status)
"unexpect status(%s) occurred" % status)
if not is_last_time:
wait *= 2

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Hewlett Packard Enterprise, Inc. All rights reserved.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -83,12 +83,12 @@ class OpenNebulaModule:
if self.module.params.get("api_username"):
username = self.module.params.get("api_username")
else:
self.fail("Either api_username or the environment vairable ONE_USERNAME must be provided")
self.fail("Either api_username or the environment variable ONE_USERNAME must be provided")
if self.module.params.get("api_password"):
password = self.module.params.get("api_password")
else:
self.fail("Either api_password or the environment vairable ONE_PASSWORD must be provided")
self.fail("Either api_password or the environment variable ONE_PASSWORD must be provided")
session = "%s:%s" % (username, password)

View File

@@ -691,7 +691,7 @@ def check_and_create_resource(
:param model: Model used to create a resource.
:param exclude_attributes: The attributes which should not be used to distinguish the resource. e.g. display_name,
dns_label.
:param dead_states: List of states which can't transition to any of the usable states of the resource. This deafults
:param dead_states: List of states which can't transition to any of the usable states of the resource. This defaults
to ["TERMINATING", "TERMINATED", "FAULTY", "FAILED", "DELETING", "DELETED", "UNKNOWN_ENUM_VALUE"]
:param default_attribute_values: A dictionary containing default values for attributes.
:return: A dictionary containing the resource & the "changed" status. e.g. {"vcn":{x:y}, "changed":True}
@@ -1189,7 +1189,7 @@ def are_dicts_equal(
def should_dict_attr_be_excluded(map_option_name, option_key, exclude_list):
"""An entry for the Exclude list for excluding a map's key is specifed as a dict with the map option name as the
"""An entry for the Exclude list for excluding a map's key is specified as a dict with the map option name as the
key, and the value as a list of keys to be excluded within that map. For example, if the keys "k1" and "k2" of a map
option named "m1" needs to be excluded, the exclude list must have an entry {'m1': ['k1','k2']} """
for exclude_item in exclude_list:

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -1888,14 +1888,13 @@ class RedfishUtils(object):
for property in properties:
if property in data:
chassis_power_result[property] = data[property]
else:
return {'ret': False, 'msg': 'Key PowerControl not found.'}
chassis_power_results.append(chassis_power_result)
else:
return {'ret': False, 'msg': 'Key Power not found.'}
result['entries'] = chassis_power_results
return result
if len(chassis_power_results) > 0:
result['entries'] = chassis_power_results
return result
else:
return {'ret': False, 'msg': 'Power information not found.'}
def get_chassis_thermals(self):
result = {}
@@ -3029,3 +3028,26 @@ class RedfishUtils(object):
if not result["entries"]:
return {'ret': False, 'msg': "No HostInterface objects found"}
return result
def get_manager_inventory(self, manager_uri):
result = {}
inventory = {}
# Get these entries, but does not fail if not found
properties = ['FirmwareVersion', 'ManagerType', 'Manufacturer', 'Model',
'PartNumber', 'PowerState', 'SerialNumber', 'Status', 'UUID']
response = self.get_request(self.root_uri + manager_uri)
if response['ret'] is False:
return response
result['ret'] = True
data = response['data']
for property in properties:
if property in data:
inventory[property] = data[property]
result["entries"] = inventory
return result
def get_multi_manager_inventory(self):
return self.aggregate_managers(self.get_manager_inventory)

View File

@@ -191,10 +191,10 @@ notes:
2.1, the later requires python to be installed in the instance which can
be done with the command module.
- You can copy a file from the host to the instance
with the Ansible M(ansible.builtin.copy) and M(ansible.builtin.template) module and the `lxd` connection plugin.
with the Ansible M(ansible.builtin.copy) and M(ansible.builtin.template) module and the C(community.general.lxd) connection plugin.
See the example below.
- You can copy a file in the created instance to the localhost
with `command=lxc file pull instance_name/dir/filename filename`.
with C(command=lxc file pull instance_name/dir/filename filename).
See the first example below.
'''

View File

@@ -360,7 +360,7 @@ class LXDProfileManagement(object):
)
def _merge_dicts(self, source, destination):
"""Merge Dictionarys
"""Merge Dictionaries
Get a list of filehandle numbers from logger to be handed to
DaemonContext.files_preserve

View File

@@ -303,7 +303,7 @@ class LXDProjectManagement(object):
)
def _merge_dicts(self, source, destination):
""" Return a new dict taht merge two dict,
""" Return a new dict that merge two dict,
with values in source dict overwrite destination dict
Args:

View File

@@ -1204,12 +1204,12 @@ def main():
# Ensure source VM id exists when cloning
proxmox.get_vm(vmid)
# Ensure the choosen VM name doesn't already exist when cloning
# Ensure the chosen VM name doesn't already exist when cloning
existing_vmid = proxmox.get_vmid(name, ignore_missing=True)
if existing_vmid:
module.exit_json(changed=False, vmid=existing_vmid, msg="VM with name <%s> already exists" % name)
# Ensure the choosen VM id doesn't already exist when cloning
# Ensure the chosen VM id doesn't already exist when cloning
if proxmox.get_vm(newid, ignore_missing=True):
module.exit_json(changed=False, vmid=vmid, msg="vmid %s with VM name %s already exists" % (newid, name))

View File

@@ -107,7 +107,7 @@ state:
returned: always
command:
type: str
description: Full `serverless` command run by this module, in case you want to re-run the command outside the module.
description: Full C(serverless) command run by this module, in case you want to re-run the command outside the module.
returned: always
sample: serverless deploy --stage production
'''

View File

@@ -67,7 +67,7 @@ options:
state_file:
description:
- The path to an existing Terraform state file to use when building plan.
If this is not specified, the default `terraform.tfstate` will be used.
If this is not specified, the default C(terraform.tfstate) will be used.
- This option is ignored when plan is specified.
type: path
variables_files:
@@ -103,7 +103,7 @@ options:
force_init:
description:
- To avoid duplicating infra, if a state file can't be found this will
force a `terraform init`. Generally, this should be turned off unless
force a C(terraform init). Generally, this should be turned off unless
you intend to provision an entirely new Terraform deployment.
default: false
type: bool
@@ -149,7 +149,7 @@ options:
type: int
version_added: '3.8.0'
notes:
- To just run a `terraform plan`, use check mode.
- To just run a C(terraform plan), use check mode.
requirements: [ "terraform" ]
author: "Ryan Scott Brown (@ryansb)"
'''
@@ -205,7 +205,7 @@ EXAMPLES = """
RETURN = """
outputs:
type: complex
description: A dictionary of all the TF outputs by their assigned name. Use `.outputs.MyOutputName.value` to access the value.
description: A dictionary of all the TF outputs by their assigned name. Use C(.outputs.MyOutputName.value) to access the value.
returned: on success
sample: '{"bukkit_arn": {"sensitive": false, "type": "string", "value": "arn:aws:s3:::tf-test-bukkit"}'
contains:
@@ -223,12 +223,12 @@ outputs:
description: The value of the output as interpolated by Terraform
stdout:
type: str
description: Full `terraform` command stdout, in case you want to display it or examine the event log
description: Full C(terraform) command stdout, in case you want to display it or examine the event log
returned: always
sample: ''
command:
type: str
description: Full `terraform` command built by this module, in case you want to re-run the command outside the module or debug a problem.
description: Full C(terraform) command built by this module, in case you want to re-run the command outside the module or debug a problem.
returned: always
sample: terraform apply ...
"""

View File

@@ -252,7 +252,8 @@ def main():
'weight': weight,
}
for name, value in mutable.items():
for name in list(mutable):
value = mutable[name]
if value is None or value == getattr(node, name):
mutable.pop(name)

View File

@@ -75,15 +75,15 @@ options:
target_hostname:
type: str
description:
- One of `target_hostname` and `target_alias` is required for remote.* checks,
- One of I(target_hostname) and I(target_alias) is required for remote.* checks,
but prohibited for agent.* checks. The hostname this check should target.
Must be a valid IPv4, IPv6, or FQDN.
target_alias:
type: str
description:
- One of `target_alias` and `target_hostname` is required for remote.* checks,
- One of I(target_alias) and I(target_hostname) is required for remote.* checks,
but prohibited for agent.* checks. Use the corresponding key in the entity's
`ip_addresses` hash to resolve an IP address to target.
I(ip_addresses) hash to resolve an IP address to target.
details:
type: dict
description:

View File

@@ -35,7 +35,7 @@ options:
user_data:
type: dict
description:
- User defined data. Typically used with `cloud-init`.
- User defined data. Typically used with C(cloud-init).
- Pass your cloud-init script here as a string
required: false

View File

@@ -1207,7 +1207,7 @@ class XenServerVM(XenServerObject):
if (self.module.params['home_server'] and
(not self.vm_params['affinity'] or self.module.params['home_server'] != self.vm_params['affinity']['name_label'])):
# Check existance only. Ignore return value.
# Check existence only. Ignore return value.
get_object_ref(self.module, self.module.params['home_server'], uuid=None, obj_type="home server", fail=True,
msg_prefix="VM check home_server: ")
@@ -1371,7 +1371,7 @@ class XenServerVM(XenServerObject):
disk_sr = disk_params.get('sr')
if disk_sr_uuid is not None or disk_sr is not None:
# Check existance only. Ignore return value.
# Check existence only. Ignore return value.
get_object_ref(self.module, disk_sr, disk_sr_uuid, obj_type="SR", fail=True,
msg_prefix="VM check disks[%s]: " % position)
elif self.default_sr_ref == 'OpaqueRef:NULL':
@@ -1448,7 +1448,7 @@ class XenServerVM(XenServerObject):
if cdrom_type == "iso":
# Check if ISO exists.
# Check existance only. Ignore return value.
# Check existence only. Ignore return value.
get_object_ref(self.module, cdrom_iso_name, uuid=None, obj_type="ISO image", fail=True,
msg_prefix="VM check cdrom.iso_name: ")
@@ -1496,7 +1496,7 @@ class XenServerVM(XenServerObject):
self.module.fail_json(msg="VM check networks[%s]: network name cannot be an empty string!" % position)
if network_name:
# Check existance only. Ignore return value.
# Check existence only. Ignore return value.
get_object_ref(self.module, network_name, uuid=None, obj_type="network", fail=True,
msg_prefix="VM check networks[%s]: " % position)

View File

@@ -28,14 +28,14 @@ author:
options:
state:
description:
- The action to take with the supplied key and value. If the state is 'present' and `value` is set, the key
contents will be set to the value supplied and `changed` will be set to `true` only if the value was
different to the current contents. If the state is 'present' and `value` is not set, the existing value
associated to the key will be returned. The state 'absent' will remove the key/value pair,
again 'changed' will be set to true only if the key actually existed
- The action to take with the supplied key and value. If the state is C(present) and I(value) is set, the key
contents will be set to the value supplied and C(changed) will be set to C(true) only if the value was
different to the current contents. If the state is C(present) and I(value) is not set, the existing value
associated to the key will be returned. The state C(absent) will remove the key/value pair,
again C(changed) will be set to true only if the key actually existed
prior to the removal. An attempt can be made to obtain or free the
lock associated with a key/value pair with the states 'acquire' or
'release' respectively. a valid session must be supplied to make the
lock associated with a key/value pair with the states C(acquire) or
C(release) respectively. a valid session must be supplied to make the
attempt changed will be true if the attempt is successful, false
otherwise.
type: str

View File

@@ -279,7 +279,7 @@ def do_ini(module, filename, section=None, option=None, values=None,
# handling multiple instances of option=value when state is 'present' with/without exclusive is a bit complex
#
# 1. edit all lines where we have a option=value pair with a matching value in values[]
# 2. edit all the remaing lines where we have a matching option
# 2. edit all the remaining lines where we have a matching option
# 3. delete remaining lines where we have a matching option
# 4. insert missing option line(s) at the end of the section

View File

@@ -207,7 +207,7 @@ def main():
changed = True
else:
changed = False
out = "allready unpacked"
out = "already unpacked"
if remove:
os.remove(path)

View File

@@ -45,7 +45,7 @@ EXAMPLES = r'''
ipa_user: admin
ipa_pass: supersecret
- name: Ensure the TOTP syncronization window is set to 86400 seconds
- name: Ensure the TOTP synchronization window is set to 86400 seconds
community.general.ipa_otpconfig:
ipatokentotpsyncwindow: '86400'
ipa_host: localhost
@@ -59,7 +59,7 @@ EXAMPLES = r'''
ipa_user: admin
ipa_pass: supersecret
- name: Ensure the HOTP syncronization window is set to 100 hops
- name: Ensure the HOTP synchronization window is set to 100 hops
community.general.ipa_otpconfig:
ipatokenhotpsyncwindow: '100'
ipa_host: localhost

View File

@@ -63,7 +63,7 @@ options:
type: str
replace:
description:
- Force replace the existant vault on IPA server.
- Force replace the existent vault on IPA server.
type: bool
default: False
choices: ["True", "False"]

View File

@@ -64,7 +64,7 @@ msg:
realm_info:
description:
- Representation of the realm public infomation.
- Representation of the realm public information.
returned: always
type: dict
contains:

View File

@@ -20,7 +20,7 @@ description:
- "Allows to post events to Datadog (www.datadoghq.com) service."
- "Uses http://docs.datadoghq.com/api/#events API."
author:
- "Artūras `arturaz` Šlajus (@arturaz)"
- "Artūras 'arturaz' Šlajus (@arturaz)"
- "Naoya Nakazawa (@n0ts)"
options:
api_key:

View File

@@ -99,7 +99,7 @@ options:
weight:
description:
- The value passed in argument.
- If the value ends with the `%` sign, then the new weight will be
- If the value ends with the C(%) sign, then the new weight will be
relative to the initially configured weight.
- Relative weights are only permitted between 0 and 100% and absolute
weights are permitted between 0 and 256.

View File

@@ -1501,7 +1501,7 @@ class Nmcli(object):
if self._hairpin is None:
self.module.deprecate(
"Parameter 'hairpin' default value will change from true to false in community.general 7.0.0. "
"Set the value explicitly to supress this warning.",
"Set the value explicitly to suppress this warning.",
version='7.0.0', collection_name='community.general',
)
# Should be False in 7.0.0 but then that should be in argument_specs

View File

@@ -242,7 +242,7 @@ class AnsibleGalaxyInstall(CmdModuleHelper):
self.module.deprecate(
"Support for Ansible 2.9 and ansible-base 2.10 is being deprecated. "
"At the same time support for them is ended, also the ack_ansible29 option will be removed. "
"Upgrading is strongly recommended, or set 'ack_min_ansiblecore211' to supress this message.",
"Upgrading is strongly recommended, or set 'ack_min_ansiblecore211' to suppress this message.",
version="8.0.0",
collection_name="community.general",
)

View File

@@ -81,7 +81,7 @@ options:
classmap_authoritative:
description:
- Autoload classes from classmap only.
- Implicitely enable optimize_autoloader.
- Implicitly enable optimize_autoloader.
- Recommended especially for production, but can take a bit of time to run.
default: false
type: bool

View File

@@ -17,7 +17,7 @@ options:
clients:
description:
- A list of the pip executables that will be used to get the packages.
They can be supplied with the full path or just the executable name, i.e `pip3.7`.
They can be supplied with the full path or just the executable name, for example C(pip3.7).
default: ['pip']
required: False
type: list

View File

@@ -62,8 +62,8 @@ options:
type: bool
default: no
notes:
- '"name" and "upgrade" are mutually exclusive.'
- When used with a `loop:` each package will be processed individually, it is much more efficient to pass the list directly to the `name` option.
- 'I(name) and I(upgrade) are mutually exclusive.'
- When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly to the I(name) option.
'''
EXAMPLES = '''

View File

@@ -35,7 +35,7 @@ options:
elements: str
path:
description:
- "A ':' separated list of paths to search for 'brew' executable.
- "A C(:) separated list of paths to search for C(brew) executable.
Since a package (I(formula) in homebrew parlance) location is prefixed relative to the actual path of I(brew) command,
providing an alternative I(brew) path enables managing different set of packages in an alternative location in the system."
default: '/usr/local/bin:/opt/homebrew/bin'
@@ -70,8 +70,8 @@ options:
elements: str
version_added: '0.2.0'
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
- When used with a C(loop:) each package will be processed individually,
it is much more efficient to pass the list directly to the I(name) option.
'''
EXAMPLES = '''

View File

@@ -70,8 +70,8 @@ options:
type: bool
default: no
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
- When used with a C(loop:) each package will be processed individually,
it is much more efficient to pass the list directly to the I(name) option.
'''
EXAMPLES = '''

View File

@@ -102,8 +102,8 @@ options:
author: "bleader (@bleader)"
notes:
- When using pkgsite, be careful that already in cache packages won't be downloaded again.
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
- When used with a C(loop:) each package will be processed individually,
it is much more efficient to pass the list directly to the I(name) option.
'''
EXAMPLES = '''

View File

@@ -119,7 +119,7 @@ options:
repoview:
description:
- Whether to generate repoview files for a published repository. Setting
this to "yes" automatically activates `generate_sqlite`.
this to "yes" automatically activates C(generate_sqlite).
required: false
type: bool
default: no

View File

@@ -136,8 +136,8 @@ options:
- Adds C(--clean-deps) option to I(zypper) remove command.
version_added: '4.6.0'
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
- When used with a C(loop:) each package will be processed individually,
it is much more efficient to pass the list directly to the I(name) option.
# informational: requirements for nodes
requirements:
- "zypper >= 1.0 # included in openSUSE >= 11.1 or SUSE Linux Enterprise Server/Desktop >= 11.0"

View File

@@ -29,7 +29,7 @@ options:
type: str
executable:
description:
- Path to the hponcfg executable (`hponcfg` which uses $PATH).
- Path to the hponcfg executable (C(hponcfg) which uses $PATH).
default: hponcfg
type: str
verbose:

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Hewlett Packard Enterprise, Inc. All rights reserved.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Hewlett Packard Enterprise, Inc. All rights reserved.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -74,7 +74,7 @@ ilo_redfish_info:
type: dict
contains:
ret:
description: Check variable to see if the information was succesfully retrived.
description: Check variable to see if the information was successfully retrieved.
type: bool
msg:
description: Information of all active iLO sessions.

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -277,6 +277,14 @@ EXAMPLES = '''
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
- name: Get Manager Inventory
community.general.redfish_info:
category: Manager
command: GetManagerInventory
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
'''
RETURN = '''
@@ -301,7 +309,7 @@ CATEGORY_COMMANDS_ALL = {
"Sessions": ["GetSessions"],
"Update": ["GetFirmwareInventory", "GetFirmwareUpdateCapabilities", "GetSoftwareInventory"],
"Manager": ["GetManagerNicInventory", "GetVirtualMedia", "GetLogs", "GetNetworkProtocols",
"GetHealthReport", "GetHostInterfaces"],
"GetHealthReport", "GetHostInterfaces", "GetManagerInventory"],
}
CATEGORY_COMMANDS_DEFAULT = {
@@ -485,6 +493,8 @@ def main():
result["health_report"] = rf_utils.get_multi_manager_health_report()
elif command == "GetHostInterfaces":
result["host_interfaces"] = rf_utils.get_hostinterfaces()
elif command == "GetManagerInventory":
result["manager"] = rf_utils.get_multi_manager_inventory()
# Return data back
module.exit_json(redfish_facts=result)

View File

@@ -36,7 +36,7 @@ options:
name:
description:
- The name of the branch that needs to be protected.
- Can make use a wildcard charachter for like C(production/*) or just have C(main) or C(develop) as value.
- Can make use a wildcard character for like C(production/*) or just have C(main) or C(develop) as value.
required: true
type: str
merge_access_levels:

View File

@@ -305,7 +305,7 @@ class GitLabUser(object):
# note: as we unfortunately have some uncheckable parameters
# where it is not possible to determine if the update
# changed something or not, we must assume here that a
# changed happend and that an user object update is needed
# changed happened and that an user object update is needed
potentionally_changed = True
# Assign ssh keys

View File

@@ -36,7 +36,7 @@ options:
force:
description:
- Discards uncommitted changes. Runs C(hg update -C). Prior to
1.9, the default was `yes`.
1.9, the default was C(yes).
type: bool
default: 'no'
purge:

View File

@@ -99,7 +99,7 @@ options:
- The size of namespace. This option supports the suffixes C(k) or C(K) or C(KB) for KiB,
C(m) or C(M) or C(MB) for MiB, C(g) or C(G) or C(GB) for GiB and C(t) or C(T) or C(TB) for TiB.
- This option is required if multiple namespaces are configured.
- If this option is not set, all of the avaiable space of a region is configured.
- If this option is not set, all of the available space of a region is configured.
type: str
required: false
namespace_append:

View File

@@ -17,7 +17,7 @@ description:
- See the C(zfs allow) section of C(zfs(1M)) for detailed explanations of options.
- This module attempts to adhere to the behavior of the command line tool as much as possible.
requirements:
- "A ZFS/OpenZFS implementation that supports delegation with `zfs allow`, including: Solaris >= 10, illumos (all
- "A ZFS/OpenZFS implementation that supports delegation with C(zfs allow), including: Solaris >= 10, illumos (all
versions), FreeBSD >= 8.0R, ZFS on Linux >= 0.7.0."
options:
name:

View File

@@ -57,7 +57,7 @@ options:
realname:
description:
- The user's real ('human') name.
- This can also be used to add a comment to maintain compatability with C(useradd).
- This can also be used to add a comment to maintain compatibility with C(useradd).
aliases: [ 'comment' ]
type: str
realm:

View File

@@ -129,7 +129,7 @@ state:
type: str
sample: "reloaded"
status:
description: a dictionary with the key=value pairs returned by `system-control show-json` or C(None) if the service is not loaded
description: A dictionary with the key=value pairs returned by C(system-control show-json) or C(None) if the service is not loaded
returned: success
type: complex
contains:

View File

@@ -790,7 +790,7 @@ class AIXTimezone(Timezone):
inspects C(/etc/environment) to determine the current timezone.
While AIX time zones can be set using two formats (POSIX and
Olson) the prefered method is Olson.
Olson) the preferred method is Olson.
See the following article for more information:
https://developer.ibm.com/articles/au-aix-posix/

View File

@@ -186,7 +186,7 @@ options:
validate_certs:
required: false
description:
- Require valid SSL certificates (set to `false` if you'd like to use self-signed certificates)
- Require valid SSL certificates (set to C(false) if you'd like to use self-signed certificates)
default: true
type: bool

View File

@@ -14,7 +14,7 @@
- "valid_comma_separated_spaces | community.general.from_csv(skipinitialspace=True) == expected_result"
- "valid_comma_separated_spaces | community.general.from_csv != expected_result"
- name: Parse valid csv input with no headers with/without specifiying fieldnames
- name: Parse valid csv input with no headers with/without specifying fieldnames
assert:
that:
- "valid_comma_separated_no_headers | community.general.from_csv(fieldnames=['id','name','role']) == expected_result"

View File

@@ -105,7 +105,7 @@
- iso_result is changed
- iso_file.stat.exists == True
- name: Create iso file with Rock Ridge extention
- name: Create iso file with Rock Ridge extension
iso_create:
src_files:
- "{{ remote_tmp_dir }}/test1.cfg"
@@ -124,7 +124,7 @@
- iso_result is changed
- iso_file.stat.exists == True
- name: Create iso file with Joliet extention
- name: Create iso file with Joliet extension
iso_create:
src_files:
- "{{ remote_tmp_dir }}/test1.cfg"

View File

@@ -66,7 +66,7 @@
- name: Run tests
# Skip tests on Fedora 31 and 32 because dbus fails to start unless the container is run in priveleged mode.
# Skip tests on Fedora 31 and 32 because dbus fails to start unless the container is run in privileged mode.
# Even then, it starts unreliably. This may be due to the move to cgroup v2 in Fedora 31 and 32.
# https://www.redhat.com/sysadmin/fedora-31-control-group-v2
when:

View File

@@ -287,7 +287,7 @@
- name:
set_fact:
hwclock_supported: '{{ hwclock_test is successful or timedatectl_test is successful }}'
hwclock_supported: '{{ hwclock_test is successful or (timedatectl_test is successful and "RTC time: n/a" not in timedatectl_test.stdout) }}'
##
## test set hwclock, idempotency and checkmode
##

View File

@@ -107,7 +107,7 @@ def test_validate_config(inventory):
}
with pytest.raises(AnsibleError) as error_message:
inventory._validate_config(config)
assert "config missing client_secret, a required paramter" in error_message
assert "config missing client_secret, a required parameter" in error_message
config = {
"client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
@@ -116,7 +116,7 @@ def test_validate_config(inventory):
}
with pytest.raises(AnsibleError) as error_message:
inventory._validate_config(config)
assert "config missing client_id, a required paramter" in error_message
assert "config missing client_id, a required parameter" in error_message
def test_populate(inventory):

View File

@@ -39,7 +39,7 @@ def XenAPI():
"""Imports and returns fake XenAPI module."""
# Import of fake XenAPI module is wrapped by fixture so that it does not
# affect other unit tests which could potentialy also use XenAPI module.
# affect other unit tests which could potentially also use XenAPI module.
# First we use importlib.import_module() to import the module and assign
# it to a local symbol.

View File

@@ -35,7 +35,7 @@ def XenAPI():
"""Imports and returns fake XenAPI module."""
# Import of fake XenAPI module is wrapped by fixture so that it does not
# affect other unit tests which could potentialy also use XenAPI module.
# affect other unit tests which could potentially also use XenAPI module.
# First we use importlib.import_module() to import the module and assign
# it to a local symbol.

View File

@@ -109,7 +109,7 @@ class TestPritunlOrg(ModuleTestCase):
idempotent_exc = idempotent_result.exception.args[0]
# Ensure both calls resulted in the same returned value
# except for changed which sould be false the second time
# except for changed which should be false the second time
for k, v in iteritems(idempotent_exc):
if k == "changed":
self.assertFalse(idempotent_exc[k])
@@ -158,7 +158,7 @@ class TestPritunlOrg(ModuleTestCase):
idempotent_exc = idempotent_result.exception.args[0]
# Ensure both calls resulted in the same returned value
# except for changed which sould be false the second time
# except for changed which should be false the second time
self.assertFalse(idempotent_exc["changed"])
self.assertEqual(idempotent_exc["response"], delete_exc["response"])

View File

@@ -3309,7 +3309,7 @@ def test_gsm_connection_unchanged(mocked_gsm_connection_unchanged, capfd):
@pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_MULTIPLE_IP4_ADDRESSES, indirect=['patch_ansible_module'])
def test_create_ethernet_with_mulitple_ip4_addresses_static(mocked_generic_connection_create, capfd):
def test_create_ethernet_with_multiple_ip4_addresses_static(mocked_generic_connection_create, capfd):
"""
Test : Create ethernet connection with static IP configuration
"""
@@ -3349,7 +3349,7 @@ def test_create_ethernet_with_mulitple_ip4_addresses_static(mocked_generic_conne
@pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_MULTIPLE_IP6_ADDRESSES, indirect=['patch_ansible_module'])
def test_create_ethernet_with_mulitple_ip6_addresses_static(mocked_generic_connection_create, capfd):
def test_create_ethernet_with_multiple_ip6_addresses_static(mocked_generic_connection_create, capfd):
"""
Test : Create ethernet connection with multiple IPv6 addresses configuration
"""
@@ -3389,7 +3389,7 @@ def test_create_ethernet_with_mulitple_ip6_addresses_static(mocked_generic_conne
@pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_MULTIPLE_IP4_ADDRESSES, indirect=['patch_ansible_module'])
def test_ethernet_connection_static_with_mulitple_ip4_addresses_unchanged(mocked_ethernet_connection_static_multiple_ip4_addresses_unchanged, capfd):
def test_ethernet_connection_static_with_multiple_ip4_addresses_unchanged(mocked_ethernet_connection_static_multiple_ip4_addresses_unchanged, capfd):
"""
Test : Ethernet connection with static IP configuration unchanged
"""
@@ -3403,7 +3403,7 @@ def test_ethernet_connection_static_with_mulitple_ip4_addresses_unchanged(mocked
@pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_MULTIPLE_IP6_ADDRESSES, indirect=['patch_ansible_module'])
def test_ethernet_connection_static_with_mulitple_ip6_addresses_unchanged(mocked_ethernet_connection_static_multiple_ip6_addresses_unchanged, capfd):
def test_ethernet_connection_static_with_multiple_ip6_addresses_unchanged(mocked_ethernet_connection_static_multiple_ip6_addresses_unchanged, capfd):
"""
Test : Ethernet connection with multiple IPv6 addresses configuration unchanged
"""
@@ -3485,7 +3485,7 @@ def test_create_ethernet_addr_gen_mode_and_ip6_privacy_static(mocked_generic_con
@pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_IP6_PRIVACY_AND_ADDR_GEN_MODE, indirect=['patch_ansible_module'])
def test_ethernet_connection_static_with_mulitple_ip4_addresses_unchanged(mocked_ethernet_connection_static_ip6_privacy_and_addr_gen_mode_unchange, capfd):
def test_ethernet_connection_static_with_multiple_ip4_addresses_unchanged(mocked_ethernet_connection_static_ip6_privacy_and_addr_gen_mode_unchange, capfd):
"""
Test : Ethernet connection with static IP configuration unchanged
"""

View File

@@ -37,7 +37,7 @@ class TestSlackModule(ModuleTestCase):
with self.assertRaises(AnsibleFailJson):
self.module.main()
def test_sucessful_message(self):
def test_successful_message(self):
"""tests sending a message. This is example 1 from the docs"""
set_module_args({
'token': 'XXXX/YYYY/ZZZZ',

View File

@@ -19,7 +19,7 @@ TESTED_MODULE = cpanm.__name__
@pytest.fixture
def patch_cpanm(mocker):
"""
Function used for mocking some parts of redhat_subscribtion module
Function used for mocking some parts of redhat_subscription module
"""
mocker.patch('ansible_collections.community.general.plugins.module_utils.module_helper.AnsibleModule.get_bin_path',
return_value='/testbin/cpanm')

View File

@@ -3,7 +3,7 @@
## Tests structure
- `input` directory contains interfaces configuration files
- `test_interfaces_file.py` runs each hardcoded test agains all configurations in `input` directory and compares results with golden outputs in `golden_output`
- `test_interfaces_file.py` runs each hardcoded test against all configurations in `input` directory and compares results with golden outputs in `golden_output`
## Running unit tests with docker

View File

@@ -17,7 +17,7 @@ TESTED_MODULE = gconftool2_info.__name__
@pytest.fixture
def patch_gconftool2_info(mocker):
"""
Function used for mocking some parts of redhat_subscribtion module
Function used for mocking some parts of redhat_subscription module
"""
mocker.patch('ansible_collections.community.general.plugins.module_utils.mh.module_helper.AnsibleModule.get_bin_path',
return_value='/testbin/gconftool-2')

View File

@@ -19,7 +19,7 @@ TESTED_MODULE = xfconf.__name__
@pytest.fixture
def patch_xfconf(mocker):
"""
Function used for mocking some parts of redhat_subscribtion module
Function used for mocking some parts of redhat_subscription module
"""
mocker.patch('ansible_collections.community.general.plugins.module_utils.mh.module_helper.AnsibleModule.get_bin_path',
return_value='/testbin/xfconf-query')

View File

@@ -16,7 +16,7 @@ TESTED_MODULE = xfconf_info.__name__
@pytest.fixture
def patch_xfconf_info(mocker):
"""
Function used for mocking some parts of redhat_subscribtion module
Function used for mocking some parts of redhat_subscription module
"""
mocker.patch('ansible_collections.community.general.plugins.module_utils.mh.module_helper.AnsibleModule.get_bin_path',
return_value='/testbin/xfconf-query')