u[a-s]*: normalize docs (#9338)

* u[a-s]*: normalize docs

* Update plugins/modules/udm_dns_record.py

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

* Update plugins/modules/udm_dns_record.py

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

* Update plugins/modules/udm_dns_record.py

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

* Update plugins/modules/udm_dns_zone.py

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

* Update plugins/modules/ufw.py

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

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/9371/head
Alexei Znamensky 2024-12-25 00:00:30 +13:00 committed by GitHub
parent b429e8a2cf
commit 2005125af4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 846 additions and 888 deletions

View File

@ -10,63 +10,60 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: udm_dns_record module: udm_dns_record
author: author:
- Tobias Rüetschi (@keachi) - Tobias Rüetschi (@keachi)
short_description: Manage dns entries on a univention corporate server short_description: Manage dns entries on a univention corporate server
description: description:
- "This module allows to manage dns records on a univention corporate server (UCS). - This module allows to manage dns records on a univention corporate server (UCS). It uses the Python API of the UCS to create a new object
It uses the python API of the UCS to create a new object or edit it." or edit it.
requirements: requirements:
- Univention - Univention
- ipaddress (for O(type=ptr_record)) - ipaddress (for O(type=ptr_record))
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: partial support: partial
options: options:
state: state:
type: str type: str
default: "present" default: "present"
choices: [ present, absent ] choices: [present, absent]
description: description:
- Whether the dns record is present or not. - Whether the dns record is present or not.
name: name:
type: str type: str
required: true required: true
description: description:
- "Name of the record, this is also the DNS record. E.g. www for - Name of the record, this is also the DNS record. For example V(www) for www.example.com.
www.example.com." - For PTR records this has to be the IP address.
- For PTR records this has to be the IP address. zone:
zone: type: str
type: str required: true
required: true description:
description: - Corresponding DNS zone for this record, for example V(example.com).
- Corresponding DNS zone for this record, e.g. example.com. - For PTR records this has to be the full reverse zone (for example V(1.1.192.in-addr.arpa)).
- For PTR records this has to be the full reverse zone (for example V(1.1.192.in-addr.arpa)). type:
type: type: str
type: str required: true
required: true description:
description: - Define the record type. V(host_record) is a A or AAAA record, V(alias) is a CNAME, V(ptr_record) is a PTR record, V(srv_record) is a SRV
- "Define the record type. V(host_record) is a A or AAAA record, record and V(txt_record) is a TXT record.
V(alias) is a CNAME, V(ptr_record) is a PTR record, V(srv_record) - 'The available choices are: V(host_record), V(alias), V(ptr_record), V(srv_record), V(txt_record).'
is a SRV record and V(txt_record) is a TXT record." data:
- "The available choices are: V(host_record), V(alias), V(ptr_record), V(srv_record), V(txt_record)." type: dict
data: default: {}
type: dict description:
default: {} - "Additional data for this record, for example V({'a': '192.0.2.1'})."
description: - Required if O(state=present).
- "Additional data for this record, for example V({'a': '192.0.2.1'})." """
- Required if O(state=present).
'''
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a DNS record on a UCS - name: Create a DNS record on a UCS
community.general.udm_dns_record: community.general.udm_dns_record:
name: www name: www
@ -74,8 +71,8 @@ EXAMPLES = '''
type: host_record type: host_record
data: data:
a: a:
- 192.0.2.1 - 192.0.2.1
- 2001:0db8::42 - 2001:0db8::42
- name: Create a DNS v4 PTR record on a UCS - name: Create a DNS v4 PTR record on a UCS
community.general.udm_dns_record: community.general.udm_dns_record:
@ -92,10 +89,10 @@ EXAMPLES = '''
type: ptr_record type: ptr_record
data: data:
ptr_record: "www.example.com." ptr_record: "www.example.com."
''' """
RETURN = '''#''' RETURN = """#"""
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -10,91 +10,87 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: udm_dns_zone module: udm_dns_zone
author: author:
- Tobias Rüetschi (@keachi) - Tobias Rüetschi (@keachi)
short_description: Manage dns zones on a univention corporate server short_description: Manage dns zones on a univention corporate server
description: description:
- "This module allows to manage dns zones on a univention corporate server (UCS). - This module allows to manage dns zones on a univention corporate server (UCS). It uses the Python API of the UCS to create a new object or
It uses the python API of the UCS to create a new object or edit it." edit it.
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: partial support: partial
options: options:
state: state:
type: str type: str
default: "present" default: "present"
choices: [ present, absent ] choices: [present, absent]
description: description:
- Whether the dns zone is present or not. - Whether the DNS zone is present or not.
type: type:
type: str type: str
required: true required: true
description: description:
- Define if the zone is a forward or reverse DNS zone. - Define if the zone is a forward or reverse DNS zone.
- "The available choices are: V(forward_zone), V(reverse_zone)." - 'The available choices are: V(forward_zone), V(reverse_zone).'
zone: zone:
type: str type: str
required: true required: true
description: description:
- DNS zone name, for example V(example.com). - DNS zone name, for example V(example.com).
aliases: [name] aliases: [name]
nameserver: nameserver:
type: list type: list
elements: str elements: str
default: [] default: []
description: description:
- List of appropriate name servers. Required if O(state=present). - List of appropriate name servers. Required if O(state=present).
interfaces: interfaces:
type: list type: list
elements: str elements: str
default: [] default: []
description: description:
- List of interface IP addresses, on which the server should - List of interface IP addresses, on which the server should response this zone. Required if O(state=present).
response this zone. Required if O(state=present). refresh:
type: int
refresh: default: 3600
type: int description:
default: 3600 - Interval before the zone should be refreshed.
description: retry:
- Interval before the zone should be refreshed. type: int
retry: default: 1800
type: int description:
default: 1800 - Interval that should elapse before a failed refresh should be retried.
description: expire:
- Interval that should elapse before a failed refresh should be retried. type: int
expire: default: 604800
type: int description:
default: 604800 - Specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.
description: ttl:
- Specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative. type: int
ttl: default: 600
type: int description:
default: 600 - Minimum TTL field that should be exported with any RR from this zone.
description: contact:
- Minimum TTL field that should be exported with any RR from this zone. type: str
default: ''
contact: description:
type: str - Contact person in the SOA record.
default: '' mx:
description: type: list
- Contact person in the SOA record. elements: str
mx: default: []
type: list description:
elements: str - List of MX servers. (Must declared as A or AAAA records).
default: [] """
description:
- List of MX servers. (Must declared as A or AAAA records).
'''
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a DNS zone on a UCS - name: Create a DNS zone on a UCS
community.general.udm_dns_zone: community.general.udm_dns_zone:
zone: example.com zone: example.com
@ -103,10 +99,10 @@ EXAMPLES = '''
- ucs.example.com - ucs.example.com
interfaces: interfaces:
- 192.0.2.1 - 192.0.2.1
''' """
RETURN = '''# ''' RETURN = """# """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.univention_umc import ( from ansible_collections.community.general.plugins.module_utils.univention_umc import (

View File

@ -10,63 +10,61 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: udm_group module: udm_group
author: author:
- Tobias Rüetschi (@keachi) - Tobias Rüetschi (@keachi)
short_description: Manage of the posix group short_description: Manage of the posix group
description: description:
- "This module allows to manage user groups on a univention corporate server (UCS). - This module allows to manage user groups on a univention corporate server (UCS). It uses the Python API of the UCS to create a new object
It uses the python API of the UCS to create a new object or edit it." or edit it.
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: partial support: partial
options: options:
state: state:
required: false required: false
default: "present" default: "present"
choices: [ present, absent ] choices: [present, absent]
description:
- Whether the group is present or not.
type: str
name:
required: true
description:
- Name of the posix group.
type: str
description: description:
required: false - Whether the group is present or not.
description: type: str
- Group description. name:
type: str required: true
position: description:
required: false - Name of the POSIX group.
description: type: str
- define the whole ldap position of the group, e.g. description:
C(cn=g123m-1A,cn=classes,cn=schueler,cn=groups,ou=schule,dc=example,dc=com). required: false
type: str description:
default: '' - Group description.
ou: type: str
required: false position:
description: required: false
- LDAP OU, e.g. school for LDAP OU C(ou=school,dc=example,dc=com). description:
type: str - Define the whole LDAP position of the group, for example V(cn=g123m-1A,cn=classes,cn=schueler,cn=groups,ou=schule,dc=example,dc=com).
default: '' type: str
subpath: default: ''
required: false ou:
description: required: false
- Subpath inside the OU, e.g. C(cn=classes,cn=students,cn=groups). description:
type: str - LDAP OU, for example V(school) for LDAP OU V(ou=school,dc=example,dc=com).
default: "cn=groups" type: str
''' default: ''
subpath:
required: false
description:
- Subpath inside the OU, for example V(cn=classes,cn=students,cn=groups).
type: str
default: "cn=groups"
"""
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a POSIX group - name: Create a POSIX group
community.general.udm_group: community.general.udm_group:
name: g123m-1A name: g123m-1A
@ -84,10 +82,10 @@ EXAMPLES = '''
community.general.udm_group: community.general.udm_group:
name: g123m-1A name: g123m-1A
position: 'cn=classes,cn=students,cn=groups,ou=school,dc=school,dc=example,dc=com' position: 'cn=classes,cn=students,cn=groups,ou=school,dc=school,dc=example,dc=com'
''' """
RETURN = '''# ''' RETURN = """# """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.univention_umc import ( from ansible_collections.community.general.plugins.module_utils.univention_umc import (

View File

@ -10,339 +10,337 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: udm_share module: udm_share
author: author:
- Tobias Rüetschi (@keachi) - Tobias Rüetschi (@keachi)
short_description: Manage samba shares on a univention corporate server short_description: Manage samba shares on a univention corporate server
description: description:
- "This module allows to manage samba shares on a univention corporate - This module allows to manage samba shares on a univention corporate server (UCS). It uses the Python API of the UCS to create a new object
server (UCS). or edit it.
It uses the python API of the UCS to create a new object or edit it."
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: partial support: partial
options: options:
state: state:
default: "present" default: "present"
choices: [ present, absent ] choices: [present, absent]
description: description:
- Whether the share is present or not. - Whether the share is present or not.
type: str type: str
name: name:
required: true required: true
description: description:
- Name - Name.
type: str type: str
host: host:
required: false required: false
description: description:
- Host FQDN (server which provides the share), for example V({{ ansible_fqdn }}). Required if O(state=present). - Host FQDN (server which provides the share), for example V({{ ansible_fqdn }}). Required if O(state=present).
type: str type: str
path: path:
required: false required: false
description: description:
- Directory on the providing server, for example V(/home). Required if O(state=present). - Directory on the providing server, for example V(/home). Required if O(state=present).
type: path type: path
sambaName: sambaName:
required: false required: false
description: description:
- Windows name. Required if O(state=present). - Windows name. Required if O(state=present).
type: str type: str
aliases: [ samba_name ] aliases: [samba_name]
ou: ou:
required: true required: true
description: description:
- Organisational unit, inside the LDAP Base DN. - Organisational unit, inside the LDAP Base DN.
type: str type: str
owner: owner:
default: '0' default: '0'
description: description:
- Directory owner of the share's root directory. - Directory owner of the share's root directory.
type: str type: str
group: group:
default: '0' default: '0'
description: description:
- Directory owner group of the share's root directory. - Directory owner group of the share's root directory.
type: str type: str
directorymode: directorymode:
default: '00755' default: '00755'
description: description:
- Permissions for the share's root directory. - Permissions for the share's root directory.
type: str type: str
root_squash: root_squash:
default: true default: true
description: description:
- Modify user ID for root user (root squashing). - Modify user ID for root user (root squashing).
type: bool type: bool
subtree_checking: subtree_checking:
default: true default: true
description: description:
- Subtree checking. - Subtree checking.
type: bool type: bool
sync: sync:
default: 'sync' default: 'sync'
description: description:
- NFS synchronisation. - NFS synchronisation.
type: str type: str
writeable: writeable:
default: true default: true
description: description:
- NFS write access. - NFS write access.
type: bool type: bool
sambaBlockSize: sambaBlockSize:
description: description:
- Blocking size. - Blocking size.
type: str type: str
aliases: [ samba_block_size ] aliases: [samba_block_size]
sambaBlockingLocks: sambaBlockingLocks:
default: true default: true
description: description:
- Blocking locks. - Blocking locks.
type: bool type: bool
aliases: [ samba_blocking_locks ] aliases: [samba_blocking_locks]
sambaBrowseable: sambaBrowseable:
description: description:
- Show in Windows network environment. - Show in Windows network environment.
type: bool type: bool
default: true default: true
aliases: [ samba_browsable ] aliases: [samba_browsable]
sambaCreateMode: sambaCreateMode:
default: '0744' default: '0744'
description: description:
- File mode. - File mode.
type: str type: str
aliases: [ samba_create_mode ] aliases: [samba_create_mode]
sambaCscPolicy: sambaCscPolicy:
default: 'manual' default: 'manual'
description: description:
- Client-side caching policy. - Client-side caching policy.
type: str type: str
aliases: [ samba_csc_policy ] aliases: [samba_csc_policy]
sambaCustomSettings: sambaCustomSettings:
default: [] default: []
description: description:
- Option name in smb.conf and its value. - Option name in smb.conf and its value.
type: list type: list
elements: dict elements: dict
aliases: [ samba_custom_settings ] aliases: [samba_custom_settings]
sambaDirectoryMode: sambaDirectoryMode:
default: '0755' default: '0755'
description: description:
- Directory mode. - Directory mode.
type: str type: str
aliases: [ samba_directory_mode ] aliases: [samba_directory_mode]
sambaDirectorySecurityMode: sambaDirectorySecurityMode:
default: '0777' default: '0777'
description: description:
- Directory security mode. - Directory security mode.
type: str type: str
aliases: [ samba_directory_security_mode ] aliases: [samba_directory_security_mode]
sambaDosFilemode: sambaDosFilemode:
default: false default: false
description: description:
- Users with write access may modify permissions. - Users with write access may modify permissions.
type: bool type: bool
aliases: [ samba_dos_filemode ] aliases: [samba_dos_filemode]
sambaFakeOplocks: sambaFakeOplocks:
default: false default: false
description: description:
- Fake oplocks. - Fake oplocks.
type: bool type: bool
aliases: [ samba_fake_oplocks ] aliases: [samba_fake_oplocks]
sambaForceCreateMode: sambaForceCreateMode:
default: false default: false
description: description:
- Force file mode. - Force file mode.
type: bool type: bool
aliases: [ samba_force_create_mode ] aliases: [samba_force_create_mode]
sambaForceDirectoryMode: sambaForceDirectoryMode:
default: false default: false
description: description:
- Force directory mode. - Force directory mode.
type: bool type: bool
aliases: [ samba_force_directory_mode ] aliases: [samba_force_directory_mode]
sambaForceDirectorySecurityMode: sambaForceDirectorySecurityMode:
default: false default: false
description: description:
- Force directory security mode. - Force directory security mode.
type: bool type: bool
aliases: [ samba_force_directory_security_mode ] aliases: [samba_force_directory_security_mode]
sambaForceGroup: sambaForceGroup:
description: description:
- Force group. - Force group.
type: str type: str
aliases: [ samba_force_group ] aliases: [samba_force_group]
sambaForceSecurityMode: sambaForceSecurityMode:
default: false default: false
description: description:
- Force security mode. - Force security mode.
type: bool type: bool
aliases: [ samba_force_security_mode ] aliases: [samba_force_security_mode]
sambaForceUser: sambaForceUser:
description: description:
- Force user. - Force user.
type: str type: str
aliases: [ samba_force_user ] aliases: [samba_force_user]
sambaHideFiles: sambaHideFiles:
description: description:
- Hide files. - Hide files.
type: str type: str
aliases: [ samba_hide_files ] aliases: [samba_hide_files]
sambaHideUnreadable: sambaHideUnreadable:
default: false default: false
description: description:
- Hide unreadable files/directories. - Hide unreadable files/directories.
type: bool type: bool
aliases: [ samba_hide_unreadable ] aliases: [samba_hide_unreadable]
sambaHostsAllow: sambaHostsAllow:
default: [] default: []
description: description:
- Allowed host/network. - Allowed host/network.
type: list type: list
elements: str elements: str
aliases: [ samba_hosts_allow ] aliases: [samba_hosts_allow]
sambaHostsDeny: sambaHostsDeny:
default: [] default: []
description: description:
- Denied host/network. - Denied host/network.
type: list type: list
elements: str elements: str
aliases: [ samba_hosts_deny ] aliases: [samba_hosts_deny]
sambaInheritAcls: sambaInheritAcls:
default: true default: true
description: description:
- Inherit ACLs. - Inherit ACLs.
type: bool type: bool
aliases: [ samba_inherit_acls ] aliases: [samba_inherit_acls]
sambaInheritOwner: sambaInheritOwner:
default: false default: false
description: description:
- Create files/directories with the owner of the parent directory. - Create files/directories with the owner of the parent directory.
type: bool type: bool
aliases: [ samba_inherit_owner ] aliases: [samba_inherit_owner]
sambaInheritPermissions: sambaInheritPermissions:
default: false default: false
description: description:
- Create files/directories with permissions of the parent directory. - Create files/directories with permissions of the parent directory.
type: bool type: bool
aliases: [ samba_inherit_permissions ] aliases: [samba_inherit_permissions]
sambaInvalidUsers: sambaInvalidUsers:
description: description:
- Invalid users or groups. - Invalid users or groups.
type: str type: str
aliases: [ samba_invalid_users ] aliases: [samba_invalid_users]
sambaLevel2Oplocks: sambaLevel2Oplocks:
default: true default: true
description: description:
- Level 2 oplocks. - Level 2 oplocks.
type: bool type: bool
aliases: [ samba_level_2_oplocks ] aliases: [samba_level_2_oplocks]
sambaLocking: sambaLocking:
default: true default: true
description: description:
- Locking. - Locking.
type: bool type: bool
aliases: [ samba_locking ] aliases: [samba_locking]
sambaMSDFSRoot: sambaMSDFSRoot:
default: false default: false
description: description:
- MSDFS root. - MSDFS root.
type: bool type: bool
aliases: [ samba_msdfs_root ] aliases: [samba_msdfs_root]
sambaNtAclSupport: sambaNtAclSupport:
default: true default: true
description: description:
- NT ACL support. - NT ACL support.
type: bool type: bool
aliases: [ samba_nt_acl_support ] aliases: [samba_nt_acl_support]
sambaOplocks: sambaOplocks:
default: true default: true
description: description:
- Oplocks. - Oplocks.
type: bool type: bool
aliases: [ samba_oplocks ] aliases: [samba_oplocks]
sambaPostexec: sambaPostexec:
description: description:
- Postexec script. - Postexec script.
type: str type: str
aliases: [ samba_postexec ] aliases: [samba_postexec]
sambaPreexec: sambaPreexec:
description: description:
- Preexec script. - Preexec script.
type: str type: str
aliases: [ samba_preexec ] aliases: [samba_preexec]
sambaPublic: sambaPublic:
default: false default: false
description: description:
- Allow anonymous read-only access with a guest user. - Allow anonymous read-only access with a guest user.
type: bool type: bool
aliases: [ samba_public ] aliases: [samba_public]
sambaSecurityMode: sambaSecurityMode:
default: '0777' default: '0777'
description: description:
- Security mode. - Security mode.
type: str type: str
aliases: [ samba_security_mode ] aliases: [samba_security_mode]
sambaStrictLocking: sambaStrictLocking:
default: 'Auto' default: 'Auto'
description: description:
- Strict locking. - Strict locking.
type: str type: str
aliases: [ samba_strict_locking ] aliases: [samba_strict_locking]
sambaVFSObjects: sambaVFSObjects:
description: description:
- VFS objects. - VFS objects.
type: str type: str
aliases: [ samba_vfs_objects ] aliases: [samba_vfs_objects]
sambaValidUsers: sambaValidUsers:
description: description:
- Valid users or groups. - Valid users or groups.
type: str type: str
aliases: [ samba_valid_users ] aliases: [samba_valid_users]
sambaWriteList: sambaWriteList:
description: description:
- Restrict write access to these users/groups. - Restrict write access to these users/groups.
type: str type: str
aliases: [ samba_write_list ] aliases: [samba_write_list]
sambaWriteable: sambaWriteable:
default: true default: true
description: description:
- Samba write access. - Samba write access.
type: bool type: bool
aliases: [ samba_writeable ] aliases: [samba_writeable]
nfs_hosts: nfs_hosts:
default: [] default: []
description: description:
- Only allow access for this host, IP address or network. - Only allow access for this host, IP address or network.
type: list type: list
elements: str elements: str
nfsCustomSettings: nfsCustomSettings:
default: [] default: []
description: description:
- Option name in exports file. - Option name in exports file.
type: list type: list
elements: str elements: str
aliases: [ nfs_custom_settings ] aliases: [nfs_custom_settings]
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a share named home on the server ucs.example.com with the path /home - name: Create a share named home on the server ucs.example.com with the path /home
community.general.udm_share: community.general.udm_share:
name: home name: home
path: /home path: /home
host: ucs.example.com host: ucs.example.com
sambaName: Home sambaName: Home
''' """
RETURN = '''# ''' RETURN = """# """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.univention_umc import ( from ansible_collections.community.general.plugins.module_utils.univention_umc import (

View File

@ -10,297 +10,285 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: udm_user module: udm_user
author: author:
- Tobias Rüetschi (@keachi) - Tobias Rüetschi (@keachi)
short_description: Manage posix users on a univention corporate server short_description: Manage posix users on a univention corporate server
description: description:
- "This module allows to manage posix users on a univention corporate - This module allows to manage posix users on a univention corporate server (UCS). It uses the Python API of the UCS to create a new object
server (UCS). or edit it.
It uses the python API of the UCS to create a new object or edit it."
notes: notes:
- This module requires the deprecated L(crypt Python module, - This module requires the deprecated L(crypt Python module, https://docs.python.org/3.12/library/crypt.html) library which was removed from
https://docs.python.org/3.12/library/crypt.html) library which was removed from Python 3.13. Python 3.13. For Python 3.13 or newer, you need to install L(legacycrypt, https://pypi.org/project/legacycrypt/).
For Python 3.13 or newer, you need to install L(legacycrypt, https://pypi.org/project/legacycrypt/).
requirements: requirements:
- legacycrypt (on Python 3.13 or newer) - legacycrypt (on Python 3.13 or newer)
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: partial support: partial
options: options:
state: state:
default: "present" default: "present"
choices: [ present, absent ] choices: [present, absent]
description:
- Whether the user is present or not.
type: str
username:
required: true
description:
- User name
aliases: ['name']
type: str
firstname:
description:
- First name. Required if O(state=present).
type: str
lastname:
description:
- Last name. Required if O(state=present).
type: str
password:
description:
- Password. Required if O(state=present).
type: str
birthday:
description:
- Birthday
type: str
city:
description:
- City of users business address.
type: str
country:
description:
- Country of users business address.
type: str
department_number:
description:
- Department number of users business address.
aliases: [ departmentNumber ]
type: str
description: description:
description: - Whether the user is present or not.
- Description (not gecos) type: str
type: str username:
display_name: required: true
description: description:
- Display name (not gecos) - User name.
aliases: [ displayName ] aliases: ['name']
type: str type: str
email: firstname:
default: [''] description:
description: - First name. Required if O(state=present).
- A list of e-mail addresses. type: str
type: list lastname:
elements: str description:
employee_number: - Last name. Required if O(state=present).
description: type: str
- Employee number password:
aliases: [ employeeNumber ] description:
type: str - Password. Required if O(state=present).
employee_type: type: str
description: birthday:
- Employee type description:
aliases: [ employeeType ] - Birthday.
type: str type: str
gecos: city:
description: description:
- GECOS - City of users business address.
type: str type: str
groups: country:
default: [] description:
description: - Country of users business address.
- "POSIX groups, the LDAP DNs of the groups will be found with the type: str
LDAP filter for each group as $GROUP: department_number:
V((&(objectClass=posixGroup\\)(cn=$GROUP\\)\\))." description:
type: list - Department number of users business address.
elements: str aliases: [departmentNumber]
home_share: type: str
description: description:
- "Home NFS share. Must be a LDAP DN, e.g. description:
V(cn=home,cn=shares,ou=school,dc=example,dc=com)." - Description (not gecos).
aliases: [ homeShare ] type: str
type: str display_name:
home_share_path: description:
description: - Display name (not gecos).
- Path to home NFS share, inside the homeShare. aliases: [displayName]
aliases: [ homeSharePath ] type: str
type: str email:
home_telephone_number: default: ['']
default: [] description:
description: - A list of e-mail addresses.
- List of private telephone numbers. type: list
aliases: [ homeTelephoneNumber ] elements: str
type: list employee_number:
elements: str description:
homedrive: - Employee number.
description: aliases: [employeeNumber]
- Windows home drive, for example V("H:"). type: str
type: str employee_type:
mail_alternative_address: description:
default: [] - Employee type.
description: aliases: [employeeType]
- List of alternative e-mail addresses. type: str
aliases: [ mailAlternativeAddress ] gecos:
type: list description:
elements: str - GECOS.
mail_home_server: type: str
description: groups:
- FQDN of mail server default: []
aliases: [ mailHomeServer ] description:
type: str - 'POSIX groups, the LDAP DNs of the groups will be found with the LDAP filter for each group as $GROUP: V((&(objectClass=posixGroup\)(cn=$GROUP\)\)).'
mail_primary_address: type: list
description: elements: str
- Primary e-mail address home_share:
aliases: [ mailPrimaryAddress ] description:
type: str - Home NFS share. Must be a LDAP DN, for example V(cn=home,cn=shares,ou=school,dc=example,dc=com).
mobile_telephone_number: aliases: [homeShare]
default: [] type: str
description: home_share_path:
- Mobile phone number description:
aliases: [ mobileTelephoneNumber ] - Path to home NFS share, inside the homeShare.
type: list aliases: [homeSharePath]
elements: str type: str
organisation: home_telephone_number:
description: default: []
- Organisation description:
aliases: [ organization ] - List of private telephone numbers.
type: str aliases: [homeTelephoneNumber]
overridePWHistory: type: list
type: bool elements: str
default: false homedrive:
description: description:
- Override password history - Windows home drive, for example V("H:").
aliases: [ override_pw_history ] type: str
overridePWLength: mail_alternative_address:
type: bool default: []
default: false description:
description: - List of alternative e-mail addresses.
- Override password check aliases: [mailAlternativeAddress]
aliases: [ override_pw_length ] type: list
pager_telephonenumber: elements: str
default: [] mail_home_server:
description: description:
- List of pager telephone numbers. - FQDN of mail server.
aliases: [ pagerTelephonenumber ] aliases: [mailHomeServer]
type: list type: str
elements: str mail_primary_address:
phone: description:
description: - Primary e-mail address.
- List of telephone numbers. aliases: [mailPrimaryAddress]
type: list type: str
elements: str mobile_telephone_number:
default: [] default: []
postcode: description:
description: - Mobile phone number.
- Postal code of users business address. aliases: [mobileTelephoneNumber]
type: str type: list
primary_group: elements: str
description: organisation:
- Primary group. This must be the group LDAP DN. description:
- If not specified, it defaults to V(cn=Domain Users,cn=groups,$LDAP_BASE_DN). - Organisation.
aliases: [ primaryGroup ] aliases: [organization]
type: str type: str
profilepath: overridePWHistory:
description: type: bool
- Windows profile directory default: false
type: str description:
pwd_change_next_login: - Override password history.
choices: [ '0', '1' ] aliases: [override_pw_history]
description: overridePWLength:
- Change password on next login. type: bool
aliases: [ pwdChangeNextLogin ] default: false
type: str description:
room_number: - Override password check.
description: aliases: [override_pw_length]
- Room number of users business address. pager_telephonenumber:
aliases: [ roomNumber ] default: []
type: str description:
samba_privileges: - List of pager telephone numbers.
description: aliases: [pagerTelephonenumber]
- "Samba privilege, like allow printer administration, do domain type: list
join." elements: str
aliases: [ sambaPrivileges ] phone:
type: list description:
elements: str - List of telephone numbers.
default: [] type: list
samba_user_workstations: elements: str
description: default: []
- Allow the authentication only on this Microsoft Windows host. postcode:
aliases: [ sambaUserWorkstations ] description:
type: list - Postal code of users business address.
elements: str type: str
default: [] primary_group:
sambahome: description:
description: - Primary group. This must be the group LDAP DN.
- Windows home path, for example V('\\\\$FQDN\\$USERNAME'). - If not specified, it defaults to V(cn=Domain Users,cn=groups,$LDAP_BASE_DN).
type: str aliases: [primaryGroup]
scriptpath: type: str
description: profilepath:
- Windows logon script. description:
type: str - Windows profile directory.
secretary: type: str
default: [] pwd_change_next_login:
description: choices: ['0', '1']
- A list of superiors as LDAP DNs. description:
type: list - Change password on next login.
elements: str aliases: [pwdChangeNextLogin]
serviceprovider: type: str
default: [''] room_number:
description: description:
- Enable user for the following service providers. - Room number of users business address.
type: list aliases: [roomNumber]
elements: str type: str
shell: samba_privileges:
default: '/bin/bash' description:
description: - Samba privilege, like allow printer administration, do domain join.
- Login shell aliases: [sambaPrivileges]
type: str type: list
street: elements: str
description: default: []
- Street of users business address. samba_user_workstations:
type: str description:
title: - Allow the authentication only on this Microsoft Windows host.
description: aliases: [sambaUserWorkstations]
- Title, for example V(Prof.). type: list
type: str elements: str
unixhome: default: []
description: sambahome:
- Unix home directory description:
- If not specified, it defaults to C(/home/$USERNAME). - Windows home path, for example V('\\\\$FQDN\\$USERNAME').
type: str type: str
userexpiry: scriptpath:
description: description:
- Account expiry date, for example V(1999-12-31). - Windows logon script.
- If not specified, it defaults to the current day plus one year. type: str
type: str secretary:
position: default: []
default: '' description:
description: - A list of superiors as LDAP DNs.
- "Define the whole position of users object inside the LDAP tree, type: list
for example V(cn=employee,cn=users,ou=school,dc=example,dc=com)." elements: str
type: str serviceprovider:
update_password: default: ['']
default: always description:
choices: [ always, on_create ] - Enable user for the following service providers.
description: type: list
- "V(always) will update passwords if they differ. elements: str
V(on_create) will only set the password for newly created users." shell:
type: str default: '/bin/bash'
ou: description:
default: '' - Login shell.
description: type: str
- "Organizational Unit inside the LDAP Base DN, for example V(school) for street:
LDAP OU C(ou=school,dc=example,dc=com)." description:
type: str - Street of users business address.
subpath: type: str
default: 'cn=users' title:
description: description:
- "LDAP subpath inside the organizational unit, for example - Title, for example V(Prof.).
V(cn=teachers,cn=users) for LDAP container type: str
C(cn=teachers,cn=users,dc=example,dc=com)." unixhome:
type: str description:
''' - Unix home directory.
- If not specified, it defaults to C(/home/$USERNAME).
type: str
userexpiry:
description:
- Account expiry date, for example V(1999-12-31).
- If not specified, it defaults to the current day plus one year.
type: str
position:
default: ''
description:
- Define the whole position of users object inside the LDAP tree, for example V(cn=employee,cn=users,ou=school,dc=example,dc=com).
type: str
update_password:
default: always
choices: [always, on_create]
description:
- V(always) will update passwords if they differ. V(on_create) will only set the password for newly created users.
type: str
ou:
default: ''
description:
- Organizational Unit inside the LDAP Base DN, for example V(school) for LDAP OU C(ou=school,dc=example,dc=com).
type: str
subpath:
default: 'cn=users'
description:
- LDAP subpath inside the organizational unit, for example V(cn=teachers,cn=users) for LDAP container C(cn=teachers,cn=users,dc=example,dc=com).
type: str
"""
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a user on a UCS - name: Create a user on a UCS
community.general.udm_user: community.general.udm_user:
name: FooBar name: FooBar
@ -325,10 +313,10 @@ EXAMPLES = '''
firstname: Foo firstname: Foo
lastname: Bar lastname: Bar
position: 'cn=teachers,cn=users,ou=school,dc=school,dc=example,dc=com' position: 'cn=teachers,cn=users,ou=school,dc=school,dc=example,dc=com'
''' """
RETURN = '''# ''' RETURN = """# """
from datetime import date, timedelta from datetime import date, timedelta
import traceback import traceback

View File

@ -11,26 +11,24 @@
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: ufw module: ufw
short_description: Manage firewall with UFW short_description: Manage firewall with UFW
description: description:
- Manage firewall with UFW. - Manage firewall with UFW.
author: author:
- Aleksey Ovcharenko (@ovcharenko) - Aleksey Ovcharenko (@ovcharenko)
- Jarno Keskikangas (@pyykkis) - Jarno Keskikangas (@pyykkis)
- Ahti Kitsik (@ahtik) - Ahti Kitsik (@ahtik)
notes: notes:
- See C(man ufw) for more examples. - See C(man ufw) for more examples.
- > - "B(Warning:) Whilst the module itself can be run using concurrent strategies, C(ufw) does not support concurrency, as firewall rules are meant
B(Warning:) Whilst the module itself can be run using concurrent strategies, C(ufw) does not support concurrency, to be ordered and parallel executions do not guarantee order. B(Do not use concurrency:) The results are unpredictable and the module may
as firewall rules are meant to be ordered and parallel executions do not guarantee order. fail silently if you do."
B(Do not use concurrency:) The results are unpredictable and the module may fail silently if you do.
requirements: requirements:
- C(ufw) package - C(ufw) package
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -44,59 +42,52 @@ options:
- V(reloaded) reloads firewall. - V(reloaded) reloads firewall.
- V(reset) disables and resets firewall to installation defaults. - V(reset) disables and resets firewall to installation defaults.
type: str type: str
choices: [ disabled, enabled, reloaded, reset ] choices: [disabled, enabled, reloaded, reset]
default: default:
description: description:
- Change the default policy for incoming or outgoing traffic. - Change the default policy for incoming or outgoing traffic.
type: str type: str
choices: [ allow, deny, reject ] choices: [allow, deny, reject]
aliases: [ policy ] aliases: [policy]
direction: direction:
description: description:
- Select direction for a rule or default policy command. Mutually - Select direction for a rule or default policy command. Mutually exclusive with O(interface_in) and O(interface_out).
exclusive with O(interface_in) and O(interface_out).
type: str type: str
choices: [ in, incoming, out, outgoing, routed ] choices: [in, incoming, out, outgoing, routed]
logging: logging:
description: description:
- Toggles logging. Logged packets use the LOG_KERN syslog facility. - Toggles logging. Logged packets use the LOG_KERN syslog facility.
type: str type: str
choices: [ 'on', 'off', low, medium, high, full ] choices: ['on', 'off', low, medium, high, full]
insert: insert:
description: description:
- Insert the corresponding rule as rule number NUM. - Insert the corresponding rule as rule number NUM.
- Note that ufw numbers rules starting with 1. - Note that ufw numbers rules starting with 1.
- If O(delete=true) and a value is provided for O(insert), - If O(delete=true) and a value is provided for O(insert), then O(insert) is ignored.
then O(insert) is ignored.
type: int type: int
insert_relative_to: insert_relative_to:
description: description:
- Allows to interpret the index in O(insert) relative to a position. - Allows to interpret the index in O(insert) relative to a position.
- V(zero) interprets the rule number as an absolute index (i.e. 1 is - V(zero) interprets the rule number as an absolute index (that is, 1 is the first rule).
the first rule). - V(first-ipv4) interprets the rule number relative to the index of the first IPv4 rule, or relative to the position where the first IPv4
- V(first-ipv4) interprets the rule number relative to the index of the rule would be if there is currently none.
first IPv4 rule, or relative to the position where the first IPv4 rule - V(last-ipv4) interprets the rule number relative to the index of the last IPv4 rule, or relative to the position where the last IPv4 rule
would be if there is currently none. would be if there is currently none.
- V(last-ipv4) interprets the rule number relative to the index of the - V(first-ipv6) interprets the rule number relative to the index of the first IPv6 rule, or relative to the position where the first IPv6
last IPv4 rule, or relative to the position where the last IPv4 rule rule would be if there is currently none.
would be if there is currently none. - V(last-ipv6) interprets the rule number relative to the index of the last IPv6 rule, or relative to the position where the last IPv6 rule
- V(first-ipv6) interprets the rule number relative to the index of the
first IPv6 rule, or relative to the position where the first IPv6 rule
would be if there is currently none.
- V(last-ipv6) interprets the rule number relative to the index of the
last IPv6 rule, or relative to the position where the last IPv6 rule
would be if there is currently none. would be if there is currently none.
type: str type: str
choices: [ first-ipv4, first-ipv6, last-ipv4, last-ipv6, zero ] choices: [first-ipv4, first-ipv6, last-ipv4, last-ipv6, zero]
default: zero default: zero
rule: rule:
description: description:
- Add firewall rule - Add firewall rule.
type: str type: str
choices: [ allow, deny, limit, reject ] choices: [allow, deny, limit, reject]
log: log:
description: description:
- Log new connections matched to this rule - Log new connections matched to this rule.
type: bool type: bool
default: false default: false
from_ip: from_ip:
@ -104,7 +95,7 @@ options:
- Source IP address. - Source IP address.
type: str type: str
default: any default: any
aliases: [ from, src ] aliases: [from, src]
from_port: from_port:
description: description:
- Source port. - Source port.
@ -114,54 +105,49 @@ options:
- Destination IP address. - Destination IP address.
type: str type: str
default: any default: any
aliases: [ dest, to] aliases: [dest, to]
to_port: to_port:
description: description:
- Destination port. - Destination port.
type: str type: str
aliases: [ port ] aliases: [port]
proto: proto:
description: description:
- TCP/IP protocol. - TCP/IP protocol.
type: str type: str
choices: [ any, tcp, udp, ipv6, esp, ah, gre, igmp ] choices: [any, tcp, udp, ipv6, esp, ah, gre, igmp]
aliases: [ protocol ] aliases: [protocol]
name: name:
description: description:
- Use profile located in C(/etc/ufw/applications.d). - Use profile located in C(/etc/ufw/applications.d).
type: str type: str
aliases: [ app ] aliases: [app]
delete: delete:
description: description:
- Delete rule. - Delete rule.
- If O(delete=true) and a value is provided for O(insert), - If O(delete=true) and a value is provided for O(insert), then O(insert) is ignored.
then O(insert) is ignored.
type: bool type: bool
default: false default: false
interface: interface:
description: description:
- Specify interface for the rule. The direction (in or out) used - Specify interface for the rule. The direction (in or out) used for the interface depends on the value of O(direction). See O(interface_in)
for the interface depends on the value of O(direction). See and O(interface_out) for routed rules that needs to supply both an input and output interface. Mutually exclusive with O(interface_in)
O(interface_in) and O(interface_out) for routed rules that needs and O(interface_out).
to supply both an input and output interface. Mutually
exclusive with O(interface_in) and O(interface_out).
type: str type: str
aliases: [ if ] aliases: [if]
interface_in: interface_in:
description: description:
- Specify input interface for the rule. This is mutually - Specify input interface for the rule. This is mutually exclusive with O(direction) and O(interface). However, it is compatible with O(interface_out)
exclusive with O(direction) and O(interface). However, it is for routed rules.
compatible with O(interface_out) for routed rules.
type: str type: str
aliases: [ if_in ] aliases: [if_in]
version_added: '0.2.0' version_added: '0.2.0'
interface_out: interface_out:
description: description:
- Specify output interface for the rule. This is mutually - Specify output interface for the rule. This is mutually exclusive with O(direction) and O(interface). However, it is compatible with O(interface_in)
exclusive with O(direction) and O(interface). However, it is for routed rules.
compatible with O(interface_in) for routed rules.
type: str type: str
aliases: [ if_out ] aliases: [if_out]
version_added: '0.2.0' version_added: '0.2.0'
route: route:
description: description:
@ -172,9 +158,9 @@ options:
description: description:
- Add a comment to the rule. Requires UFW version >=0.35. - Add a comment to the rule. Requires UFW version >=0.35.
type: str type: str
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Allow everything and enable UFW - name: Allow everything and enable UFW
community.general.ufw: community.general.ufw:
state: enabled state: enabled
@ -299,7 +285,7 @@ EXAMPLES = r'''
route: true route: true
src: 192.0.2.0/24 src: 192.0.2.0/24
dest: 198.51.100.0/24 dest: 198.51.100.0/24
''' """
import re import re

View File

@ -8,44 +8,43 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: uptimerobot module: uptimerobot
short_description: Pause and start Uptime Robot monitoring short_description: Pause and start Uptime Robot monitoring
description: description:
- This module will let you start and pause Uptime Robot Monitoring - This module will let you start and pause Uptime Robot Monitoring.
author: "Nate Kingsley (@nate-kingsley)" author: "Nate Kingsley (@nate-kingsley)"
requirements: requirements:
- Valid Uptime Robot API Key - Valid Uptime Robot API Key
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:
state: state:
type: str type: str
description: description:
- Define whether or not the monitor should be running or paused. - Define whether or not the monitor should be running or paused.
required: true required: true
choices: [ "started", "paused" ] choices: ["started", "paused"]
monitorid: monitorid:
type: str type: str
description: description:
- ID of the monitor to check. - ID of the monitor to check.
required: true required: true
apikey: apikey:
type: str type: str
description: description:
- Uptime Robot API key. - Uptime Robot API key.
required: true required: true
notes: notes:
- Support for adding and removing monitors and alert contacts has not yet been implemented. - Support for adding and removing monitors and alert contacts has not yet been implemented.
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Pause the monitor with an ID of 12345 - name: Pause the monitor with an ID of 12345
community.general.uptimerobot: community.general.uptimerobot:
monitorid: 12345 monitorid: 12345
@ -57,7 +56,7 @@ EXAMPLES = '''
monitorid: 12345 monitorid: 12345
apikey: 12345-1234512345 apikey: 12345-1234512345
state: started state: started
''' """
import json import json

View File

@ -11,12 +11,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: urpmi module: urpmi
short_description: Urpmi manager short_description: Urpmi manager
description: description:
- Manages packages with C(urpmi) (such as for Mageia or Mandriva) - Manages packages with C(urpmi) (such as for Mageia or Mandriva).
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -29,13 +28,13 @@ options:
description: description:
- A list of package names to install, upgrade or remove. - A list of package names to install, upgrade or remove.
required: true required: true
aliases: [ package, pkg ] aliases: [package, pkg]
type: list type: list
elements: str elements: str
state: state:
description: description:
- Indicates the desired package state. - Indicates the desired package state.
choices: [ absent, present, installed, removed ] choices: [absent, present, installed, removed]
default: present default: present
type: str type: str
update_cache: update_cache:
@ -50,21 +49,19 @@ options:
default: true default: true
force: force:
description: description:
- Assume "yes" is the answer to any question urpmi has to ask. - Assume "yes" is the answer to any question urpmi has to ask. Corresponds to the C(--force) option for C(urpmi).
Corresponds to the C(--force) option for C(urpmi).
type: bool type: bool
default: true default: true
root: root:
description: description:
- Specifies an alternative install root, relative to which all packages will be installed. - Specifies an alternative install root, relative to which all packages will be installed. Corresponds to the C(--root) option for C(urpmi).
Corresponds to the C(--root) option for C(urpmi). aliases: [installroot]
aliases: [ installroot ]
type: str type: str
author: author:
- Philippe Makowski (@pmakowski) - Philippe Makowski (@pmakowski)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Install package foo - name: Install package foo
community.general.urpmi: community.general.urpmi:
pkg: foo pkg: foo
@ -85,7 +82,7 @@ EXAMPLES = '''
name: bar name: bar
state: present state: present
update_cache: true update_cache: true
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: usb_facts module: usb_facts
short_description: Allows listing information about USB devices short_description: Allows listing information about USB devices
version_added: 8.5.0 version_added: 8.5.0
@ -25,9 +24,9 @@ extends_documentation_fragment:
- community.general.attributes.facts_module - community.general.attributes.facts_module
requirements: requirements:
- lsusb binary on PATH (usually installed through the package usbutils and preinstalled on many systems) - lsusb binary on PATH (usually installed through the package usbutils and preinstalled on many systems)
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Get information about USB devices - name: Get information about USB devices
community.general.usb_facts: community.general.usb_facts:
@ -35,9 +34,9 @@ EXAMPLES = '''
ansible.builtin.debug: ansible.builtin.debug:
msg: "On bus {{ item.bus }} device {{ item.device }} with id {{ item.id }} is {{ item.name }}" msg: "On bus {{ item.bus }} device {{ item.device }} with id {{ item.id }} is {{ item.name }}"
loop: "{{ ansible_facts.usb_devices }}" loop: "{{ ansible_facts.usb_devices }}"
''' """
RETURN = r''' RETURN = r"""
ansible_facts: ansible_facts:
description: Dictionary containing details of connected USB devices. description: Dictionary containing details of connected USB devices.
returned: always returned: always
@ -69,7 +68,7 @@ ansible_facts:
returned: always returned: always
type: str type: str
sample: Linux Foundation 2.0 root hub sample: Linux Foundation 2.0 root hub
''' """
import re import re
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule