[PR #9421/2a2a9661 backport][stable-10] [ab]*.py: normalize docs (#9427)

[ab]*.py: normalize docs (#9421)

* [ab]*.py: normalize docs

* Update plugins/modules/atomic_image.py

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

---------

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
pull/9434/head
patchback[bot] 2024-12-27 14:52:29 +01:00 committed by GitHub
parent 3db0a11148
commit 14038511a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 1931 additions and 2013 deletions

View File

@ -9,15 +9,13 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: aerospike_migrations module: aerospike_migrations
short_description: Check or wait for migrations between nodes short_description: Check or wait for migrations between nodes
description: description:
- This can be used to check for migrations in a cluster. - This can be used to check for migrations in a cluster. This makes it easy to do a rolling upgrade/update on Aerospike
This makes it easy to do a rolling upgrade/update on Aerospike nodes. nodes.
- If waiting for migrations is not desired, simply just poll until - If waiting for migrations is not desired, simply just poll until port 3000 if available or C(asinfo -v status) returns ok.
port 3000 if available or asinfo -v status returns ok
author: "Albert Autin (@Alb0t)" author: "Albert Autin (@Alb0t)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -27,92 +25,84 @@ attributes:
diff_mode: diff_mode:
support: none support: none
options: options:
host: host:
description: description:
- Which host do we use as seed for info connection - Which host do we use as seed for info connection.
required: false required: false
type: str type: str
default: localhost default: localhost
port: port:
description: description:
- Which port to connect to Aerospike on (service port) - Which port to connect to Aerospike on (service port).
required: false required: false
type: int type: int
default: 3000 default: 3000
connect_timeout: connect_timeout:
description: description:
- How long to try to connect before giving up (milliseconds) - How long to try to connect before giving up (milliseconds).
required: false required: false
type: int type: int
default: 1000 default: 1000
consecutive_good_checks: consecutive_good_checks:
description: description:
- How many times should the cluster report "no migrations" - How many times should the cluster report "no migrations" consecutively before returning OK back to ansible?
consecutively before returning OK back to ansible? required: false
required: false type: int
type: int default: 3
default: 3 sleep_between_checks:
sleep_between_checks: description:
description: - How long to sleep between each check (seconds).
- How long to sleep between each check (seconds). required: false
required: false type: int
type: int default: 60
default: 60 tries_limit:
tries_limit: description:
description: - How many times do we poll before giving up and failing?
- How many times do we poll before giving up and failing? default: 300
default: 300 required: false
required: false type: int
type: int local_only:
local_only: description:
description: - Do you wish to only check for migrations on the local node before returning, or do you want all nodes in the cluster
- Do you wish to only check for migrations on the local node to finish before returning?
before returning, or do you want all nodes in the cluster required: true
to finish before returning? type: bool
required: true min_cluster_size:
type: bool description:
min_cluster_size: - Check will return bad until cluster size is met or until tries is exhausted.
description: required: false
- Check will return bad until cluster size is met type: int
or until tries is exhausted default: 1
required: false fail_on_cluster_change:
type: int description:
default: 1 - Fail if the cluster key changes if something else is changing the cluster, we may want to fail.
fail_on_cluster_change: required: false
description: type: bool
- Fail if the cluster key changes default: true
if something else is changing the cluster, we may want to fail migrate_tx_key:
required: false description:
type: bool - The metric key used to determine if we have tx migrations remaining. Changeable due to backwards compatibility.
default: true required: false
migrate_tx_key: type: str
description: default: migrate_tx_partitions_remaining
- The metric key used to determine if we have tx migrations migrate_rx_key:
remaining. Changeable due to backwards compatibility. description:
required: false - The metric key used to determine if we have rx migrations remaining. Changeable due to backwards compatibility.
type: str required: false
default: migrate_tx_partitions_remaining type: str
migrate_rx_key: default: migrate_rx_partitions_remaining
description: target_cluster_size:
- The metric key used to determine if we have rx migrations description:
remaining. Changeable due to backwards compatibility. - When all aerospike builds in the cluster are greater than version 4.3, then the C(cluster-stable) info command will
required: false be used. Inside this command, you can optionally specify what the target cluster size is - but it is not necessary.
type: str You can still rely on O(min_cluster_size) if you do not want to use this option.
default: migrate_rx_partitions_remaining - If this option is specified on a cluster that has at least one host <4.3 then it will be ignored until the min version
target_cluster_size: reaches 4.3.
description: required: false
- When all aerospike builds in the cluster are greater than type: int
version 4.3, then the C(cluster-stable) info command will be used. """
Inside this command, you can optionally specify what the target
cluster size is - but it is not necessary. You can still rely on EXAMPLES = r"""
min_cluster_size if you don't want to use this option.
- If this option is specified on a cluster that has at least 1
host <4.3 then it will be ignored until the min version reaches
4.3.
required: false
type: int
'''
EXAMPLES = '''
# check for migrations on local node # check for migrations on local node
- name: Wait for migrations on local node before proceeding - name: Wait for migrations on local node before proceeding
community.general.aerospike_migrations: community.general.aerospike_migrations:
@ -132,13 +122,13 @@ EXAMPLES = '''
- name: Install dependencies - name: Install dependencies
ansible.builtin.apt: ansible.builtin.apt:
name: name:
- python - python
- python-pip - python-pip
- python-setuptools - python-setuptools
state: latest state: latest
- name: Setup aerospike - name: Setup aerospike
ansible.builtin.pip: ansible.builtin.pip:
name: aerospike name: aerospike
# check for migrations every (sleep_between_checks) # check for migrations every (sleep_between_checks)
# If at least (consecutive_good_checks) checks come back OK in a row, then return OK. # If at least (consecutive_good_checks) checks come back OK in a row, then return OK.
# Will exit if any exception, which can be caused by bad nodes, # Will exit if any exception, which can be caused by bad nodes,
@ -147,13 +137,13 @@ EXAMPLES = '''
# Tries Limit * Sleep Between Checks * delay * retries # Tries Limit * Sleep Between Checks * delay * retries
- name: Wait for aerospike migrations - name: Wait for aerospike migrations
community.general.aerospike_migrations: community.general.aerospike_migrations:
local_only: true local_only: true
sleep_between_checks: 1 sleep_between_checks: 1
tries_limit: 5 tries_limit: 5
consecutive_good_checks: 3 consecutive_good_checks: 3
fail_on_cluster_change: true fail_on_cluster_change: true
min_cluster_size: 3 min_cluster_size: 3
target_cluster_size: 4 target_cluster_size: 4
register: migrations_check register: migrations_check
until: migrations_check is succeeded until: migrations_check is succeeded
changed_when: false changed_when: false
@ -161,14 +151,14 @@ EXAMPLES = '''
retries: 120 retries: 120
- name: Another thing - name: Another thing
ansible.builtin.shell: | ansible.builtin.shell: |
echo foo echo foo
- name: Reboot - name: Reboot
ansible.builtin.reboot: ansible.builtin.reboot:
''' """
RETURN = ''' RETURN = r"""
# Returns only a success/failure result. Changed is always false. # Returns only a success/failure result. Changed is always false.
''' """
import traceback import traceback

View File

@ -9,15 +9,14 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: airbrake_deployment module: airbrake_deployment
author: author:
- "Bruce Pennypacker (@bpennypacker)" - "Bruce Pennypacker (@bpennypacker)"
- "Patrick Humpal (@phumpal)" - "Patrick Humpal (@phumpal)"
short_description: Notify airbrake about app deployments short_description: Notify airbrake about app deployments
description: description:
- Notify airbrake about app deployments (see U(https://airbrake.io/docs/api/#deploys-v4)). - Notify airbrake about app deployments (see U(https://airbrake.io/docs/api/#deploys-v4)).
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -28,7 +27,7 @@ attributes:
options: options:
project_id: project_id:
description: description:
- Airbrake PROJECT_ID - Airbrake PROJECT_ID.
required: true required: true
type: str type: str
version_added: '0.2.0' version_added: '0.2.0'
@ -40,27 +39,27 @@ options:
version_added: '0.2.0' version_added: '0.2.0'
environment: environment:
description: description:
- The airbrake environment name, typically 'production', 'staging', etc. - The airbrake environment name, typically v(production), V(staging), and so on.
required: true required: true
type: str type: str
user: user:
description: description:
- The username of the person doing the deployment - The username of the person doing the deployment.
required: false required: false
type: str type: str
repo: repo:
description: description:
- URL of the project repository - URL of the project repository.
required: false required: false
type: str type: str
revision: revision:
description: description:
- A hash, number, tag, or other identifier showing what revision from version control was deployed - A hash, number, tag, or other identifier showing what revision from version control was deployed.
required: false required: false
type: str type: str
version: version:
description: description:
- A string identifying what version was deployed - A string identifying what version was deployed.
required: false required: false
type: str type: str
version_added: '1.0.0' version_added: '1.0.0'
@ -72,16 +71,16 @@ options:
type: str type: str
validate_certs: validate_certs:
description: description:
- If V(false), SSL certificates for the target url will not be validated. This should only be used - If V(false), SSL certificates for the target url will not be validated. This should only be used on personally controlled
on personally controlled sites using self-signed certificates. sites using self-signed certificates.
required: false required: false
default: true default: true
type: bool type: bool
requirements: [] requirements: []
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Notify airbrake about an app deployment - name: Notify airbrake about an app deployment
community.general.airbrake_deployment: community.general.airbrake_deployment:
project_id: '12345' project_id: '12345'
@ -98,7 +97,7 @@ EXAMPLES = '''
user: ansible user: ansible
revision: 'e54dd3a01f2c421b558ef33b5f79db936e2dcf15' revision: 'e54dd3a01f2c421b558ef33b5f79db936e2dcf15'
version: '0.2.0' version: '0.2.0'
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import fetch_url from ansible.module_utils.urls import fetch_url

View File

@ -8,14 +8,13 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
author: author:
- Kairo Araujo (@kairoaraujo) - Kairo Araujo (@kairoaraujo)
module: aix_devices module: aix_devices
short_description: Manages AIX devices short_description: Manages AIX devices
description: description:
- This module discovers, defines, removes and modifies attributes of AIX devices. - This module discovers, defines, removes and modifies attributes of AIX devices.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -26,35 +25,35 @@ attributes:
options: options:
attributes: attributes:
description: description:
- A list of device attributes. - A list of device attributes.
type: dict type: dict
device: device:
description: description:
- The name of the device. - The name of the device.
- V(all) is valid to rescan C(available) all devices (AIX cfgmgr command). - V(all) is valid to rescan C(available) all devices (AIX C(cfgmgr) command).
type: str type: str
force: force:
description: description:
- Forces action. - Forces action.
type: bool type: bool
default: false default: false
recursive: recursive:
description: description:
- Removes or defines a device and children devices. - Removes or defines a device and children devices.
type: bool type: bool
default: false default: false
state: state:
description: description:
- Controls the device state. - Controls the device state.
- V(available) (alias V(present)) rescan a specific device or all devices (when O(device) is not specified). - V(available) (alias V(present)) rescan a specific device or all devices (when O(device) is not specified).
- V(removed) (alias V(absent) removes a device. - V(removed) (alias V(absent) removes a device.
- V(defined) changes device to Defined state. - V(defined) changes device to Defined state.
type: str type: str
choices: [ available, defined, removed ] choices: [available, defined, removed]
default: available default: available
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Scan new devices - name: Scan new devices
community.general.aix_devices: community.general.aix_devices:
device: all device: all
@ -126,9 +125,9 @@ EXAMPLES = r'''
attributes: attributes:
alias4: 10.0.0.100,255.255.255.0 alias4: 10.0.0.100,255.255.255.0
state: available state: available
''' """
RETURN = r''' # ''' RETURN = r""" # """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,15 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
author: author:
- Kairo Araujo (@kairoaraujo) - Kairo Araujo (@kairoaraujo)
module: aix_filesystem module: aix_filesystem
short_description: Configure LVM and NFS file systems for AIX short_description: Configure LVM and NFS file systems for AIX
description: description:
- This module creates, removes, mount and unmount LVM and NFS file system for - This module creates, removes, mount and unmount LVM and NFS file system for AIX using C(/etc/filesystems).
AIX using C(/etc/filesystems).
- For LVM file systems is possible to resize a file system. - For LVM file systems is possible to resize a file system.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -60,7 +58,7 @@ options:
description: description:
- Set file system permissions. V(rw) (read-write) or V(ro) (read-only). - Set file system permissions. V(rw) (read-write) or V(ro) (read-only).
type: str type: str
choices: [ ro, rw ] choices: [ro, rw]
default: rw default: rw
mount_group: mount_group:
description: description:
@ -84,9 +82,8 @@ options:
description: description:
- Specifies the file system size. - Specifies the file system size.
- For already V(present) it will be resized. - For already V(present) it will be resized.
- 512-byte blocks, Megabytes or Gigabytes. If the value has M specified - 512-byte blocks, Megabytes or Gigabytes. If the value has M specified it will be in Megabytes. If the value has G
it will be in Megabytes. If the value has G specified it will be in specified it will be in Gigabytes.
Gigabytes.
- If no M or G the value will be 512-byte blocks. - If no M or G the value will be 512-byte blocks.
- If "+" is specified in begin of value, the value will be added. - If "+" is specified in begin of value, the value will be added.
- If "-" is specified in begin of value, the value will be removed. - If "-" is specified in begin of value, the value will be removed.
@ -101,7 +98,7 @@ options:
- V(mounted) checks if the file system is mounted or mount the file system. - V(mounted) checks if the file system is mounted or mount the file system.
- V(unmounted) check if the file system is unmounted or unmount the file system. - V(unmounted) check if the file system is unmounted or unmount the file system.
type: str type: str
choices: [ absent, mounted, present, unmounted ] choices: [absent, mounted, present, unmounted]
default: present default: present
vg: vg:
description: description:
@ -109,9 +106,9 @@ options:
type: str type: str
notes: notes:
- For more O(attributes), please check "crfs" AIX manual. - For more O(attributes), please check "crfs" AIX manual.
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create filesystem in a previously defined logical volume. - name: Create filesystem in a previously defined logical volume.
community.general.aix_filesystem: community.general.aix_filesystem:
device: testlv device: testlv
@ -166,9 +163,9 @@ EXAMPLES = r'''
filesystem: /newfs filesystem: /newfs
rm_mount_point: true rm_mount_point: true
state: absent state: absent
''' """
RETURN = r''' RETURN = r"""
changed: changed:
description: Return changed for aix_filesystems actions as true or false. description: Return changed for aix_filesystems actions as true or false.
returned: always returned: always
@ -177,7 +174,7 @@ msg:
description: Return message regarding the action. description: Return message regarding the action.
returned: always returned: always
type: str type: str
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._mount import ismount from ansible_collections.community.general.plugins.module_utils._mount import ismount

View File

@ -8,16 +8,15 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
author: author:
- Joris Weijters (@molekuul) - Joris Weijters (@molekuul)
module: aix_inittab module: aix_inittab
short_description: Manages the inittab on AIX short_description: Manages the C(inittab) on AIX
description: description:
- Manages the inittab on AIX. - Manages the C(inittab) on AIX.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -26,56 +25,56 @@ attributes:
options: options:
name: name:
description: description:
- Name of the inittab entry. - Name of the C(inittab) entry.
type: str type: str
required: true required: true
aliases: [ service ] aliases: [service]
runlevel: runlevel:
description: description:
- Runlevel of the entry. - Runlevel of the entry.
type: str type: str
required: true required: true
action: action:
description: description:
- Action what the init has to do with this entry. - Action what the init has to do with this entry.
type: str type: str
choices: choices:
- boot - boot
- bootwait - bootwait
- hold - hold
- initdefault - initdefault
- 'off' - 'off'
- once - once
- ondemand - ondemand
- powerfail - powerfail
- powerwait - powerwait
- respawn - respawn
- sysinit - sysinit
- wait - wait
command: command:
description: description:
- What command has to run. - What command has to run.
type: str type: str
required: true required: true
insertafter: insertafter:
description: description:
- After which inittabline should the new entry inserted. - After which inittabline should the new entry inserted.
type: str type: str
state: state:
description: description:
- Whether the entry should be present or absent in the inittab file. - Whether the entry should be present or absent in the inittab file.
type: str type: str
choices: [ absent, present ] choices: [absent, present]
default: present default: present
notes: notes:
- The changes are persistent across reboots. - The changes are persistent across reboots.
- You need root rights to read or adjust the inittab with the C(lsitab), C(chitab), C(mkitab) or C(rmitab) commands. - You need root rights to read or adjust the inittab with the C(lsitab), C(chitab), C(mkitab) or C(rmitab) commands.
- Tested on AIX 7.1. - Tested on AIX 7.1.
requirements: requirements:
- itertools - itertools
''' """
EXAMPLES = ''' EXAMPLES = r"""
# Add service startmyservice to the inittab, directly after service existingservice. # Add service startmyservice to the inittab, directly after service existingservice.
- name: Add startmyservice to inittab - name: Add startmyservice to inittab
community.general.aix_inittab: community.general.aix_inittab:
@ -105,25 +104,25 @@ EXAMPLES = '''
command: echo hello command: echo hello
state: absent state: absent
become: true become: true
''' """
RETURN = ''' RETURN = r"""
name: name:
description: Name of the adjusted inittab entry description: Name of the adjusted C(inittab) entry.
returned: always returned: always
type: str type: str
sample: startmyservice sample: startmyservice
msg: msg:
description: Action done with the inittab entry description: Action done with the C(inittab) entry.
returned: changed returned: changed
type: str type: str
sample: changed inittab entry startmyservice sample: changed inittab entry startmyservice
changed: changed:
description: Whether the inittab changed or not description: Whether the C(inittab) changed or not.
returned: always returned: always
type: bool type: bool
sample: true sample: true
''' """
# Import necessary libraries # Import necessary libraries
try: try:

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
author: author:
- Kairo Araujo (@kairoaraujo) - Kairo Araujo (@kairoaraujo)
module: aix_lvg module: aix_lvg
@ -26,43 +25,43 @@ attributes:
options: options:
force: force:
description: description:
- Force volume group creation. - Force volume group creation.
type: bool type: bool
default: false default: false
pp_size: pp_size:
description: description:
- The size of the physical partition in megabytes. - The size of the physical partition in megabytes.
type: int type: int
pvs: pvs:
description: description:
- List of comma-separated devices to use as physical devices in this volume group. - List of comma-separated devices to use as physical devices in this volume group.
- Required when creating or extending (V(present) state) the volume group. - Required when creating or extending (V(present) state) the volume group.
- If not informed reducing (V(absent) state) the volume group will be removed. - If not informed reducing (V(absent) state) the volume group will be removed.
type: list type: list
elements: str elements: str
state: state:
description: description:
- Control if the volume group exists and volume group AIX state varyonvg V(varyon) or varyoffvg V(varyoff). - Control if the volume group exists and volume group AIX state varyonvg V(varyon) or varyoffvg V(varyoff).
type: str type: str
choices: [ absent, present, varyoff, varyon ] choices: [absent, present, varyoff, varyon]
default: present default: present
vg: vg:
description: description:
- The name of the volume group. - The name of the volume group.
type: str type: str
required: true required: true
vg_type: vg_type:
description: description:
- The type of the volume group. - The type of the volume group.
type: str type: str
choices: [ big, normal, scalable ] choices: [big, normal, scalable]
default: normal default: normal
notes: notes:
- AIX will permit remove VG only if all LV/Filesystems are not busy. - AIX will permit remove VG only if all LV/Filesystems are not busy.
- Module does not modify PP size for already present volume group. - Module does not modify PP size for already present volume group.
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create a volume group datavg - name: Create a volume group datavg
community.general.aix_lvg: community.general.aix_lvg:
vg: datavg vg: datavg
@ -86,9 +85,9 @@ EXAMPLES = r'''
vg: rootvg vg: rootvg
pvs: hdisk1 pvs: hdisk1
state: absent state: absent
''' """
RETURN = r''' # ''' RETURN = r""" # """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,10 +9,9 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
author: author:
- Alain Dejoux (@adejoux) - Alain Dejoux (@adejoux)
module: aix_lvol module: aix_lvol
short_description: Configure AIX LVM logical volumes short_description: Configure AIX LVM logical volumes
description: description:
@ -27,58 +26,58 @@ attributes:
options: options:
vg: vg:
description: description:
- The volume group this logical volume is part of. - The volume group this logical volume is part of.
type: str type: str
required: true required: true
lv: lv:
description: description:
- The name of the logical volume. - The name of the logical volume.
type: str type: str
required: true required: true
lv_type: lv_type:
description: description:
- The type of the logical volume. - The type of the logical volume.
type: str type: str
default: jfs2 default: jfs2
size: size:
description: description:
- The size of the logical volume with one of the [MGT] units. - The size of the logical volume with one of the [MGT] units.
type: str type: str
copies: copies:
description: description:
- The number of copies of the logical volume. - The number of copies of the logical volume.
- Maximum copies are 3. - Maximum copies are 3.
type: int type: int
default: 1 default: 1
policy: policy:
description: description:
- Sets the interphysical volume allocation policy. - Sets the interphysical volume allocation policy.
- V(maximum) allocates logical partitions across the maximum number of physical volumes. - V(maximum) allocates logical partitions across the maximum number of physical volumes.
- V(minimum) allocates logical partitions across the minimum number of physical volumes. - V(minimum) allocates logical partitions across the minimum number of physical volumes.
type: str type: str
choices: [ maximum, minimum ] choices: [maximum, minimum]
default: maximum default: maximum
state: state:
description: description:
- Control if the logical volume exists. If V(present) and the - Control if the logical volume exists. If V(present) and the volume does not already exist then the O(size) option
volume does not already exist then the O(size) option is required. is required.
type: str type: str
choices: [ absent, present ] choices: [absent, present]
default: present default: present
opts: opts:
description: description:
- Free-form options to be passed to the mklv command. - Free-form options to be passed to the mklv command.
type: str type: str
default: '' default: ''
pvs: pvs:
description: description:
- A list of physical volumes, for example V(hdisk1,hdisk2). - A list of physical volumes, for example V(hdisk1,hdisk2).
type: list type: list
elements: str elements: str
default: [] default: []
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create a logical volume of 512M - name: Create a logical volume of 512M
community.general.aix_lvol: community.general.aix_lvol:
vg: testvg vg: testvg
@ -90,7 +89,7 @@ EXAMPLES = r'''
vg: testvg vg: testvg
lv: test2lv lv: test2lv
size: 512M size: 512M
pvs: [ hdisk1, hdisk2 ] pvs: [hdisk1, hdisk2]
- name: Create a logical volume of 512M mirrored - name: Create a logical volume of 512M mirrored
community.general.aix_lvol: community.general.aix_lvol:
@ -124,15 +123,15 @@ EXAMPLES = r'''
vg: testvg vg: testvg
lv: testlv lv: testlv
state: absent state: absent
''' """
RETURN = r''' RETURN = r"""
msg: msg:
type: str type: str
description: A friendly message describing the task result. description: A friendly message describing the task result.
returned: always returned: always
sample: Logical volume testlv created. sample: Logical volume testlv created.
''' """
import re import re

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: alerta_customer module: alerta_customer
short_description: Manage customers in Alerta short_description: Manage customers in Alerta
version_added: 4.8.0 version_added: 4.8.0
@ -18,7 +17,7 @@ description:
author: Christian Wollinger (@cwollinger) author: Christian Wollinger (@cwollinger)
seealso: seealso:
- name: API documentation - name: API documentation
description: Documentation for Alerta API description: Documentation for Alerta API.
link: https://docs.alerta.io/api/reference.html#customers link: https://docs.alerta.io/api/reference.html#customers
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -60,11 +59,11 @@ options:
- Whether the customer should exist or not. - Whether the customer should exist or not.
- Both O(customer) and O(match) identify a customer that should be added or removed. - Both O(customer) and O(match) identify a customer that should be added or removed.
type: str type: str
choices: [ absent, present ] choices: [absent, present]
default: present default: present
''' """
EXAMPLES = """ EXAMPLES = r"""
- name: Create customer - name: Create customer
community.general.alerta_customer: community.general.alerta_customer:
alerta_url: https://alerta.example.com alerta_url: https://alerta.example.com
@ -83,7 +82,7 @@ EXAMPLES = """
state: absent state: absent
""" """
RETURN = """ RETURN = r"""
msg: msg:
description: description:
- Success or failure message. - Success or failure message.

File diff suppressed because it is too large Load Diff

View File

@ -24,51 +24,48 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: ali_instance_info module: ali_instance_info
short_description: Gather information on instances of Alibaba Cloud ECS short_description: Gather information on instances of Alibaba Cloud ECS
description: description:
- This module fetches data from the Open API in Alicloud. - This module fetches data from the Open API in Alicloud. The module must be called from within the ECS instance itself.
The module must be called from within the ECS instance itself.
attributes: attributes:
check_mode: check_mode:
version_added: 3.3.0 version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix # This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
options: options:
name_prefix: name_prefix:
description: description:
- Use a instance name prefix to filter ecs instances. - Use a instance name prefix to filter ECS instances.
type: str type: str
version_added: '0.2.0' version_added: '0.2.0'
tags: tags:
description: description:
- A hash/dictionaries of instance tags. C({"key":"value"}) - A hash/dictionaries of instance tags. C({"key":"value"}).
aliases: ["instance_tags"] aliases: ["instance_tags"]
type: dict type: dict
filters: filters:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. The filter keys can be - A dict of filters to apply. Each dict item consists of a filter key and a filter value. The filter keys can be all
all of request parameters. See U(https://www.alibabacloud.com/help/doc-detail/25506.htm) for parameter details. of request parameters. See U(https://www.alibabacloud.com/help/doc-detail/25506.htm) for parameter details. Filter
Filter keys can be same as request parameter name or be lower case and use underscore (V("_")) or dash (V("-")) to keys can be same as request parameter name or be lower case and use underscore (V("_")) or dash (V("-")) to connect
connect different words in one parameter. C(InstanceIds) should be a list. different words in one parameter. C(InstanceIds) should be a list. C(Tag.n.Key) and C(Tag.n.Value) should be a dict
C(Tag.n.Key) and C(Tag.n.Value) should be a dict and using O(tags) instead. and using O(tags) instead.
type: dict type: dict
version_added: '0.2.0' version_added: '0.2.0'
author: author:
- "He Guimin (@xiaozhu36)" - "He Guimin (@xiaozhu36)"
requirements: requirements:
- "Python >= 3.6" - "Python >= 3.6"
- "footmark >= 1.13.0" - "footmark >= 1.13.0"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.alicloud - community.general.alicloud
- community.general.attributes - community.general.attributes
- community.general.attributes.info_module - community.general.attributes.info_module
''' """
EXAMPLES = ''' EXAMPLES = r"""
# Fetch instances details according to setting different filters # Fetch instances details according to setting different filters
- name: Find all instances in the specified region - name: Find all instances in the specified region
@ -91,261 +88,261 @@ EXAMPLES = '''
community.general.ali_instance_info: community.general.ali_instance_info:
tags: tags:
Test: "add" Test: "add"
''' """
RETURN = ''' RETURN = r"""
instances: instances:
description: List of ECS instances description: List of ECS instances.
returned: always returned: always
type: complex type: complex
contains: contains:
availability_zone: availability_zone:
description: The availability zone of the instance is in. description: The availability zone of the instance is in.
returned: always returned: always
type: str type: str
sample: cn-beijing-a sample: cn-beijing-a
block_device_mappings: block_device_mappings:
description: Any block device mapping entries for the instance. description: Any block device mapping entries for the instance.
returned: always returned: always
type: complex type: complex
contains: contains:
device_name: device_name:
description: The device name exposed to the instance (for example, /dev/xvda). description: The device name exposed to the instance (for example, /dev/xvda).
returned: always returned: always
type: str type: str
sample: /dev/xvda sample: /dev/xvda
attach_time: attach_time:
description: The time stamp when the attachment initiated. description: The time stamp when the attachment initiated.
returned: always returned: always
type: str type: str
sample: "2018-06-25T04:08:26Z" sample: "2018-06-25T04:08:26Z"
delete_on_termination: delete_on_termination:
description: Indicates whether the volume is deleted on instance termination. description: Indicates whether the volume is deleted on instance termination.
returned: always returned: always
type: bool type: bool
sample: true sample: true
status:
description: The attachment state.
returned: always
type: str
sample: in_use
volume_id:
description: The ID of the cloud disk.
returned: always
type: str
sample: d-2zei53pjsi117y6gf9t6
cpu:
description: The CPU core count of the instance.
returned: always
type: int
sample: 4
creation_time:
description: The time the instance was created.
returned: always
type: str
sample: "2018-06-25T04:08Z"
description:
description: The instance description.
returned: always
type: str
sample: "my ansible instance"
eip:
description: The attribution of EIP associated with the instance.
returned: always
type: complex
contains:
allocation_id:
description: The ID of the EIP.
returned: always
type: str
sample: eip-12345
internet_charge_type:
description: The internet charge type of the EIP.
returned: always
type: str
sample: "paybybandwidth"
ip_address:
description: EIP address.
returned: always
type: str
sample: 42.10.2.2
expired_time:
description: The time the instance will expire.
returned: always
type: str
sample: "2099-12-31T15:59Z"
gpu:
description: The attribution of instance GPU.
returned: always
type: complex
contains:
amount:
description: The count of the GPU.
returned: always
type: int
sample: 0
spec:
description: The specification of the GPU.
returned: always
type: str
sample: ""
host_name:
description: The host name of the instance.
returned: always
type: str
sample: iZ2zewaoZ
id:
description: Alias of instance_id.
returned: always
type: str
sample: i-abc12345
instance_id:
description: ECS instance resource ID.
returned: always
type: str
sample: i-abc12345
image_id:
description: The ID of the image used to launch the instance.
returned: always
type: str
sample: m-0011223344
inner_ip_address:
description: The inner IPv4 address of the classic instance.
returned: always
type: str
sample: 10.0.0.2
instance_charge_type:
description: The instance charge type.
returned: always
type: str
sample: PostPaid
instance_name:
description: The name of the instance.
returned: always
type: str
sample: my-ecs
instance_type_family:
description: The instance type family of the instance belongs.
returned: always
type: str
sample: ecs.sn1ne
instance_type:
description: The instance type of the running instance.
returned: always
type: str
sample: ecs.sn1ne.xlarge
internet_charge_type:
description: The billing method of the network bandwidth.
returned: always
type: str
sample: PayByBandwidth
internet_max_bandwidth_in:
description: Maximum incoming bandwidth from the internet network.
returned: always
type: int
sample: 200
internet_max_bandwidth_out:
description: Maximum incoming bandwidth from the internet network.
returned: always
type: int
sample: 20
io_optimized:
description: Indicates whether the instance is optimized for EBS I/O.
returned: always
type: bool
sample: false
memory:
description: Memory size of the instance.
returned: always
type: int
sample: 8192
network_interfaces:
description: One or more network interfaces for the instance.
returned: always
type: complex
contains:
mac_address:
description: The MAC address.
returned: always
type: str
sample: "00:11:22:33:44:55"
network_interface_id:
description: The ID of the network interface.
returned: always
type: str
sample: eni-01234567
primary_ip_address:
description: The primary IPv4 address of the network interface within the vswitch.
returned: always
type: str
sample: 10.0.0.1
osname:
description: The operation system name of the instance owned.
returned: always
type: str
sample: CentOS
ostype:
description: The operation system type of the instance owned.
returned: always
type: str
sample: linux
private_ip_address:
description: The IPv4 address of the network interface within the subnet.
returned: always
type: str
sample: 10.0.0.1
public_ip_address:
description: The public IPv4 address assigned to the instance or eip address
returned: always
type: str
sample: 43.0.0.1
resource_group_id:
description: The id of the resource group to which the instance belongs.
returned: always
type: str
sample: my-ecs-group
security_groups:
description: One or more security groups for the instance.
returned: always
type: list
elements: dict
contains:
group_id:
description: The ID of the security group.
returned: always
type: str
sample: sg-0123456
group_name:
description: The name of the security group.
returned: always
type: str
sample: my-security-group
status: status:
description: The current status of the instance. description: The attachment state.
returned: always returned: always
type: str type: str
sample: running sample: in_use
tags: volume_id:
description: Any tags assigned to the instance. description: The ID of the cloud disk.
returned: always returned: always
type: dict type: str
sample: sample: d-2zei53pjsi117y6gf9t6
vswitch_id: cpu:
description: The ID of the vswitch in which the instance is running. description: The CPU core count of the instance.
returned: always returned: always
type: str type: int
sample: vsw-dew00abcdef sample: 4
vpc_id: creation_time:
description: The ID of the VPC the instance is in. description: The time the instance was created.
returned: always returned: always
type: str type: str
sample: vpc-0011223344 sample: "2018-06-25T04:08Z"
description:
description: The instance description.
returned: always
type: str
sample: "my ansible instance"
eip:
description: The attribution of EIP associated with the instance.
returned: always
type: complex
contains:
allocation_id:
description: The ID of the EIP.
returned: always
type: str
sample: eip-12345
internet_charge_type:
description: The internet charge type of the EIP.
returned: always
type: str
sample: "paybybandwidth"
ip_address:
description: EIP address.
returned: always
type: str
sample: 42.10.2.2
expired_time:
description: The time the instance will expire.
returned: always
type: str
sample: "2099-12-31T15:59Z"
gpu:
description: The attribution of instance GPU.
returned: always
type: complex
contains:
amount:
description: The count of the GPU.
returned: always
type: int
sample: 0
spec:
description: The specification of the GPU.
returned: always
type: str
sample: ""
host_name:
description: The host name of the instance.
returned: always
type: str
sample: iZ2zewaoZ
id:
description: Alias of instance_id.
returned: always
type: str
sample: i-abc12345
instance_id:
description: ECS instance resource ID.
returned: always
type: str
sample: i-abc12345
image_id:
description: The ID of the image used to launch the instance.
returned: always
type: str
sample: m-0011223344
inner_ip_address:
description: The inner IPv4 address of the classic instance.
returned: always
type: str
sample: 10.0.0.2
instance_charge_type:
description: The instance charge type.
returned: always
type: str
sample: PostPaid
instance_name:
description: The name of the instance.
returned: always
type: str
sample: my-ecs
instance_type_family:
description: The instance type family of the instance belongs.
returned: always
type: str
sample: ecs.sn1ne
instance_type:
description: The instance type of the running instance.
returned: always
type: str
sample: ecs.sn1ne.xlarge
internet_charge_type:
description: The billing method of the network bandwidth.
returned: always
type: str
sample: PayByBandwidth
internet_max_bandwidth_in:
description: Maximum incoming bandwidth from the internet network.
returned: always
type: int
sample: 200
internet_max_bandwidth_out:
description: Maximum incoming bandwidth from the internet network.
returned: always
type: int
sample: 20
io_optimized:
description: Indicates whether the instance is optimized for EBS I/O.
returned: always
type: bool
sample: false
memory:
description: Memory size of the instance.
returned: always
type: int
sample: 8192
network_interfaces:
description: One or more network interfaces for the instance.
returned: always
type: complex
contains:
mac_address:
description: The MAC address.
returned: always
type: str
sample: "00:11:22:33:44:55"
network_interface_id:
description: The ID of the network interface.
returned: always
type: str
sample: eni-01234567
primary_ip_address:
description: The primary IPv4 address of the network interface within the vswitch.
returned: always
type: str
sample: 10.0.0.1
osname:
description: The operation system name of the instance owned.
returned: always
type: str
sample: CentOS
ostype:
description: The operation system type of the instance owned.
returned: always
type: str
sample: linux
private_ip_address:
description: The IPv4 address of the network interface within the subnet.
returned: always
type: str
sample: 10.0.0.1
public_ip_address:
description: The public IPv4 address assigned to the instance or EIP address.
returned: always
type: str
sample: 43.0.0.1
resource_group_id:
description: The id of the resource group to which the instance belongs.
returned: always
type: str
sample: my-ecs-group
security_groups:
description: One or more security groups for the instance.
returned: always
type: list
elements: dict
contains:
group_id:
description: The ID of the security group.
returned: always
type: str
sample: sg-0123456
group_name:
description: The name of the security group.
returned: always
type: str
sample: my-security-group
status:
description: The current status of the instance.
returned: always
type: str
sample: running
tags:
description: Any tags assigned to the instance.
returned: always
type: dict
sample:
vswitch_id:
description: The ID of the vswitch in which the instance is running.
returned: always
type: str
sample: vsw-dew00abcdef
vpc_id:
description: The ID of the VPC the instance is in.
returned: always
type: str
sample: vpc-0011223344
ids: ids:
description: List of ECS instance IDs description: List of ECS instance IDs.
returned: always returned: always
type: list type: list
sample: [i-12345er, i-3245fs] sample: [i-12345er, i-3245fs]
''' """
from ansible.module_utils.basic import AnsibleModule, missing_required_lib from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible_collections.community.general.plugins.module_utils.alicloud_ecs import ( from ansible_collections.community.general.plugins.module_utils.alicloud_ecs import (

View File

@ -11,19 +11,18 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: alternatives module: alternatives
short_description: Manages alternative programs for common commands short_description: Manages alternative programs for common commands
description: description:
- Manages symbolic links using the 'update-alternatives' tool. - Manages symbolic links using the C(update-alternatives) tool.
- Useful when multiple programs are installed but provide similar functionality (e.g. different editors). - Useful when multiple programs are installed but provide similar functionality (for example, different editors).
author: author:
- Marius Rieder (@jiuka) - Marius Rieder (@jiuka)
- David Wittman (@DavidWittman) - David Wittman (@DavidWittman)
- Gabe Mulley (@mulby) - Gabe Mulley (@mulby)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -47,8 +46,8 @@ options:
link: link:
description: description:
- The path to the symbolic link that should point to the real executable. - The path to the symbolic link that should point to the real executable.
- This option is always required on RHEL-based distributions. On Debian-based distributions this option is - This option is always required on RHEL-based distributions. On Debian-based distributions this option is required
required when the alternative O(name) is unknown to the system. when the alternative O(name) is unknown to the system.
type: path type: path
priority: priority:
description: description:
@ -56,14 +55,14 @@ options:
type: int type: int
state: state:
description: description:
- V(present) - install the alternative (if not already installed), but do - V(present) - install the alternative (if not already installed), but do not set it as the currently selected alternative
not set it as the currently selected alternative for the group. for the group.
- V(selected) - install the alternative (if not already installed), and - V(selected) - install the alternative (if not already installed), and set it as the currently selected alternative
set it as the currently selected alternative for the group. for the group.
- V(auto) - install the alternative (if not already installed), and - V(auto) - install the alternative (if not already installed), and set the group to auto mode. Added in community.general
set the group to auto mode. Added in community.general 5.1.0. 5.1.0.
- V(absent) - removes the alternative. Added in community.general 5.1.0. - V(absent) - removes the alternative. Added in community.general 5.1.0.
choices: [ present, selected, auto, absent ] choices: [present, selected, auto, absent]
default: selected default: selected
type: str type: str
version_added: 4.8.0 version_added: 4.8.0
@ -71,8 +70,7 @@ options:
description: description:
- A list of subcommands. - A list of subcommands.
- Each subcommand needs a name, a link and a path parameter. - Each subcommand needs a name, a link and a path parameter.
- Subcommands are also named 'slaves' or 'followers', depending on the version - Subcommands are also named C(slaves) or C(followers), depending on the version of C(alternatives).
of alternatives.
type: list type: list
elements: dict elements: dict
aliases: ['slaves'] aliases: ['slaves']
@ -93,10 +91,10 @@ options:
type: path type: path
required: true required: true
version_added: 5.1.0 version_added: 5.1.0
requirements: [ update-alternatives ] requirements: [update-alternatives]
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Correct java version selected - name: Correct java version selected
community.general.alternatives: community.general.alternatives:
name: java name: java
@ -143,7 +141,7 @@ EXAMPLES = r'''
- name: keytool - name: keytool
link: /usr/bin/keytool link: /usr/bin/keytool
path: /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool path: /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool
''' """
import os import os
import re import re

View File

@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: android_sdk module: android_sdk
short_description: Manages Android SDK packages short_description: Manages Android SDK packages
description: description:
- Manages Android SDK packages. - Manages Android SDK packages.
- Allows installation from different channels (stable, beta, dev, canary). - Allows installation from different channels (stable, beta, dev, canary).
- Allows installation of packages to a non-default SDK root directory. - Allows installation of packages to a non-default SDK root directory.
author: Stanislav Shamilov (@shamilovstas) author: Stanislav Shamilov (@shamilovstas)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -29,8 +28,8 @@ version_added: 10.2.0
options: options:
accept_licenses: accept_licenses:
description: description:
- If this is set to B(true), the module will try to accept license prompts generated by C(sdkmanager) during - If this is set to V(true), the module will try to accept license prompts generated by C(sdkmanager) during package
package installation. Otherwise, every license prompt will be rejected. installation. Otherwise, every license prompt will be rejected.
type: bool type: bool
default: false default: false
name: name:
@ -50,8 +49,8 @@ options:
type: str type: str
sdk_root: sdk_root:
description: description:
- Provides path for an alternative directory to install Android SDK packages to. By default, all packages - Provides path for an alternative directory to install Android SDK packages to. By default, all packages are installed
are installed to the directory where C(sdkmanager) is installed. to the directory where C(sdkmanager) is installed.
type: path type: path
channel: channel:
description: description:
@ -63,27 +62,25 @@ requirements:
- C(java) >= 17 - C(java) >= 17
- C(sdkmanager) Command line tool for installing Android SDK packages. - C(sdkmanager) Command line tool for installing Android SDK packages.
notes: notes:
- For some of the packages installed by C(sdkmanager) is it necessary to accept licenses. Usually it is done through - For some of the packages installed by C(sdkmanager) is it necessary to accept licenses. Usually it is done through command
command line prompt in a form of a Y/N question when a licensed package is requested to be installed. If there are line prompt in a form of a Y/N question when a licensed package is requested to be installed. If there are several packages
several packages requested for installation and at least two of them belong to different licenses, the C(sdkmanager) requested for installation and at least two of them belong to different licenses, the C(sdkmanager) tool will prompt for
tool will prompt for these licenses in a loop. these licenses in a loop. In order to install packages, the module must be able to answer these license prompts. Currently,
In order to install packages, the module must be able to answer these license prompts. Currently, it is only it is only possible to answer one license prompt at a time, meaning that instead of installing multiple packages as a
possible to answer one license prompt at a time, meaning that instead of installing multiple packages as a single single invocation of the C(sdkmanager --install) command, it will be done by executing the command independently for each
invocation of the C(sdkmanager --install) command, it will be done by executing the command independently for each package. This makes sure that at most only one license prompt will need to be answered. At the time of writing this module,
package. This makes sure that at most only one license prompt will need to be answered. a C(sdkmanager)'s package may belong to at most one license type that needs to be accepted. However, if this changes
At the time of writing this module, a C(sdkmanager)'s package may belong to at most one license type that needs to in the future, the module may hang as there might be more prompts generated by the C(sdkmanager) tool which the module
be accepted. However, if this is changes in the future, the module may hang as there might be more prompts generated will not be able to answer. If this becomes the case, file an issue and in the meantime, consider accepting all the licenses
by the C(sdkmanager) tool which the module will not be able to answer. If this is the case, file an issue and in the in advance, as it is described in the C(sdkmanager) L(documentation,https://developer.android.com/tools/sdkmanager#accept-licenses),
meantime, consider accepting all the licenses in advance, as it is described in the C(sdkmanager) for instance, using the M(ansible.builtin.command) module.
L(documentation,https://developer.android.com/tools/sdkmanager#accept-licenses), for instance, using the
M(ansible.builtin.command) module.
seealso: seealso:
- name: sdkmanager tool documentation - name: sdkmanager tool documentation
description: Detailed information of how to install and use sdkmanager command line tool. description: Detailed information of how to install and use sdkmanager command line tool.
link: https://developer.android.com/tools/sdkmanager link: https://developer.android.com/tools/sdkmanager
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Install build-tools;34.0.0 - name: Install build-tools;34.0.0
community.general.android_sdk: community.general.android_sdk:
name: build-tools;34.0.0 name: build-tools;34.0.0
@ -122,21 +119,21 @@ EXAMPLES = r'''
accept_licenses: true accept_licenses: true
state: present state: present
channel: canary channel: canary
''' """
RETURN = r''' RETURN = r"""
installed: installed:
description: a list of packages that have been installed description: A list of packages that have been installed.
returned: when packages have changed returned: when packages have changed
type: list type: list
sample: ['build-tools;34.0.0', 'platform-tools'] sample: ['build-tools;34.0.0', 'platform-tools']
removed: removed:
description: a list of packages that have been removed description: A list of packages that have been removed.
returned: when packages have changed returned: when packages have changed
type: list type: list
sample: ['build-tools;34.0.0', 'platform-tools'] sample: ['build-tools;34.0.0', 'platform-tools']
''' """
from ansible_collections.community.general.plugins.module_utils.mh.module_helper import StateModuleHelper from ansible_collections.community.general.plugins.module_utils.mh.module_helper import StateModuleHelper
from ansible_collections.community.general.plugins.module_utils.android_sdkmanager import Package, AndroidSdkManager from ansible_collections.community.general.plugins.module_utils.android_sdkmanager import Package, AndroidSdkManager

View File

@ -8,30 +8,27 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
---
module: ansible_galaxy_install module: ansible_galaxy_install
author: author:
- "Alexei Znamensky (@russoz)" - "Alexei Znamensky (@russoz)"
short_description: Install Ansible roles or collections using ansible-galaxy short_description: Install Ansible roles or collections using ansible-galaxy
version_added: 3.5.0 version_added: 3.5.0
description: description:
- This module allows the installation of Ansible collections or roles using C(ansible-galaxy). - This module allows the installation of Ansible collections or roles using C(ansible-galaxy).
notes: notes:
- Support for B(Ansible 2.9/2.10) was removed in community.general 8.0.0. - Support for B(Ansible 2.9/2.10) was removed in community.general 8.0.0.
- > - The module will try and run using the C(C.UTF-8) locale. If that fails, it will try C(en_US.UTF-8). If that one also fails,
The module will try and run using the C(C.UTF-8) locale. the module will fail.
If that fails, it will try C(en_US.UTF-8).
If that one also fails, the module will fail.
seealso: seealso:
- name: C(ansible-galaxy) command manual page - name: C(ansible-galaxy) command manual page
description: Manual page for the command. description: Manual page for the command.
link: https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html link: https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html
requirements: requirements:
- ansible-core 2.11 or newer - ansible-core 2.11 or newer
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
@ -40,63 +37,59 @@ attributes:
options: options:
state: state:
description: description:
- > - If O(state=present) then the collection or role will be installed. Note that the collections and roles are not updated
If O(state=present) then the collection or role will be installed. with this option.
Note that the collections and roles are not updated with this option. - Currently the O(state=latest) is ignored unless O(type=collection), and it will ensure the collection is installed
- > and updated to the latest available version.
Currently the O(state=latest) is ignored unless O(type=collection), and it will - Please note that O(force=true) can be used to perform upgrade regardless of O(type).
ensure the collection is installed and updated to the latest available version.
- Please note that O(force=true) can be used to perform upgrade regardless of O(type).
type: str type: str
choices: [present, latest] choices: [present, latest]
default: present default: present
version_added: 9.1.0 version_added: 9.1.0
type: type:
description: description:
- The type of installation performed by C(ansible-galaxy). - The type of installation performed by C(ansible-galaxy).
- If O(type=both), then O(requirements_file) must be passed and it may contain both roles and collections. - If O(type=both), then O(requirements_file) must be passed and it may contain both roles and collections.
- "Note however that the opposite is not true: if using a O(requirements_file), then O(type) can be any of the three choices." - 'Note however that the opposite is not true: if using a O(requirements_file), then O(type) can be any of the three
choices.'
type: str type: str
choices: [collection, role, both] choices: [collection, role, both]
required: true required: true
name: name:
description: description:
- Name of the collection or role being installed. - Name of the collection or role being installed.
- > - Versions can be specified with C(ansible-galaxy) usual formats. For example, the collection V(community.docker:1.6.1)
Versions can be specified with C(ansible-galaxy) usual formats. or the role V(ansistrano.deploy,3.8.0).
For example, the collection V(community.docker:1.6.1) or the role V(ansistrano.deploy,3.8.0). - O(name) and O(requirements_file) are mutually exclusive.
- O(name) and O(requirements_file) are mutually exclusive.
type: str type: str
requirements_file: requirements_file:
description: description:
- Path to a file containing a list of requirements to be installed. - Path to a file containing a list of requirements to be installed.
- It works for O(type) equals to V(collection) and V(role). - It works for O(type) equals to V(collection) and V(role).
- O(name) and O(requirements_file) are mutually exclusive. - O(name) and O(requirements_file) are mutually exclusive.
type: path type: path
dest: dest:
description: description:
- The path to the directory containing your collections or roles, according to the value of O(type). - The path to the directory containing your collections or roles, according to the value of O(type).
- > - Please notice that C(ansible-galaxy) will not install collections with O(type=both), when O(requirements_file) contains
Please notice that C(ansible-galaxy) will not install collections with O(type=both), when O(requirements_file) both roles and collections and O(dest) is specified.
contains both roles and collections and O(dest) is specified.
type: path type: path
no_deps: no_deps:
description: description:
- Refrain from installing dependencies. - Refrain from installing dependencies.
version_added: 4.5.0 version_added: 4.5.0
type: bool type: bool
default: false default: false
force: force:
description: description:
- Force overwriting existing roles and/or collections. - Force overwriting existing roles and/or collections.
- It can be used for upgrading, but the module output will always report C(changed=true). - It can be used for upgrading, but the module output will always report C(changed=true).
- Using O(force=true) is mandatory when downgrading. - Using O(force=true) is mandatory when downgrading.
type: bool type: bool
default: false default: false
""" """
EXAMPLES = """ EXAMPLES = r"""
---
- name: Install collection community.network - name: Install collection community.network
community.general.ansible_galaxy_install: community.general.ansible_galaxy_install:
type: collection type: collection
@ -120,8 +113,7 @@ EXAMPLES = """
force: true force: true
""" """
RETURN = """ RETURN = r"""
---
type: type:
description: The value of the O(type) parameter. description: The value of the O(type) parameter.
type: str type: str
@ -144,8 +136,8 @@ force:
returned: always returned: always
installed_roles: installed_roles:
description: description:
- If O(requirements_file) is specified instead, returns dictionary with all the roles installed per path. - If O(requirements_file) is specified instead, returns dictionary with all the roles installed per path.
- If O(name) is specified, returns that role name and the version installed per path. - If O(name) is specified, returns that role name and the version installed per path.
type: dict type: dict
returned: always when installing roles returned: always when installing roles
contains: contains:
@ -160,13 +152,13 @@ installed_roles:
ansistrano.deploy: 3.8.0 ansistrano.deploy: 3.8.0
installed_collections: installed_collections:
description: description:
- If O(requirements_file) is specified instead, returns dictionary with all the collections installed per path. - If O(requirements_file) is specified instead, returns dictionary with all the collections installed per path.
- If O(name) is specified, returns that collection name and the version installed per path. - If O(name) is specified, returns that collection name and the version installed per path.
type: dict type: dict
returned: always when installing collections returned: always when installing collections
contains: contains:
"<path>": "<path>":
description: Collections and versions for that path description: Collections and versions for that path.
type: dict type: dict
sample: sample:
/home/az/.ansible/collections/ansible_collections: /home/az/.ansible/collections/ansible_collections:

View File

@ -9,19 +9,17 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: apache2_mod_proxy module: apache2_mod_proxy
author: Olivier Boukili (@oboukili) author: Olivier Boukili (@oboukili)
short_description: Set and/or get members' attributes of an Apache httpd 2.4 mod_proxy balancer pool short_description: Set and/or get members' attributes of an Apache httpd 2.4 mod_proxy balancer pool
description: description:
- Set and/or get members' attributes of an Apache httpd 2.4 mod_proxy balancer - Set and/or get members' attributes of an Apache httpd 2.4 mod_proxy balancer pool, using HTTP POST and GET requests. The
pool, using HTTP POST and GET requests. The httpd mod_proxy balancer-member httpd mod_proxy balancer-member status page has to be enabled and accessible, as this module relies on parsing this page.
status page has to be enabled and accessible, as this module relies on parsing
this page. This module supports ansible check_mode, and requires BeautifulSoup
python module.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
requirements:
- Python package C(BeautifulSoup).
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -31,28 +29,25 @@ options:
balancer_url_suffix: balancer_url_suffix:
type: str type: str
description: description:
- Suffix of the balancer pool url required to access the balancer pool - Suffix of the balancer pool URL required to access the balancer pool status page (for example V(balancer_vhost[:port]/balancer_url_suffix)).
status page (e.g. balancer_vhost[:port]/balancer_url_suffix).
default: /balancer-manager/ default: /balancer-manager/
balancer_vhost: balancer_vhost:
type: str type: str
description: description:
- (ipv4|ipv6|fqdn):port of the Apache httpd 2.4 mod_proxy balancer pool. - (IPv4|IPv6|FQDN):port of the Apache httpd 2.4 mod_proxy balancer pool.
required: true required: true
member_host: member_host:
type: str type: str
description: description:
- (ipv4|ipv6|fqdn) of the balancer member to get or to set attributes to. - (IPv4|IPv6|FQDN) of the balancer member to get or to set attributes to. Port number is autodetected and should not
Port number is autodetected and should not be specified here. be specified here. If undefined, apache2_mod_proxy module will return a members list of dictionaries of all the current
If undefined, apache2_mod_proxy module will return a members list of balancer pool members' attributes.
dictionaries of all the current balancer pool members' attributes.
state: state:
type: str type: str
description: description:
- Desired state of the member host. - Desired state of the member host. (absent|disabled),drained,hot_standby,ignore_errors can be simultaneously invoked
(absent|disabled),drained,hot_standby,ignore_errors can be by separating them with a comma (for example V(state=drained,ignore_errors)).
simultaneously invoked by separating them with a comma (e.g. state=drained,ignore_errors). - 'Accepted state values: [V(present), V(absent), V(enabled), V(disabled), V(drained), V(hot_standby), V(ignore_errors)].'
- 'Accepted state values: ["present", "absent", "enabled", "disabled", "drained", "hot_standby", "ignore_errors"]'
tls: tls:
description: description:
- Use https to access balancer management page. - Use https to access balancer management page.
@ -63,9 +58,9 @@ options:
- Validate ssl/tls certificates. - Validate ssl/tls certificates.
type: bool type: bool
default: true default: true
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get all current balancer pool members attributes - name: Get all current balancer pool members attributes
community.general.apache2_mod_proxy: community.general.apache2_mod_proxy:
balancer_vhost: 10.0.0.2 balancer_vhost: 10.0.0.2
@ -110,98 +105,98 @@ EXAMPLES = '''
member_host: '{{ member.host }}' member_host: '{{ member.host }}'
state: absent state: absent
delegate_to: myloadbalancernode delegate_to: myloadbalancernode
''' """
RETURN = ''' RETURN = r"""
member: member:
description: specific balancer member information dictionary, returned when apache2_mod_proxy module is invoked with member_host parameter. description: specific balancer member information dictionary, returned when apache2_mod_proxy module is invoked with C(member_host) parameter.
type: dict type: dict
returned: success returned: success
sample: sample:
{"attributes": {"attributes":
{"Busy": "0", {"Busy": "0",
"Elected": "42", "Elected": "42",
"Factor": "1", "Factor": "1",
"From": "136K", "From": "136K",
"Load": "0", "Load": "0",
"Route": null, "Route": null,
"RouteRedir": null, "RouteRedir": null,
"Set": "0", "Set": "0",
"Status": "Init Ok ", "Status": "Init Ok ",
"To": " 47K", "To": " 47K",
"Worker URL": null "Worker URL": null
}, },
"balancer_url": "http://10.10.0.2/balancer-manager/", "balancer_url": "http://10.10.0.2/balancer-manager/",
"host": "10.10.0.20", "host": "10.10.0.20",
"management_url": "http://10.10.0.2/lb/?b=mywsbalancer&w=http://10.10.0.20:8080/ws&nonce=8925436c-79c6-4841-8936-e7d13b79239b", "management_url": "http://10.10.0.2/lb/?b=mywsbalancer&w=http://10.10.0.20:8080/ws&nonce=8925436c-79c6-4841-8936-e7d13b79239b",
"path": "/ws", "path": "/ws",
"port": 8080, "port": 8080,
"protocol": "http", "protocol": "http",
"status": { "status": {
"disabled": false, "disabled": false,
"drained": false, "drained": false,
"hot_standby": false, "hot_standby": false,
"ignore_errors": false "ignore_errors": false
}
} }
}
members: members:
description: list of member (defined above) dictionaries, returned when apache2_mod_proxy is invoked with no member_host and state args. description: list of member (defined above) dictionaries, returned when apache2_mod_proxy is invoked with no C(member_host) and state args.
returned: success returned: success
type: list type: list
sample: sample:
[{"attributes": { [{"attributes": {
"Busy": "0", "Busy": "0",
"Elected": "42", "Elected": "42",
"Factor": "1", "Factor": "1",
"From": "136K", "From": "136K",
"Load": "0", "Load": "0",
"Route": null, "Route": null,
"RouteRedir": null, "RouteRedir": null,
"Set": "0", "Set": "0",
"Status": "Init Ok ", "Status": "Init Ok ",
"To": " 47K", "To": " 47K",
"Worker URL": null "Worker URL": null
}, },
"balancer_url": "http://10.10.0.2/balancer-manager/", "balancer_url": "http://10.10.0.2/balancer-manager/",
"host": "10.10.0.20", "host": "10.10.0.20",
"management_url": "http://10.10.0.2/lb/?b=mywsbalancer&w=http://10.10.0.20:8080/ws&nonce=8925436c-79c6-4841-8936-e7d13b79239b", "management_url": "http://10.10.0.2/lb/?b=mywsbalancer&w=http://10.10.0.20:8080/ws&nonce=8925436c-79c6-4841-8936-e7d13b79239b",
"path": "/ws", "path": "/ws",
"port": 8080, "port": 8080,
"protocol": "http", "protocol": "http",
"status": { "status": {
"disabled": false, "disabled": false,
"drained": false, "drained": false,
"hot_standby": false, "hot_standby": false,
"ignore_errors": false "ignore_errors": false
} }
}, },
{"attributes": { {"attributes": {
"Busy": "0", "Busy": "0",
"Elected": "42", "Elected": "42",
"Factor": "1", "Factor": "1",
"From": "136K", "From": "136K",
"Load": "0", "Load": "0",
"Route": null, "Route": null,
"RouteRedir": null, "RouteRedir": null,
"Set": "0", "Set": "0",
"Status": "Init Ok ", "Status": "Init Ok ",
"To": " 47K", "To": " 47K",
"Worker URL": null "Worker URL": null
}, },
"balancer_url": "http://10.10.0.2/balancer-manager/", "balancer_url": "http://10.10.0.2/balancer-manager/",
"host": "10.10.0.21", "host": "10.10.0.21",
"management_url": "http://10.10.0.2/lb/?b=mywsbalancer&w=http://10.10.0.21:8080/ws&nonce=8925436c-79c6-4841-8936-e7d13b79239b", "management_url": "http://10.10.0.2/lb/?b=mywsbalancer&w=http://10.10.0.21:8080/ws&nonce=8925436c-79c6-4841-8936-e7d13b79239b",
"path": "/ws", "path": "/ws",
"port": 8080, "port": 8080,
"protocol": "http", "protocol": "http",
"status": { "status": {
"disabled": false, "disabled": false,
"drained": false, "drained": false,
"hot_standby": false, "hot_standby": false,
"ignore_errors": false} "ignore_errors": false}
} }
] ]
''' """
import re import re
import traceback import traceback

View File

@ -9,66 +9,64 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: apache2_module module: apache2_module
author: author:
- Christian Berendt (@berendt) - Christian Berendt (@berendt)
- Ralf Hertel (@n0trax) - Ralf Hertel (@n0trax)
- Robin Roth (@robinro) - Robin Roth (@robinro)
short_description: Enables/disables a module of the Apache2 webserver short_description: Enables/disables a module of the Apache2 webserver
description: description:
- Enables or disables a specified module of the Apache2 webserver. - Enables or disables a specified module of the Apache2 webserver.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
type: str type: str
description: description:
- Name of the module to enable/disable as given to C(a2enmod/a2dismod). - Name of the module to enable/disable as given to C(a2enmod)/C(a2dismod).
required: true required: true
identifier: identifier:
type: str type: str
description: description:
- Identifier of the module as listed by C(apache2ctl -M). - Identifier of the module as listed by C(apache2ctl -M). This is optional and usually determined automatically by the
This is optional and usually determined automatically by the common convention of common convention of appending V(_module) to O(name) as well as custom exception for popular modules.
appending V(_module) to O(name) as well as custom exception for popular modules. required: false
required: false force:
force: description:
description: - Force disabling of default modules and override Debian warnings.
- Force disabling of default modules and override Debian warnings. required: false
required: false type: bool
type: bool default: false
default: false state:
state: type: str
type: str description:
description: - Desired state of the module.
- Desired state of the module. choices: ['present', 'absent']
choices: ['present', 'absent'] default: present
default: present ignore_configcheck:
ignore_configcheck: description:
description: - Ignore configuration checks about inconsistent module configuration. Especially for mpm_* modules.
- Ignore configuration checks about inconsistent module configuration. Especially for mpm_* modules. type: bool
type: bool default: false
default: false warn_mpm_absent:
warn_mpm_absent: description:
description: - Control the behavior of the warning process for MPM modules.
- Control the behavior of the warning process for MPM modules. type: bool
type: bool default: true
default: true version_added: 6.3.0
version_added: 6.3.0 requirements: ["a2enmod", "a2dismod"]
requirements: ["a2enmod","a2dismod"]
notes: notes:
- This does not work on RedHat-based distributions. It does work on Debian- and SuSE-based distributions. - This does not work on RedHat-based distributions. It does work on Debian- and SuSE-based distributions. Whether it works
Whether it works on others depend on whether the C(a2enmod) and C(a2dismod) tools are available or not. on others depend on whether the C(a2enmod) and C(a2dismod) tools are available or not.
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Enable the Apache2 module wsgi - name: Enable the Apache2 module wsgi
community.general.apache2_module: community.general.apache2_module:
state: present state: present
@ -98,40 +96,40 @@ EXAMPLES = '''
warn_mpm_absent: false warn_mpm_absent: false
ignore_configcheck: true ignore_configcheck: true
loop: loop:
- module: mpm_event - module: mpm_event
state: absent state: absent
- module: mpm_prefork - module: mpm_prefork
state: present state: present
- name: Enable dump_io module, which is identified as dumpio_module inside apache2 - name: Enable dump_io module, which is identified as dumpio_module inside apache2
community.general.apache2_module: community.general.apache2_module:
state: present state: present
name: dump_io name: dump_io
identifier: dumpio_module identifier: dumpio_module
''' """
RETURN = ''' RETURN = r"""
result: result:
description: message about action taken description: Message about action taken.
returned: always returned: always
type: str type: str
warnings: warnings:
description: list of warning messages description: List of warning messages.
returned: when needed returned: when needed
type: list type: list
rc: rc:
description: return code of underlying command description: Return code of underlying command.
returned: failed returned: failed
type: int type: int
stdout: stdout:
description: stdout of underlying command description: The stdout of underlying command.
returned: failed returned: failed
type: str type: str
stderr: stderr:
description: stderr of underlying command description: The stderr of underlying command.
returned: failed returned: failed
type: str type: str
''' """
import re import re

View File

@ -12,8 +12,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: apk module: apk
short_description: Manages apk packages short_description: Manages apk packages
description: description:
@ -29,15 +28,15 @@ attributes:
options: options:
available: available:
description: description:
- During upgrade, reset versioned world dependencies and change logic to prefer replacing or downgrading packages (instead of holding them) - During upgrade, reset versioned world dependencies and change logic to prefer replacing or downgrading packages (instead
if the currently installed package is no longer available from any repository. of holding them) if the currently installed package is no longer available from any repository.
type: bool type: bool
default: false default: false
name: name:
description: description:
- A package name, like V(foo), or multiple packages, like V(foo,bar). - A package name, like V(foo), or multiple packages, like V(foo,bar).
- Do not include additional whitespace when specifying multiple packages as a string. - Do not include additional whitespace when specifying multiple packages as a string. Prefer YAML lists over comma-separating
Prefer YAML lists over comma-separating multiple package names. multiple package names.
type: list type: list
elements: str elements: str
no_cache: no_cache:
@ -48,8 +47,8 @@ options:
version_added: 1.0.0 version_added: 1.0.0
repository: repository:
description: description:
- A package repository or multiple repositories. - A package repository or multiple repositories. Unlike with the underlying apk command, this list will override the
Unlike with the underlying apk command, this list will override the system repositories rather than supplement them. system repositories rather than supplement them.
type: list type: list
elements: str elements: str
state: state:
@ -59,7 +58,7 @@ options:
- V(absent) ensures the package(s) is/are absent. V(removed) can be used as an alias. - V(absent) ensures the package(s) is/are absent. V(removed) can be used as an alias.
- V(latest) ensures the package(s) is/are present and the latest version(s). - V(latest) ensures the package(s) is/are present and the latest version(s).
default: present default: present
choices: [ "present", "absent", "latest", "installed", "removed" ] choices: ["present", "absent", "latest", "installed", "removed"]
type: str type: str
update_cache: update_cache:
description: description:
@ -73,17 +72,18 @@ options:
default: false default: false
world: world:
description: description:
- Use a custom world file when checking for explicitly installed packages. - Use a custom world file when checking for explicitly installed packages. The file is used only when a value is provided
The file is used only when a value is provided for O(name), and O(state) is set to V(present) or V(latest). for O(name), and O(state) is set to V(present) or V(latest).
type: str type: str
default: /etc/apk/world default: /etc/apk/world
version_added: 5.4.0 version_added: 5.4.0
notes: notes:
- 'O(name) and O(upgrade) are mutually exclusive.' - O(name) and O(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 O(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 O(name) option.
"""
EXAMPLES = ''' EXAMPLES = r"""
- name: Update repositories and install foo package - name: Update repositories and install foo package
community.general.apk: community.general.apk:
name: foo name: foo
@ -157,15 +157,15 @@ EXAMPLES = '''
name: foo name: foo
state: latest state: latest
world: /etc/apk/world.custom world: /etc/apk/world.custom
''' """
RETURN = ''' RETURN = r"""
packages: packages:
description: a list of packages that have been changed description: A list of packages that have been changed.
returned: when packages have changed returned: when packages have changed
type: list type: list
sample: ['package', 'other-package'] sample: ['package', 'other-package']
''' """
import re import re
# Import module snippets. # Import module snippets.

View File

@ -9,16 +9,15 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: apt_repo module: apt_repo
short_description: Manage APT repositories via apt-repo short_description: Manage APT repositories using C(apt-repo)
description: description:
- Manages APT repositories using apt-repo tool. - Manages APT repositories using C(apt-repo) tool.
- See U(https://www.altlinux.org/Apt-repo) for details about apt-repo - See U(https://www.altlinux.org/Apt-repo) for details about C(apt-repo).
notes: notes:
- This module works on ALT based distros. - This module works on ALT based distros.
- Does NOT support checkmode, due to a limitation in apt-repo tool. - Does NOT support checkmode, due to a limitation in C(apt-repo) tool.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -35,13 +34,13 @@ options:
state: state:
description: description:
- Indicates the desired repository state. - Indicates the desired repository state.
choices: [ absent, present ] choices: [absent, present]
default: present default: present
type: str type: str
remove_others: remove_others:
description: description:
- Remove other then added repositories - Remove other then added repositories.
- Used if O(state=present) - Used if O(state=present).
type: bool type: bool
default: false default: false
update: update:
@ -50,10 +49,10 @@ options:
type: bool type: bool
default: false default: false
author: author:
- Mikhail Gordeev (@obirvalger) - Mikhail Gordeev (@obirvalger)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Remove all repositories - name: Remove all repositories
community.general.apt_repo: community.general.apt_repo:
repo: all repo: all
@ -70,9 +69,9 @@ EXAMPLES = '''
repo: copy:///space/ALT/Sisyphus repo: copy:///space/ALT/Sisyphus
state: present state: present
update: true update: true
''' """
RETURN = ''' # ''' RETURN = """ # """
import os import os

View File

@ -11,8 +11,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: apt_rpm module: apt_rpm
short_description: APT-RPM package manager short_description: APT-RPM package manager
description: description:
@ -28,18 +27,16 @@ options:
package: package:
description: description:
- List of packages to install, upgrade, or remove. - List of packages to install, upgrade, or remove.
- Since community.general 8.0.0, may include paths to local C(.rpm) files - Since community.general 8.0.0, may include paths to local C(.rpm) files if O(state=installed) or O(state=present),
if O(state=installed) or O(state=present), requires C(rpm) python requires C(rpm) Python module.
module. aliases: [name, pkg]
aliases: [ name, pkg ]
type: list type: list
elements: str elements: str
state: state:
description: description:
- Indicates the desired package state. - Indicates the desired package state.
- Please note that V(present) and V(installed) are equivalent to V(latest) right now. - Please note that V(present) and V(installed) are equivalent to V(latest) right now. This will change in the future.
This will change in the future. To simply ensure that a package is installed, without upgrading To simply ensure that a package is installed, without upgrading it, use the V(present_not_latest) state.
it, use the V(present_not_latest) state.
- The states V(latest) and V(present_not_latest) have been added in community.general 8.6.0. - The states V(latest) and V(present_not_latest) have been added in community.general 8.6.0.
choices: choices:
- absent - absent
@ -52,14 +49,15 @@ options:
type: str type: str
update_cache: update_cache:
description: description:
- Run the equivalent of C(apt-get update) before the operation. Can be run as part of the package installation or as a separate step. - Run the equivalent of C(apt-get update) before the operation. Can be run as part of the package installation or as
a separate step.
- Default is not to update the cache. - Default is not to update the cache.
type: bool type: bool
default: false default: false
clean: clean:
description: description:
- Run the equivalent of C(apt-get clean) to clear out the local repository of retrieved package files. It removes everything but - Run the equivalent of C(apt-get clean) to clear out the local repository of retrieved package files. It removes everything
the lock file from C(/var/cache/apt/archives/) and C(/var/cache/apt/archives/partial/). but the lock file from C(/var/cache/apt/archives/) and C(/var/cache/apt/archives/partial/).
- Can be run as part of the package installation (clean runs before install) or as a separate step. - Can be run as part of the package installation (clean runs before install) or as a separate step.
type: bool type: bool
default: false default: false
@ -77,13 +75,12 @@ options:
default: false default: false
version_added: 6.5.0 version_added: 6.5.0
requirements: requirements:
- C(rpm) python package (rpm bindings), optional. Required if O(package) - C(rpm) Python package (rpm bindings), optional. Required if O(package) option includes local files.
option includes local files.
author: author:
- Evgenii Terechkov (@evgkrsk) - Evgenii Terechkov (@evgkrsk)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Install package foo - name: Install package foo
community.general.apt_rpm: community.general.apt_rpm:
pkg: foo pkg: foo
@ -122,7 +119,7 @@ EXAMPLES = '''
update_cache: true update_cache: true
dist_upgrade: true dist_upgrade: true
update_kernel: true update_kernel: true
''' """
import os import os
import re import re

View File

@ -10,17 +10,16 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: archive module: archive
short_description: Creates a compressed archive of one or more files or trees short_description: Creates a compressed archive of one or more files or trees
extends_documentation_fragment: extends_documentation_fragment:
- files - files
- community.general.attributes - community.general.attributes
description: description:
- Creates or extends an archive. - Creates or extends an archive.
- The source and archive are on the remote host, and the archive I(is not) copied to the local host. - The source and archive are on the target host, and the archive I(is not) copied to the controller host.
- Source files can be deleted after archival by specifying O(remove=True). - Source files can be deleted after archival by specifying O(remove=True).
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -37,17 +36,19 @@ options:
description: description:
- The type of compression to use. - The type of compression to use.
type: str type: str
choices: [ bz2, gz, tar, xz, zip ] choices: [bz2, gz, tar, xz, zip]
default: gz default: gz
dest: dest:
description: description:
- The file name of the destination archive. The parent directory must exists on the remote host. - The file name of the destination archive. The parent directory must exists on the remote host.
- This is required when O(path) refers to multiple files by either specifying a glob, a directory or multiple paths in a list. - This is required when O(path) refers to multiple files by either specifying a glob, a directory or multiple paths
in a list.
- If the destination archive already exists, it will be truncated and overwritten. - If the destination archive already exists, it will be truncated and overwritten.
type: path type: path
exclude_path: exclude_path:
description: description:
- Remote absolute path, glob, or list of paths or globs for the file or files to exclude from O(path) list and glob expansion. - Remote absolute path, glob, or list of paths or globs for the file or files to exclude from O(path) list and glob
expansion.
- Use O(exclusion_patterns) to instead exclude files or subdirectories below any of the paths from the O(path) list. - Use O(exclusion_patterns) to instead exclude files or subdirectories below any of the paths from the O(path) list.
type: list type: list
elements: path elements: path
@ -72,18 +73,19 @@ options:
type: bool type: bool
default: false default: false
notes: notes:
- Can produce C(gzip), C(bzip2), C(lzma), and C(zip) compressed files or archives. - Can produce C(gzip), C(bzip2), C(lzma), and C(zip) compressed files or archives.
- This module uses C(tarfile), C(zipfile), C(gzip), and C(bz2) packages on the target host to create archives. - This module uses C(tarfile), C(zipfile), C(gzip), and C(bz2) packages on the target host to create archives. These are
These are part of the Python standard library for Python 2 and 3. part of the Python standard library for Python 2 and 3.
requirements: requirements:
- Requires C(lzma) (standard library of Python 3) or L(backports.lzma, https://pypi.org/project/backports.lzma/) (Python 2) if using C(xz) format. - Requires C(lzma) (standard library of Python 3) or L(backports.lzma, https://pypi.org/project/backports.lzma/) (Python
2) if using C(xz) format.
seealso: seealso:
- module: ansible.builtin.unarchive - module: ansible.builtin.unarchive
author: author:
- Ben Doherty (@bendoh) - Ben Doherty (@bendoh)
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Compress directory /path/to/foo/ into /path/to/foo.tgz - name: Compress directory /path/to/foo/ into /path/to/foo.tgz
community.general.archive: community.general.archive:
path: /path/to/foo path: /path/to/foo
@ -102,28 +104,28 @@ EXAMPLES = r'''
- name: Create a bz2 archive of multiple files, rooted at /path - name: Create a bz2 archive of multiple files, rooted at /path
community.general.archive: community.general.archive:
path: path:
- /path/to/foo - /path/to/foo
- /path/wong/foo - /path/wong/foo
dest: /path/file.tar.bz2 dest: /path/file.tar.bz2
format: bz2 format: bz2
- name: Create a bz2 archive of a globbed path, while excluding specific dirnames - name: Create a bz2 archive of a globbed path, while excluding specific dirnames
community.general.archive: community.general.archive:
path: path:
- /path/to/foo/* - /path/to/foo/*
dest: /path/file.tar.bz2 dest: /path/file.tar.bz2
exclude_path: exclude_path:
- /path/to/foo/bar - /path/to/foo/bar
- /path/to/foo/baz - /path/to/foo/baz
format: bz2 format: bz2
- name: Create a bz2 archive of a globbed path, while excluding a glob of dirnames - name: Create a bz2 archive of a globbed path, while excluding a glob of dirnames
community.general.archive: community.general.archive:
path: path:
- /path/to/foo/* - /path/to/foo/*
dest: /path/file.tar.bz2 dest: /path/file.tar.bz2
exclude_path: exclude_path:
- /path/to/foo/ba* - /path/to/foo/ba*
format: bz2 format: bz2
- name: Use gzip to compress a single archive (i.e don't archive it first with tar) - name: Use gzip to compress a single archive (i.e don't archive it first with tar)
@ -138,45 +140,44 @@ EXAMPLES = r'''
dest: /path/file.tar.gz dest: /path/file.tar.gz
format: gz format: gz
force_archive: true force_archive: true
''' """
RETURN = r''' RETURN = r"""
state: state:
description: description: The state of the input O(path).
The state of the input O(path). type: str
type: str returned: always
returned: always
dest_state: dest_state:
description: description:
- The state of the O(dest) file. - The state of the O(dest) file.
- V(absent) when the file does not exist. - V(absent) when the file does not exist.
- V(archive) when the file is an archive. - V(archive) when the file is an archive.
- V(compress) when the file is compressed, but not an archive. - V(compress) when the file is compressed, but not an archive.
- V(incomplete) when the file is an archive, but some files under O(path) were not found. - V(incomplete) when the file is an archive, but some files under O(path) were not found.
type: str type: str
returned: success returned: success
version_added: 3.4.0 version_added: 3.4.0
missing: missing:
description: Any files that were missing from the source. description: Any files that were missing from the source.
type: list type: list
returned: success returned: success
archived: archived:
description: Any files that were compressed or added to the archive. description: Any files that were compressed or added to the archive.
type: list type: list
returned: success returned: success
arcroot: arcroot:
description: The archive root. description: The archive root.
type: str type: str
returned: always returned: always
expanded_paths: expanded_paths:
description: The list of matching paths from paths argument. description: The list of matching paths from paths argument.
type: list type: list
returned: always returned: always
expanded_exclude_paths: expanded_exclude_paths:
description: The list of matching exclude paths from the exclude_path argument. description: The list of matching exclude paths from the exclude_path argument.
type: list type: list
returned: always returned: always
''' """
import abc import abc
import bz2 import bz2

View File

@ -9,69 +9,67 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: atomic_container module: atomic_container
short_description: Manage the containers on the atomic host platform short_description: Manage the containers on the atomic host platform
description: description:
- Manage the containers on the atomic host platform. - Manage the containers on the atomic host platform.
- Allows to manage the lifecycle of a container on the atomic host platform. - Allows to manage the lifecycle of a container on the atomic host platform.
author: "Giuseppe Scrivano (@giuseppe)" author: "Giuseppe Scrivano (@giuseppe)"
notes:
- Host should support C(atomic) command
requirements: requirements:
- atomic - atomic
notes:
- According to U(https://projectatomic.io/) the project has been sunset around 2019/2020, in favor of C(podman) and Fedora CoreOS.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
backend: backend:
description: description:
- Define the backend to use for the container. - Define the backend to use for the container.
required: true required: true
choices: ["docker", "ostree"] choices: ["docker", "ostree"]
type: str type: str
name: name:
description: description:
- Name of the container. - Name of the container.
required: true required: true
type: str type: str
image: image:
description: description:
- The image to use to install the container. - The image to use to install the container.
required: true required: true
type: str type: str
rootfs: rootfs:
description: description:
- Define the rootfs of the image. - Define the rootfs of the image.
type: str type: str
state: state:
description: description:
- State of the container. - State of the container.
choices: ["absent", "latest", "present", "rollback"] choices: ["absent", "latest", "present", "rollback"]
default: "latest" default: "latest"
type: str type: str
mode: mode:
description: description:
- Define if it is an user or a system container. - Define if it is an user or a system container.
choices: ["user", "system"] choices: ["user", "system"]
type: str type: str
values: values:
description: description:
- Values for the installation of the container. - Values for the installation of the container.
- This option is permitted only with mode 'user' or 'system'. - This option is permitted only with mode 'user' or 'system'.
- The values specified here will be used at installation time as --set arguments for atomic install. - The values specified here will be used at installation time as --set arguments for atomic install.
type: list type: list
elements: str elements: str
default: [] default: []
''' """
EXAMPLES = r'''
EXAMPLES = r"""
- name: Install the etcd system container - name: Install the etcd system container
community.general.atomic_container: community.general.atomic_container:
name: etcd name: etcd
@ -80,7 +78,7 @@ EXAMPLES = r'''
state: latest state: latest
mode: system mode: system
values: values:
- ETCD_NAME=etcd.server - ETCD_NAME=etcd.server
- name: Uninstall the etcd system container - name: Uninstall the etcd system container
community.general.atomic_container: community.general.atomic_container:
@ -89,15 +87,15 @@ EXAMPLES = r'''
backend: ostree backend: ostree
state: absent state: absent
mode: system mode: system
''' """
RETURN = r''' RETURN = r"""
msg: msg:
description: The command standard output description: The command standard output.
returned: always returned: always
type: str type: str
sample: 'Using default tag: latest ...' sample: 'Using default tag: latest ...'
''' """
# import module snippets # import module snippets
import traceback import traceback

View File

@ -8,37 +8,37 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: atomic_host module: atomic_host
short_description: Manage the atomic host platform short_description: Manage the atomic host platform
description: description:
- Manage the atomic host platform. - Manage the atomic host platform.
- Rebooting of Atomic host platform should be done outside this module. - Rebooting of Atomic host platform should be done outside this module.
author: author:
- Saravanan KR (@krsacme) - Saravanan KR (@krsacme)
notes: notes:
- Host should be an atomic platform (verified by existence of '/run/ostree-booted' file). - Host should be an atomic platform (verified by existence of '/run/ostree-booted' file).
- According to U(https://projectatomic.io/) the project has been sunset around 2019/2020, in favor of C(podman) and Fedora CoreOS.
requirements: requirements:
- atomic - atomic
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
revision: revision:
description: description:
- The version number of the atomic host to be deployed. - The version number of the atomic host to be deployed.
- Providing V(latest) will upgrade to the latest available version. - Providing V(latest) will upgrade to the latest available version.
default: 'latest' default: 'latest'
aliases: [ version ] aliases: [version]
type: str type: str
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Upgrade the atomic host platform to the latest version (atomic host upgrade) - name: Upgrade the atomic host platform to the latest version (atomic host upgrade)
community.general.atomic_host: community.general.atomic_host:
revision: latest revision: latest
@ -46,15 +46,15 @@ EXAMPLES = r'''
- name: Deploy a specific revision as the atomic host (atomic host deploy 23.130) - name: Deploy a specific revision as the atomic host (atomic host deploy 23.130)
community.general.atomic_host: community.general.atomic_host:
revision: 23.130 revision: 23.130
''' """
RETURN = r''' RETURN = r"""
msg: msg:
description: The command standard output description: The command standard output.
returned: always returned: always
type: str type: str
sample: 'Already on latest' sample: 'Already on latest'
''' """
import os import os
import traceback import traceback

View File

@ -8,52 +8,52 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: atomic_image module: atomic_image
short_description: Manage the container images on the atomic host platform short_description: Manage the container images on the atomic host platform
description: description:
- Manage the container images on the atomic host platform. - Manage the container images on the atomic host platform.
- Allows to execute the commands specified by the RUN label in the container image when present. - Allows to execute the commands specified by the RUN label in the container image when present.
author: author:
- Saravanan KR (@krsacme) - Saravanan KR (@krsacme)
notes: notes:
- Host should support C(atomic) command. - According to U(https://projectatomic.io/) the project has been sunset around 2019/2020, in favor of C(podman) and Fedora CoreOS.
requirements: requirements:
- atomic - atomic
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
backend: backend:
description: description:
- Define the backend where the image is pulled. - Define the backend where the image is pulled.
choices: [ 'docker', 'ostree' ] choices: ['docker', 'ostree']
type: str type: str
name: name:
description: description:
- Name of the container image. - Name of the container image.
required: true required: true
type: str type: str
state: state:
description: description:
- The state of the container image. - The state of the container image.
- The state V(latest) will ensure container image is upgraded to the latest version and forcefully restart container, if running. - The state V(latest) will ensure container image is upgraded to the latest version and forcefully restart container,
choices: [ 'absent', 'latest', 'present' ] if running.
default: 'latest' choices: ['absent', 'latest', 'present']
type: str default: 'latest'
started: type: str
description: started:
- Start or Stop the container. description:
type: bool - Start or stop the container.
default: true type: bool
''' default: true
"""
EXAMPLES = r''' EXAMPLES = r"""
- name: Execute the run command on rsyslog container image (atomic run rhel7/rsyslog) - name: Execute the run command on rsyslog container image (atomic run rhel7/rsyslog)
community.general.atomic_image: community.general.atomic_image:
name: rhel7/rsyslog name: rhel7/rsyslog
@ -64,15 +64,15 @@ EXAMPLES = r'''
name: busybox name: busybox
state: latest state: latest
backend: ostree backend: ostree
''' """
RETURN = r''' RETURN = r"""
msg: msg:
description: The command standard output description: The command standard output.
returned: always returned: always
type: str type: str
sample: 'Using default tag: latest ...' sample: 'Using default tag: latest ...'
''' """
import traceback import traceback
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,15 +9,14 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: awall module: awall
short_description: Manage awall policies short_description: Manage awall policies
author: Ted Trask (@tdtrask) <ttrask01@yahoo.com> author: Ted Trask (@tdtrask) <ttrask01@yahoo.com>
description: description:
- This modules allows for enable/disable/activate of C(awall) policies. - This modules allows for enable/disable/activate of C(awall) policies.
- Alpine Wall (C(awall)) generates a firewall configuration from the enabled policy files - Alpine Wall (C(awall)) generates a firewall configuration from the enabled policy files and activates the configuration
and activates the configuration on the system. on the system.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -35,7 +34,7 @@ options:
description: description:
- Whether the policies should be enabled or disabled. - Whether the policies should be enabled or disabled.
type: str type: str
choices: [ disabled, enabled ] choices: [disabled, enabled]
default: enabled default: enabled
activate: activate:
description: description:
@ -45,29 +44,29 @@ options:
type: bool type: bool
default: false default: false
notes: notes:
- At least one of O(name) and O(activate) is required. - At least one of O(name) and O(activate) is required.
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Enable "foo" and "bar" policy - name: Enable "foo" and "bar" policy
community.general.awall: community.general.awall:
name: [ foo bar ] name: [foo bar]
state: enabled state: enabled
- name: Disable "foo" and "bar" policy and activate new rules - name: Disable "foo" and "bar" policy and activate new rules
community.general.awall: community.general.awall:
name: name:
- foo - foo
- bar - bar
state: disabled state: disabled
activate: false activate: false
- name: Activate currently enabled firewall rules - name: Activate currently enabled firewall rules
community.general.awall: community.general.awall:
activate: true activate: true
''' """
RETURN = ''' # ''' RETURN = """ # """
import re import re
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,62 +9,59 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: beadm module: beadm
short_description: Manage ZFS boot environments on FreeBSD/Solaris/illumos systems short_description: Manage ZFS boot environments on FreeBSD/Solaris/illumos systems
description: description:
- Create, delete or activate ZFS boot environments. - Create, delete or activate ZFS boot environments.
- Mount and unmount ZFS boot environments. - Mount and unmount ZFS boot environments.
author: Adam Števko (@xen0l) author: Adam Števko (@xen0l)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
description:
- ZFS boot environment name.
type: str
required: true
aliases: [ "be" ]
snapshot:
description:
- If specified, the new boot environment will be cloned from the given
snapshot or inactive boot environment.
type: str
description: description:
description: - ZFS boot environment name.
- Associate a description with a new boot environment. This option is type: str
available only on Solarish platforms. required: true
type: str aliases: ["be"]
options: snapshot:
description: description:
- Create the datasets for new BE with specific ZFS properties. - If specified, the new boot environment will be cloned from the given snapshot or inactive boot environment.
- Multiple options can be specified. type: str
- This option is available only on Solarish platforms. description:
type: str description:
mountpoint: - Associate a description with a new boot environment. This option is available only on Solarish platforms.
description: type: str
- Path where to mount the ZFS boot environment. options:
type: path description:
state: - Create the datasets for new BE with specific ZFS properties.
description: - Multiple options can be specified.
- Create or delete ZFS boot environment. - This option is available only on Solarish platforms.
type: str type: str
choices: [ absent, activated, mounted, present, unmounted ] mountpoint:
default: present description:
force: - Path where to mount the ZFS boot environment.
description: type: path
- Specifies if the unmount should be forced. state:
type: bool description:
default: false - Create or delete ZFS boot environment.
''' type: str
choices: [absent, activated, mounted, present, unmounted]
default: present
force:
description:
- Specifies if the unmount should be forced.
type: bool
default: false
"""
EXAMPLES = r''' EXAMPLES = r"""
- name: Create ZFS boot environment - name: Create ZFS boot environment
community.general.beadm: community.general.beadm:
name: upgrade-be name: upgrade-be
@ -103,45 +100,45 @@ EXAMPLES = r'''
community.general.beadm: community.general.beadm:
name: upgrade-be name: upgrade-be
state: activated state: activated
''' """
RETURN = r''' RETURN = r"""
name: name:
description: BE name description: BE name.
returned: always returned: always
type: str type: str
sample: pre-upgrade sample: pre-upgrade
snapshot: snapshot:
description: ZFS snapshot to create BE from description: ZFS snapshot to create BE from.
returned: always returned: always
type: str type: str
sample: rpool/ROOT/oi-hipster@fresh sample: rpool/ROOT/oi-hipster@fresh
description: description:
description: BE description description: BE description.
returned: always returned: always
type: str type: str
sample: Upgrade from 9.0 to 10.0 sample: Upgrade from 9.0 to 10.0
options: options:
description: BE additional options description: BE additional options.
returned: always returned: always
type: str type: str
sample: compression=on sample: compression=on
mountpoint: mountpoint:
description: BE mountpoint description: BE mountpoint.
returned: always returned: always
type: str type: str
sample: /mnt/be sample: /mnt/be
state: state:
description: state of the target description: State of the target.
returned: always returned: always
type: str type: str
sample: present sample: present
force: force:
description: If forced action is wanted description: If forced action is wanted.
returned: always returned: always
type: bool type: bool
sample: false sample: false
''' """
import os import os
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -7,12 +7,11 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: bearychat module: bearychat
short_description: Send BearyChat notifications short_description: Send BearyChat notifications
description: description:
- The M(community.general.bearychat) module sends notifications to U(https://bearychat.com) - The M(community.general.bearychat) module sends notifications to U(https://bearychat.com) using the Incoming Robot integration.
via the Incoming Robot integration.
author: "Jiangge Zhang (@tonyseek)" author: "Jiangge Zhang (@tonyseek)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -25,8 +24,7 @@ options:
url: url:
type: str type: str
description: description:
- BearyChat WebHook URL. This authenticates you to the bearychat - BearyChat WebHook URL. This authenticates you to the bearychat service. It looks like
service. It looks like
V(https://hook.bearychat.com/=ae2CF/incoming/e61bd5c57b164e04b11ac02e66f47f60). V(https://hook.bearychat.com/=ae2CF/incoming/e61bd5c57b164e04b11ac02e66f47f60).
required: true required: true
text: text:
@ -41,17 +39,16 @@ options:
channel: channel:
type: str type: str
description: description:
- Channel to send the message to. If absent, the message goes to the - Channel to send the message to. If absent, the message goes to the default channel selected by the O(url).
default channel selected by the O(url).
attachments: attachments:
type: list type: list
elements: dict elements: dict
description: description:
- Define a list of attachments. For more information, see - Define a list of attachments. For more information, see
https://github.com/bearyinnovative/bearychat-tutorial/blob/master/robots/incoming.md#attachments U(https://github.com/bearyinnovative/bearychat-tutorial/blob/master/robots/incoming.md#attachments).
''' """
EXAMPLES = """ EXAMPLES = r"""
- name: Send notification message via BearyChat - name: Send notification message via BearyChat
local_action: local_action:
module: bearychat module: bearychat
@ -75,12 +72,12 @@ EXAMPLES = """
- http://example.com/index.png - http://example.com/index.png
""" """
RETURN = """ RETURN = r"""
msg: msg:
description: execution result description: Execution result.
returned: success returned: success
type: str type: str
sample: "OK" sample: "OK"
""" """
try: try:

View File

@ -8,13 +8,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: bigpanda module: bigpanda
author: "Hagai Kariti (@hkariti)" author: "Hagai Kariti (@hkariti)"
short_description: Notify BigPanda about deployments short_description: Notify BigPanda about deployments
description: description:
- Notify BigPanda when deployments start and end (successfully or not). Returns a deployment object containing all the parameters for future module calls. - Notify BigPanda when deployments start and end (successfully or not). Returns a deployment object containing all the parameters
for future module calls.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -26,7 +26,7 @@ options:
component: component:
type: str type: str
description: description:
- "The name of the component being deployed. Ex: billing" - 'The name of the component being deployed. Ex: V(billing).'
required: true required: true
aliases: ['name'] aliases: ['name']
version: version:
@ -55,7 +55,7 @@ options:
env: env:
type: str type: str
description: description:
- The environment name, typically 'production', 'staging', etc. - The environment name, typically V(production), V(staging), and so on.
required: false required: false
owner: owner:
type: str type: str
@ -75,27 +75,27 @@ options:
default: "https://api.bigpanda.io" default: "https://api.bigpanda.io"
validate_certs: validate_certs:
description: description:
- If V(false), SSL certificates for the target url will not be validated. This should only be used - If V(false), SSL certificates for the target url will not be validated. This should only be used on personally controlled
on personally controlled sites using self-signed certificates. sites using self-signed certificates.
required: false required: false
default: true default: true
type: bool type: bool
deployment_message: deployment_message:
type: str type: str
description: description:
- Message about the deployment. - Message about the deployment.
version_added: '0.2.0' version_added: '0.2.0'
source_system: source_system:
type: str type: str
description: description:
- Source system used in the requests to the API - Source system used in the requests to the API.
default: ansible default: ansible
# informational: requirements for nodes # informational: requirements for nodes
requirements: [ ] requirements: []
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Notify BigPanda about a deployment - name: Notify BigPanda about a deployment
community.general.bigpanda: community.general.bigpanda:
component: myapp component: myapp
@ -128,7 +128,7 @@ EXAMPLES = '''
token: '{{ deployment.token }}' token: '{{ deployment.token }}'
state: finished state: finished
delegate_to: localhost delegate_to: localhost
''' """
# =========================================== # ===========================================
# Module execution. # Module execution.

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: bitbucket_access_key module: bitbucket_access_key
short_description: Manages Bitbucket repository access keys short_description: Manages Bitbucket repository access keys
description: description:
@ -33,7 +32,7 @@ options:
workspace: workspace:
description: description:
- The repository owner. - The repository owner.
- "B(Note:) O(ignore:username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of O(user)." - B(Note:) O(ignore:username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of O(user).
type: str type: str
required: true required: true
key: key:
@ -50,13 +49,13 @@ options:
- Indicates desired state of the access key. - Indicates desired state of the access key.
type: str type: str
required: true required: true
choices: [ absent, present ] choices: [absent, present]
notes: notes:
- Bitbucket OAuth consumer or App password should have permissions to read and administrate account repositories. - Bitbucket OAuth consumer or App password should have permissions to read and administrate account repositories.
- Check mode is supported. - Check mode is supported.
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create access key - name: Create access key
community.general.bitbucket_access_key: community.general.bitbucket_access_key:
repository: 'bitbucket-repo' repository: 'bitbucket-repo'
@ -71,9 +70,9 @@ EXAMPLES = r'''
workspace: bitbucket_workspace workspace: bitbucket_workspace
label: Bitbucket label: Bitbucket
state: absent state: absent
''' """
RETURN = r''' # ''' RETURN = r""" # """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: bitbucket_pipeline_key_pair module: bitbucket_pipeline_key_pair
short_description: Manages Bitbucket pipeline SSH key pair short_description: Manages Bitbucket pipeline SSH key pair
description: description:
@ -33,7 +32,7 @@ options:
workspace: workspace:
description: description:
- The repository owner. - The repository owner.
- "B(Note:) O(ignore:username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of O(user)." - B(Note:) O(ignore:username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of O(user).
type: str type: str
required: true required: true
public_key: public_key:
@ -49,12 +48,12 @@ options:
- Indicates desired state of the key pair. - Indicates desired state of the key pair.
type: str type: str
required: true required: true
choices: [ absent, present ] choices: [absent, present]
notes: notes:
- Check mode is supported. - Check mode is supported.
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create or update SSH key pair - name: Create or update SSH key pair
community.general.bitbucket_pipeline_key_pair: community.general.bitbucket_pipeline_key_pair:
repository: 'bitbucket-repo' repository: 'bitbucket-repo'
@ -68,9 +67,9 @@ EXAMPLES = r'''
repository: bitbucket-repo repository: bitbucket-repo
workspace: bitbucket_workspace workspace: bitbucket_workspace
state: absent state: absent
''' """
RETURN = r''' # ''' RETURN = r""" # """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper

View File

@ -8,13 +8,13 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: bitbucket_pipeline_known_host module: bitbucket_pipeline_known_host
short_description: Manages Bitbucket pipeline known hosts short_description: Manages Bitbucket pipeline known hosts
description: description:
- Manages Bitbucket pipeline known hosts under the "SSH Keys" menu. - Manages Bitbucket pipeline known hosts under the "SSH Keys" menu.
- The host fingerprint will be retrieved automatically, but in case of an error, one can use O(key) field to specify it manually. - The host fingerprint will be retrieved automatically, but in case of an error, one can use O(key) field to specify it
manually.
author: author:
- Evgeniy Krysanov (@catcombo) - Evgeniy Krysanov (@catcombo)
extends_documentation_fragment: extends_documentation_fragment:
@ -36,7 +36,7 @@ options:
workspace: workspace:
description: description:
- The repository owner. - The repository owner.
- "B(Note:) O(ignore:username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of O(user)." - B(Note:) O(ignore:username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of O(user).
type: str type: str
required: true required: true
name: name:
@ -53,12 +53,12 @@ options:
- Indicates desired state of the record. - Indicates desired state of the record.
type: str type: str
required: true required: true
choices: [ absent, present ] choices: [absent, present]
notes: notes:
- Check mode is supported. - Check mode is supported.
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create known hosts from the list - name: Create known hosts from the list
community.general.bitbucket_pipeline_known_host: community.general.bitbucket_pipeline_known_host:
repository: 'bitbucket-repo' repository: 'bitbucket-repo'
@ -83,9 +83,9 @@ EXAMPLES = r'''
name: bitbucket.org name: bitbucket.org
key: '{{lookup("file", "bitbucket.pub") }}' key: '{{lookup("file", "bitbucket.pub") }}'
state: absent state: absent
''' """
RETURN = r''' # ''' RETURN = r""" # """
import socket import socket

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: bitbucket_pipeline_variable module: bitbucket_pipeline_variable
short_description: Manages Bitbucket pipeline variables short_description: Manages Bitbucket pipeline variables
description: description:
@ -33,7 +32,7 @@ options:
workspace: workspace:
description: description:
- The repository owner. - The repository owner.
- "B(Note:) O(ignore:username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of O(user)." - B(Note:) O(ignore:username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of O(user).
type: str type: str
required: true required: true
name: name:
@ -55,13 +54,13 @@ options:
- Indicates desired state of the variable. - Indicates desired state of the variable.
type: str type: str
required: true required: true
choices: [ absent, present ] choices: [absent, present]
notes: notes:
- Check mode is supported. - Check mode is supported.
- For secured values return parameter C(changed) is always V(true). - For secured values return parameter C(changed) is always V(true).
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create or update pipeline variables from the list - name: Create or update pipeline variables from the list
community.general.bitbucket_pipeline_variable: community.general.bitbucket_pipeline_variable:
repository: 'bitbucket-repo' repository: 'bitbucket-repo'
@ -71,8 +70,8 @@ EXAMPLES = r'''
secured: '{{ item.secured }}' secured: '{{ item.secured }}'
state: present state: present
with_items: with_items:
- { name: AWS_ACCESS_KEY, value: ABCD1234, secured: false } - {name: AWS_ACCESS_KEY, value: ABCD1234, secured: false}
- { name: AWS_SECRET, value: qwe789poi123vbn0, secured: true } - {name: AWS_SECRET, value: qwe789poi123vbn0, secured: true}
- name: Remove pipeline variable - name: Remove pipeline variable
community.general.bitbucket_pipeline_variable: community.general.bitbucket_pipeline_variable:
@ -80,9 +79,9 @@ EXAMPLES = r'''
workspace: bitbucket_workspace workspace: bitbucket_workspace
name: AWS_ACCESS_KEY name: AWS_ACCESS_KEY
state: absent state: absent
''' """
RETURN = r''' # ''' RETURN = r""" # """
from ansible.module_utils.basic import AnsibleModule, _load_params from ansible.module_utils.basic import AnsibleModule, _load_params
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper

View File

@ -8,34 +8,32 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: bootc_manage module: bootc_manage
version_added: 9.3.0 version_added: 9.3.0
author: author:
- Ryan Cook (@cooktheryan) - Ryan Cook (@cooktheryan)
short_description: Bootc Switch and Upgrade short_description: Bootc Switch and Upgrade
description: description:
- This module manages the switching and upgrading of C(bootc). - This module manages the switching and upgrading of C(bootc).
options: options:
state: state:
description: description:
- 'Control to apply the latest image or switch the image.' - Control whether to apply the latest image or switch the image.
- 'B(Note:) This will not reboot the system.' - B(Note:) This will not reboot the system.
- 'Please use M(ansible.builtin.reboot) to reboot the system.' - Please use M(ansible.builtin.reboot) to reboot the system.
required: true required: true
type: str type: str
choices: ['switch', 'latest'] choices: ['switch', 'latest']
image: image:
description: description:
- 'The image to switch to.' - The image to switch to.
- 'This is required when O(state=switch).' - This is required when O(state=switch).
required: false required: false
type: str type: str
"""
''' EXAMPLES = r"""
EXAMPLES = '''
# Switch to a different image # Switch to a different image
- name: Provide image to switch to a different image and retain the current running image - name: Provide image to switch to a different image and retain the current running image
community.general.bootc_manage: community.general.bootc_manage:
@ -46,10 +44,10 @@ EXAMPLES = '''
- name: Apply updates of the current running image - name: Apply updates of the current running image
community.general.bootc_manage: community.general.bootc_manage:
state: latest state: latest
''' """
RETURN = ''' RETURN = r"""
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: bower module: bower
short_description: Manage bower packages with bower short_description: Manage bower packages with C(bower)
description: description:
- Manage bower packages with bower - Manage bower packages with C(bower).
author: "Michael Warkentin (@mwarkentin)" author: "Michael Warkentin (@mwarkentin)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -27,39 +26,39 @@ options:
name: name:
type: str type: str
description: description:
- The name of a bower package to install - The name of a bower package to install.
offline: offline:
description: description:
- Install packages from local cache, if the packages were installed before - Install packages from local cache, if the packages were installed before.
type: bool type: bool
default: false default: false
production: production:
description: description:
- Install with --production flag - Install with C(--production) flag.
type: bool type: bool
default: false default: false
path: path:
type: path type: path
description: description:
- The base path where to install the bower packages - The base path where to install the bower packages.
required: true required: true
relative_execpath: relative_execpath:
type: path type: path
description: description:
- Relative path to bower executable from install path - Relative path to bower executable from install path.
state: state:
type: str type: str
description: description:
- The state of the bower package - The state of the bower package.
default: present default: present
choices: [ "present", "absent", "latest" ] choices: ["present", "absent", "latest"]
version: version:
type: str type: str
description: description:
- The version to be installed - The version to be installed.
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Install "bootstrap" bower package. - name: Install "bootstrap" bower package.
community.general.bower: community.general.bower:
name: bootstrap name: bootstrap
@ -91,7 +90,8 @@ EXAMPLES = '''
- community.general.bower: - community.general.bower:
path: /app/location path: /app/location
relative_execpath: node_modules/.bin relative_execpath: node_modules/.bin
''' """
import json import json
import os import os

View File

@ -7,78 +7,73 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: btrfs_info module: btrfs_info
short_description: Query btrfs filesystem info short_description: Query btrfs filesystem info
version_added: "6.6.0" version_added: "6.6.0"
description: Query status of available btrfs filesystems, including uuid, label, subvolumes and mountpoints. description: Query status of available btrfs filesystems, including UUID, label, subvolumes and mountpoints.
author: author:
- Gregory Furlong (@gnfzdz) - Gregory Furlong (@gnfzdz)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
- community.general.attributes.info_module - community.general.attributes.info_module
''' """
EXAMPLES = r'''
EXAMPLES = r"""
- name: Query information about mounted btrfs filesystems - name: Query information about mounted btrfs filesystems
community.general.btrfs_info: community.general.btrfs_info:
register: my_btrfs_info register: my_btrfs_info
"""
''' RETURN = r"""
RETURN = r'''
filesystems: filesystems:
description: Summaries of the current state for all btrfs filesystems found on the target host. description: Summaries of the current state for all btrfs filesystems found on the target host.
type: list type: list
elements: dict elements: dict
returned: success returned: success
contains: contains:
uuid: uuid:
description: A unique identifier assigned to the filesystem. description: A unique identifier assigned to the filesystem.
type: str type: str
sample: 96c9c605-1454-49b8-a63a-15e2584c208e sample: 96c9c605-1454-49b8-a63a-15e2584c208e
label: label:
description: An optional label assigned to the filesystem. description: An optional label assigned to the filesystem.
type: str type: str
sample: Tank sample: Tank
devices: devices:
description: A list of devices assigned to the filesystem. description: A list of devices assigned to the filesystem.
type: list type: list
sample: sample:
- /dev/sda1 - /dev/sda1
- /dev/sdb1 - /dev/sdb1
default_subvolume: default_subvolume:
description: The id of the filesystem's default subvolume. description: The id of the filesystem's default subvolume.
type: int type: int
sample: 5 sample: 5
subvolumes: subvolumes:
description: A list of dicts containing metadata for all of the filesystem's subvolumes. description: A list of dicts containing metadata for all of the filesystem's subvolumes.
type: list type: list
elements: dict elements: dict
contains: contains:
id: id:
description: An identifier assigned to the subvolume, unique within the containing filesystem. description: An identifier assigned to the subvolume, unique within the containing filesystem.
type: int type: int
sample: 256 sample: 256
mountpoints: mountpoints:
description: Paths where the subvolume is mounted on the targeted host. description: Paths where the subvolume is mounted on the targeted host.
type: list type: list
sample: ['/home'] sample: ['/home']
parent: parent:
description: The identifier of this subvolume's parent. description: The identifier of this subvolume's parent.
type: int type: int
sample: 5 sample: 5
path: path:
description: The full path of the subvolume relative to the btrfs fileystem's root. description: The full path of the subvolume relative to the btrfs fileystem's root.
type: str type: str
sample: /@home sample: /@home
"""
'''
from ansible_collections.community.general.plugins.module_utils.btrfs import BtrfsFilesystemsProvider from ansible_collections.community.general.plugins.module_utils.btrfs import BtrfsFilesystemsProvider

View File

@ -7,8 +7,7 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: btrfs_subvolume module: btrfs_subvolume
short_description: Manage btrfs subvolumes short_description: Manage btrfs subvolumes
version_added: "6.6.0" version_added: "6.6.0"
@ -16,71 +15,73 @@ version_added: "6.6.0"
description: Creates, updates and deletes btrfs subvolumes and snapshots. description: Creates, updates and deletes btrfs subvolumes and snapshots.
options: options:
automount: automount:
description: description:
- Allow the module to temporarily mount the targeted btrfs filesystem in order to validate the current state and make any required changes. - Allow the module to temporarily mount the targeted btrfs filesystem in order to validate the current state and make
type: bool any required changes.
default: false type: bool
default: default: false
description: default:
- Make the subvolume specified by O(name) the filesystem's default subvolume. description:
type: bool - Make the subvolume specified by O(name) the filesystem's default subvolume.
default: false type: bool
filesystem_device: default: false
description: filesystem_device:
- A block device contained within the btrfs filesystem to be targeted. description:
- Useful when multiple btrfs filesystems are present to specify which filesystem should be targeted. - A block device contained within the btrfs filesystem to be targeted.
type: path - Useful when multiple btrfs filesystems are present to specify which filesystem should be targeted.
filesystem_label: type: path
description: filesystem_label:
- A descriptive label assigned to the btrfs filesystem to be targeted. description:
- Useful when multiple btrfs filesystems are present to specify which filesystem should be targeted. - A descriptive label assigned to the btrfs filesystem to be targeted.
type: str - Useful when multiple btrfs filesystems are present to specify which filesystem should be targeted.
filesystem_uuid: type: str
description: filesystem_uuid:
- A unique identifier assigned to the btrfs filesystem to be targeted. description:
- Useful when multiple btrfs filesystems are present to specify which filesystem should be targeted. - A unique identifier assigned to the btrfs filesystem to be targeted.
type: str - Useful when multiple btrfs filesystems are present to specify which filesystem should be targeted.
name: type: str
description: name:
- Name of the subvolume/snapshot to be targeted. description:
required: true - Name of the subvolume/snapshot to be targeted.
type: str required: true
recursive: type: str
description: recursive:
- When true, indicates that parent/child subvolumes should be created/removedas necessary description:
to complete the operation (for O(state=present) and O(state=absent) respectively). - When true, indicates that parent/child subvolumes should be created/removedas necessary to complete the operation
type: bool (for O(state=present) and O(state=absent) respectively).
default: false type: bool
snapshot_source: default: false
description: snapshot_source:
- Identifies the source subvolume for the created snapshot. description:
- Infers that the created subvolume is a snapshot. - Identifies the source subvolume for the created snapshot.
type: str - Infers that the created subvolume is a snapshot.
snapshot_conflict: type: str
description: snapshot_conflict:
- Policy defining behavior when a subvolume already exists at the path of the requested snapshot. description:
- V(skip) - Create a snapshot only if a subvolume does not yet exist at the target location, otherwise indicate that no change is required. - Policy defining behavior when a subvolume already exists at the path of the requested snapshot.
Warning, this option does not yet verify that the target subvolume was generated from a snapshot of the requested source. - V(skip) - Create a snapshot only if a subvolume does not yet exist at the target location, otherwise indicate that
- V(clobber) - If a subvolume already exists at the requested location, delete it first. no change is required. Warning, this option does not yet verify that the target subvolume was generated from a snapshot
This option is not idempotent and will result in a new snapshot being generated on every execution. of the requested source.
- V(error) - If a subvolume already exists at the requested location, return an error. - V(clobber) - If a subvolume already exists at the requested location, delete it first. This option is not idempotent
This option is not idempotent and will result in an error on replay of the module. and will result in a new snapshot being generated on every execution.
type: str - V(error) - If a subvolume already exists at the requested location, return an error. This option is not idempotent
choices: [ skip, clobber, error ] and will result in an error on replay of the module.
default: skip type: str
state: choices: [skip, clobber, error]
description: default: skip
- Indicates the current state of the targeted subvolume. state:
type: str description:
choices: [ absent, present ] - Indicates the current state of the targeted subvolume.
default: present type: str
choices: [absent, present]
default: present
notes: notes:
- If any or all of the options O(filesystem_device), O(filesystem_label) or O(filesystem_uuid) parameters are provided, there is expected - If any or all of the options O(filesystem_device), O(filesystem_label) or O(filesystem_uuid) parameters are provided,
to be a matching btrfs filesystem. If none are provided and only a single btrfs filesystem exists or only a single there is expected to be a matching btrfs filesystem. If none are provided and only a single btrfs filesystem exists or
btrfs filesystem is mounted, that filesystem will be used; otherwise, the module will take no action and return an error. only a single btrfs filesystem is mounted, that filesystem will be used; otherwise, the module will take no action and
return an error.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -88,17 +89,16 @@ attributes:
check_mode: check_mode:
support: partial support: partial
details: details:
- In some scenarios it may erroneously report intermediate subvolumes being created. - In some scenarios it may erroneously report intermediate subvolumes being created. After mounting, if a directory
After mounting, if a directory like file is found where the subvolume would have been created, the operation is skipped. like file is found where the subvolume would have been created, the operation is skipped.
diff_mode: diff_mode:
support: none support: none
author: author:
- Gregory Furlong (@gnfzdz) - Gregory Furlong (@gnfzdz)
''' """
EXAMPLES = r'''
EXAMPLES = r"""
- name: Create a @home subvolume under the root subvolume - name: Create a @home subvolume under the root subvolume
community.general.btrfs_subvolume: community.general.btrfs_subvolume:
name: /@home name: /@home
@ -127,85 +127,83 @@ EXAMPLES = r'''
community.general.btrfs_subvolume: community.general.btrfs_subvolume:
name: /@snapshots/@2022_06_09 name: /@snapshots/@2022_06_09
snapshot_source: /@ snapshot_source: /@
recursive: True recursive: true
filesystem_device: /dev/vda2 filesystem_device: /dev/vda2
- name: Remove the /@ subvolume and recursively delete child subvolumes as required - name: Remove the /@ subvolume and recursively delete child subvolumes as required
community.general.btrfs_subvolume: community.general.btrfs_subvolume:
name: /@snapshots/@2022_06_09 name: /@snapshots/@2022_06_09
snapshot_source: /@ snapshot_source: /@
recursive: True recursive: true
filesystem_device: /dev/vda2 filesystem_device: /dev/vda2
"""
''' RETURN = r"""
RETURN = r'''
filesystem: filesystem:
description: description:
- A summary of the final state of the targeted btrfs filesystem. - A summary of the final state of the targeted btrfs filesystem.
type: dict type: dict
returned: success returned: success
contains: contains:
uuid: uuid:
description: A unique identifier assigned to the filesystem. description: A unique identifier assigned to the filesystem.
returned: success returned: success
type: str type: str
sample: 96c9c605-1454-49b8-a63a-15e2584c208e sample: 96c9c605-1454-49b8-a63a-15e2584c208e
label: label:
description: An optional label assigned to the filesystem. description: An optional label assigned to the filesystem.
returned: success returned: success
type: str type: str
sample: Tank sample: Tank
devices: devices:
description: A list of devices assigned to the filesystem. description: A list of devices assigned to the filesystem.
returned: success returned: success
type: list type: list
sample: sample:
- /dev/sda1 - /dev/sda1
- /dev/sdb1 - /dev/sdb1
default_subvolume: default_subvolume:
description: The ID of the filesystem's default subvolume. description: The ID of the filesystem's default subvolume.
returned: success and if filesystem is mounted returned: success and if filesystem is mounted
type: int type: int
sample: 5 sample: 5
subvolumes: subvolumes:
description: A list of dicts containing metadata for all of the filesystem's subvolumes. description: A list of dicts containing metadata for all of the filesystem's subvolumes.
returned: success and if filesystem is mounted returned: success and if filesystem is mounted
type: list type: list
elements: dict elements: dict
contains: contains:
id: id:
description: An identifier assigned to the subvolume, unique within the containing filesystem. description: An identifier assigned to the subvolume, unique within the containing filesystem.
type: int type: int
sample: 256 sample: 256
mountpoints: mountpoints:
description: Paths where the subvolume is mounted on the targeted host. description: Paths where the subvolume is mounted on the targeted host.
type: list type: list
sample: ['/home'] sample: ['/home']
parent: parent:
description: The identifier of this subvolume's parent. description: The identifier of this subvolume's parent.
type: int type: int
sample: 5 sample: 5
path: path:
description: The full path of the subvolume relative to the btrfs fileystem's root. description: The full path of the subvolume relative to the btrfs fileystem's root.
type: str type: str
sample: /@home sample: /@home
modifications: modifications:
description: description:
- A list where each element describes a change made to the target btrfs filesystem. - A list where each element describes a change made to the target btrfs filesystem.
type: list type: list
returned: Success returned: Success
elements: str elements: str
target_subvolume_id: target_subvolume_id:
description: description:
- The ID of the subvolume specified with the O(name) parameter, either pre-existing or created as part of module execution. - The ID of the subvolume specified with the O(name) parameter, either pre-existing or created as part of module execution.
type: int type: int
sample: 257 sample: 257
returned: Success and subvolume exists after module execution returned: Success and subvolume exists after module execution
''' """
from ansible_collections.community.general.plugins.module_utils.btrfs import BtrfsFilesystemsProvider, BtrfsCommands, BtrfsModuleException from ansible_collections.community.general.plugins.module_utils.btrfs import BtrfsFilesystemsProvider, BtrfsCommands, BtrfsModuleException
from ansible_collections.community.general.plugins.module_utils.btrfs import normalize_subvolume_path from ansible_collections.community.general.plugins.module_utils.btrfs import normalize_subvolume_path

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: bundler module: bundler
short_description: Manage Ruby Gem dependencies with Bundler short_description: Manage Ruby Gem dependencies with Bundler
description: description:
- Manage installation and Gem version dependencies for Ruby using the Bundler gem - Manage installation and Gem version dependencies for Ruby using the Bundler gem.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -26,80 +25,72 @@ options:
executable: executable:
type: str type: str
description: description:
- The path to the bundler executable - The path to the bundler executable.
state: state:
type: str type: str
description: description:
- The desired state of the Gem bundle. V(latest) updates gems to the most recent, acceptable version - The desired state of the Gem bundle. V(latest) updates gems to the most recent, acceptable version.
choices: [present, latest] choices: [present, latest]
default: present default: present
chdir: chdir:
type: path type: path
description: description:
- The directory to execute the bundler commands from. This directory - The directory to execute the bundler commands from. This directory needs to contain a valid Gemfile or .bundle/ directory.
needs to contain a valid Gemfile or .bundle/ directory - If not specified, it will default to the temporary working directory.
- If not specified, it will default to the temporary working directory
exclude_groups: exclude_groups:
type: list type: list
elements: str elements: str
description: description:
- A list of Gemfile groups to exclude during operations. This only - A list of Gemfile groups to exclude during operations. This only applies when O(state=present). Bundler considers
applies when O(state=present). Bundler considers this this a 'remembered' property for the Gemfile and will automatically exclude groups in future operations even if O(exclude_groups)
a 'remembered' property for the Gemfile and will automatically exclude is not set.
groups in future operations even if O(exclude_groups) is not set
clean: clean:
description: description:
- Only applies if O(state=present). If set removes any gems on the - Only applies if O(state=present). If set removes any gems on the target host that are not in the gemfile.
target host that are not in the gemfile
type: bool type: bool
default: false default: false
gemfile: gemfile:
type: path type: path
description: description:
- Only applies if O(state=present). The path to the gemfile to use to install gems. - Only applies if O(state=present). The path to the gemfile to use to install gems.
- If not specified it will default to the Gemfile in current directory - If not specified it will default to the Gemfile in current directory.
local: local:
description: description:
- If set only installs gems from the cache on the target host - If set only installs gems from the cache on the target host.
type: bool type: bool
default: false default: false
deployment_mode: deployment_mode:
description: description:
- Only applies if O(state=present). If set it will install gems in - Only applies if O(state=present). If set it will install gems in C(./vendor/bundle) instead of the default location.
./vendor/bundle instead of the default location. Requires a Gemfile.lock Requires a C(Gemfile.lock) file to have been created prior.
file to have been created prior
type: bool type: bool
default: false default: false
user_install: user_install:
description: description:
- Only applies if O(state=present). Installs gems in the local user's cache or for all users - Only applies if O(state=present). Installs gems in the local user's cache or for all users.
type: bool type: bool
default: true default: true
gem_path: gem_path:
type: path type: path
description: description:
- Only applies if O(state=present). Specifies the directory to - Only applies if O(state=present). Specifies the directory to install the gems into. If O(chdir) is set then this path
install the gems into. If O(chdir) is set then this path is relative to is relative to O(chdir).
O(chdir)
- If not specified the default RubyGems gem paths will be used. - If not specified the default RubyGems gem paths will be used.
binstub_directory: binstub_directory:
type: path type: path
description: description:
- Only applies if O(state=present). Specifies the directory to - Only applies if O(state=present). Specifies the directory to install any gem bins files to. When executed the bin
install any gem bins files to. When executed the bin files will run files will run within the context of the Gemfile and fail if any required gem dependencies are not installed. If O(chdir)
within the context of the Gemfile and fail if any required gem is set then this path is relative to O(chdir).
dependencies are not installed. If O(chdir) is set then this path is
relative to O(chdir)
extra_args: extra_args:
type: str type: str
description: description:
- A space separated string of additional commands that can be applied to - A space separated string of additional commands that can be applied to the Bundler command. Refer to the Bundler documentation
the Bundler command. Refer to the Bundler documentation for more for more information.
information
author: "Tim Hoiberg (@thoiberg)" author: "Tim Hoiberg (@thoiberg)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Install gems from a Gemfile in the current directory - name: Install gems from a Gemfile in the current directory
community.general.bundler: community.general.bundler:
state: present state: present
@ -124,7 +115,7 @@ EXAMPLES = '''
community.general.bundler: community.general.bundler:
state: latest state: latest
chdir: ~/rails_project chdir: ~/rails_project
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,59 +9,55 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: bzr module: bzr
author: author:
- André Paramés (@andreparames) - André Paramés (@andreparames)
short_description: Deploy software (or files) from bzr branches short_description: Deploy software (or files) from bzr branches
description: description:
- Manage C(bzr) branches to deploy files or software. - Manage C(bzr) branches to deploy files or software.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: none support: none
diff_mode: diff_mode:
support: none support: none
options: options:
name: name:
description: description:
- SSH or HTTP protocol address of the parent branch. - SSH or HTTP protocol address of the parent branch.
aliases: [ parent ] aliases: [parent]
required: true required: true
type: str type: str
dest: dest:
description: description:
- Absolute path of where the branch should be cloned to. - Absolute path of where the branch should be cloned to.
required: true required: true
type: path type: path
version: version:
description: description:
- What version of the branch to clone. This can be the - What version of the branch to clone. This can be the bzr revno or revid.
bzr revno or revid. default: head
default: head type: str
type: str force:
force: description:
description: - If V(true), any modified files in the working tree will be discarded.
- If V(true), any modified files in the working type: bool
tree will be discarded. default: false
type: bool executable:
default: false description:
executable: - Path to bzr executable to use. If not supplied, the normal mechanism for resolving binary paths will be used.
description: type: str
- Path to bzr executable to use. If not supplied, """
the normal mechanism for resolving binary paths will be used.
type: str
'''
EXAMPLES = ''' EXAMPLES = r"""
- name: Checkout - name: Checkout
community.general.bzr: community.general.bzr:
name: bzr+ssh://foosball.example.org/path/to/branch name: bzr+ssh://foosball.example.org/path/to/branch
dest: /srv/checkout dest: /srv/checkout
version: 22 version: 22
''' """
import os import os
import re import re