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,15 +10,14 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: udm_dns_record
author:
- Tobias Rüetschi (@keachi)
short_description: Manage dns entries on a univention corporate server
description:
- "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 or edit it."
- 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
or edit it.
requirements:
- Univention
- ipaddress (for O(type=ptr_record))
@ -33,40 +32,38 @@ options:
state:
type: str
default: "present"
choices: [ present, absent ]
choices: [present, absent]
description:
- Whether the dns record is present or not.
name:
type: str
required: true
description:
- "Name of the record, this is also the DNS record. E.g. www for
www.example.com."
- Name of the record, this is also the DNS record. For example V(www) for www.example.com.
- For PTR records this has to be the IP address.
zone:
type: str
required: true
description:
- Corresponding DNS zone for this record, e.g. example.com.
- Corresponding DNS zone for this record, for example V(example.com).
- For PTR records this has to be the full reverse zone (for example V(1.1.192.in-addr.arpa)).
type:
type: str
required: true
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 record and V(txt_record) is a TXT record."
- "The available choices are: V(host_record), V(alias), V(ptr_record), V(srv_record), V(txt_record)."
- 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
record and V(txt_record) is a TXT record.
- 'The available choices are: V(host_record), V(alias), V(ptr_record), V(srv_record), V(txt_record).'
data:
type: dict
default: {}
description:
- "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
community.general.udm_dns_record:
name: www
@ -92,10 +89,10 @@ EXAMPLES = '''
type: ptr_record
data:
ptr_record: "www.example.com."
'''
"""
RETURN = '''#'''
RETURN = """#"""
from ansible.module_utils.basic import AnsibleModule

View File

@ -10,15 +10,14 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: udm_dns_zone
author:
- Tobias Rüetschi (@keachi)
short_description: Manage dns zones on a univention corporate server
description:
- "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 edit it."
- 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
edit it.
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -30,15 +29,15 @@ options:
state:
type: str
default: "present"
choices: [ present, absent ]
choices: [present, absent]
description:
- Whether the dns zone is present or not.
- Whether the DNS zone is present or not.
type:
type: str
required: true
description:
- 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:
type: str
required: true
@ -56,9 +55,7 @@ options:
elements: str
default: []
description:
- List of interface IP addresses, on which the server should
response this zone. Required if O(state=present).
- List of interface IP addresses, on which the server should response this zone. Required if O(state=present).
refresh:
type: int
default: 3600
@ -79,7 +76,6 @@ options:
default: 600
description:
- Minimum TTL field that should be exported with any RR from this zone.
contact:
type: str
default: ''
@ -91,10 +87,10 @@ options:
default: []
description:
- List of MX servers. (Must declared as A or AAAA records).
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create a DNS zone on a UCS
community.general.udm_dns_zone:
zone: example.com
@ -103,10 +99,10 @@ EXAMPLES = '''
- ucs.example.com
interfaces:
- 192.0.2.1
'''
"""
RETURN = '''# '''
RETURN = """# """
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.univention_umc import (

View File

@ -10,15 +10,14 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: udm_group
author:
- Tobias Rüetschi (@keachi)
short_description: Manage of the posix group
description:
- "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 or edit it."
- 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
or edit it.
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -30,14 +29,14 @@ options:
state:
required: false
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.
- Name of the POSIX group.
type: str
description:
required: false
@ -47,26 +46,25 @@ options:
position:
required: false
description:
- define the whole ldap position of the group, e.g.
C(cn=g123m-1A,cn=classes,cn=schueler,cn=groups,ou=schule,dc=example,dc=com).
- 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).
type: str
default: ''
ou:
required: false
description:
- LDAP OU, e.g. school for LDAP OU C(ou=school,dc=example,dc=com).
- LDAP OU, for example V(school) for LDAP OU V(ou=school,dc=example,dc=com).
type: str
default: ''
subpath:
required: false
description:
- Subpath inside the OU, e.g. C(cn=classes,cn=students,cn=groups).
- 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
community.general.udm_group:
name: g123m-1A
@ -84,10 +82,10 @@ EXAMPLES = '''
community.general.udm_group:
name: g123m-1A
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_collections.community.general.plugins.module_utils.univention_umc import (

View File

@ -10,16 +10,14 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: udm_share
author:
- Tobias Rüetschi (@keachi)
short_description: Manage samba shares on a univention corporate server
description:
- "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 or edit it."
- 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
or edit it.
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -30,14 +28,14 @@ attributes:
options:
state:
default: "present"
choices: [ present, absent ]
choices: [present, absent]
description:
- Whether the share is present or not.
type: str
name:
required: true
description:
- Name
- Name.
type: str
host:
required: false
@ -54,7 +52,7 @@ options:
description:
- Windows name. Required if O(state=present).
type: str
aliases: [ samba_name ]
aliases: [samba_name]
ou:
required: true
description:
@ -99,223 +97,223 @@ options:
description:
- Blocking size.
type: str
aliases: [ samba_block_size ]
aliases: [samba_block_size]
sambaBlockingLocks:
default: true
description:
- Blocking locks.
type: bool
aliases: [ samba_blocking_locks ]
aliases: [samba_blocking_locks]
sambaBrowseable:
description:
- Show in Windows network environment.
type: bool
default: true
aliases: [ samba_browsable ]
aliases: [samba_browsable]
sambaCreateMode:
default: '0744'
description:
- File mode.
type: str
aliases: [ samba_create_mode ]
aliases: [samba_create_mode]
sambaCscPolicy:
default: 'manual'
description:
- Client-side caching policy.
type: str
aliases: [ samba_csc_policy ]
aliases: [samba_csc_policy]
sambaCustomSettings:
default: []
description:
- Option name in smb.conf and its value.
type: list
elements: dict
aliases: [ samba_custom_settings ]
aliases: [samba_custom_settings]
sambaDirectoryMode:
default: '0755'
description:
- Directory mode.
type: str
aliases: [ samba_directory_mode ]
aliases: [samba_directory_mode]
sambaDirectorySecurityMode:
default: '0777'
description:
- Directory security mode.
type: str
aliases: [ samba_directory_security_mode ]
aliases: [samba_directory_security_mode]
sambaDosFilemode:
default: false
description:
- Users with write access may modify permissions.
type: bool
aliases: [ samba_dos_filemode ]
aliases: [samba_dos_filemode]
sambaFakeOplocks:
default: false
description:
- Fake oplocks.
type: bool
aliases: [ samba_fake_oplocks ]
aliases: [samba_fake_oplocks]
sambaForceCreateMode:
default: false
description:
- Force file mode.
type: bool
aliases: [ samba_force_create_mode ]
aliases: [samba_force_create_mode]
sambaForceDirectoryMode:
default: false
description:
- Force directory mode.
type: bool
aliases: [ samba_force_directory_mode ]
aliases: [samba_force_directory_mode]
sambaForceDirectorySecurityMode:
default: false
description:
- Force directory security mode.
type: bool
aliases: [ samba_force_directory_security_mode ]
aliases: [samba_force_directory_security_mode]
sambaForceGroup:
description:
- Force group.
type: str
aliases: [ samba_force_group ]
aliases: [samba_force_group]
sambaForceSecurityMode:
default: false
description:
- Force security mode.
type: bool
aliases: [ samba_force_security_mode ]
aliases: [samba_force_security_mode]
sambaForceUser:
description:
- Force user.
type: str
aliases: [ samba_force_user ]
aliases: [samba_force_user]
sambaHideFiles:
description:
- Hide files.
type: str
aliases: [ samba_hide_files ]
aliases: [samba_hide_files]
sambaHideUnreadable:
default: false
description:
- Hide unreadable files/directories.
type: bool
aliases: [ samba_hide_unreadable ]
aliases: [samba_hide_unreadable]
sambaHostsAllow:
default: []
description:
- Allowed host/network.
type: list
elements: str
aliases: [ samba_hosts_allow ]
aliases: [samba_hosts_allow]
sambaHostsDeny:
default: []
description:
- Denied host/network.
type: list
elements: str
aliases: [ samba_hosts_deny ]
aliases: [samba_hosts_deny]
sambaInheritAcls:
default: true
description:
- Inherit ACLs.
type: bool
aliases: [ samba_inherit_acls ]
aliases: [samba_inherit_acls]
sambaInheritOwner:
default: false
description:
- Create files/directories with the owner of the parent directory.
type: bool
aliases: [ samba_inherit_owner ]
aliases: [samba_inherit_owner]
sambaInheritPermissions:
default: false
description:
- Create files/directories with permissions of the parent directory.
type: bool
aliases: [ samba_inherit_permissions ]
aliases: [samba_inherit_permissions]
sambaInvalidUsers:
description:
- Invalid users or groups.
type: str
aliases: [ samba_invalid_users ]
aliases: [samba_invalid_users]
sambaLevel2Oplocks:
default: true
description:
- Level 2 oplocks.
type: bool
aliases: [ samba_level_2_oplocks ]
aliases: [samba_level_2_oplocks]
sambaLocking:
default: true
description:
- Locking.
type: bool
aliases: [ samba_locking ]
aliases: [samba_locking]
sambaMSDFSRoot:
default: false
description:
- MSDFS root.
type: bool
aliases: [ samba_msdfs_root ]
aliases: [samba_msdfs_root]
sambaNtAclSupport:
default: true
description:
- NT ACL support.
type: bool
aliases: [ samba_nt_acl_support ]
aliases: [samba_nt_acl_support]
sambaOplocks:
default: true
description:
- Oplocks.
type: bool
aliases: [ samba_oplocks ]
aliases: [samba_oplocks]
sambaPostexec:
description:
- Postexec script.
type: str
aliases: [ samba_postexec ]
aliases: [samba_postexec]
sambaPreexec:
description:
- Preexec script.
type: str
aliases: [ samba_preexec ]
aliases: [samba_preexec]
sambaPublic:
default: false
description:
- Allow anonymous read-only access with a guest user.
type: bool
aliases: [ samba_public ]
aliases: [samba_public]
sambaSecurityMode:
default: '0777'
description:
- Security mode.
type: str
aliases: [ samba_security_mode ]
aliases: [samba_security_mode]
sambaStrictLocking:
default: 'Auto'
description:
- Strict locking.
type: str
aliases: [ samba_strict_locking ]
aliases: [samba_strict_locking]
sambaVFSObjects:
description:
- VFS objects.
type: str
aliases: [ samba_vfs_objects ]
aliases: [samba_vfs_objects]
sambaValidUsers:
description:
- Valid users or groups.
type: str
aliases: [ samba_valid_users ]
aliases: [samba_valid_users]
sambaWriteList:
description:
- Restrict write access to these users/groups.
type: str
aliases: [ samba_write_list ]
aliases: [samba_write_list]
sambaWriteable:
default: true
description:
- Samba write access.
type: bool
aliases: [ samba_writeable ]
aliases: [samba_writeable]
nfs_hosts:
default: []
description:
@ -328,21 +326,21 @@ options:
- Option name in exports file.
type: list
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
community.general.udm_share:
name: home
path: /home
host: ucs.example.com
sambaName: Home
'''
"""
RETURN = '''# '''
RETURN = """# """
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.univention_umc import (

View File

@ -10,20 +10,17 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: udm_user
author:
- Tobias Rüetschi (@keachi)
short_description: Manage posix users on a univention corporate server
description:
- "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 or edit it."
- 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
or edit it.
notes:
- This module requires the deprecated L(crypt Python module,
https://docs.python.org/3.12/library/crypt.html) library which was removed from Python 3.13.
For Python 3.13 or newer, you need to install L(legacycrypt, https://pypi.org/project/legacycrypt/).
- This module requires the deprecated L(crypt Python module, https://docs.python.org/3.12/library/crypt.html) library which was removed from
Python 3.13. For Python 3.13 or newer, you need to install L(legacycrypt, https://pypi.org/project/legacycrypt/).
requirements:
- legacycrypt (on Python 3.13 or newer)
extends_documentation_fragment:
@ -36,14 +33,14 @@ attributes:
options:
state:
default: "present"
choices: [ present, absent ]
choices: [present, absent]
description:
- Whether the user is present or not.
type: str
username:
required: true
description:
- User name
- User name.
aliases: ['name']
type: str
firstname:
@ -60,7 +57,7 @@ options:
type: str
birthday:
description:
- Birthday
- Birthday.
type: str
city:
description:
@ -73,16 +70,16 @@ options:
department_number:
description:
- Department number of users business address.
aliases: [ departmentNumber ]
aliases: [departmentNumber]
type: str
description:
description:
- Description (not gecos)
- Description (not gecos).
type: str
display_name:
description:
- Display name (not gecos)
aliases: [ displayName ]
- Display name (not gecos).
aliases: [displayName]
type: str
email:
default: ['']
@ -92,42 +89,39 @@ options:
elements: str
employee_number:
description:
- Employee number
aliases: [ employeeNumber ]
- Employee number.
aliases: [employeeNumber]
type: str
employee_type:
description:
- Employee type
aliases: [ employeeType ]
- Employee type.
aliases: [employeeType]
type: str
gecos:
description:
- GECOS
- GECOS.
type: str
groups:
default: []
description:
- "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\\)\\))."
- '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\)\)).'
type: list
elements: str
home_share:
description:
- "Home NFS share. Must be a LDAP DN, e.g.
V(cn=home,cn=shares,ou=school,dc=example,dc=com)."
aliases: [ homeShare ]
- Home NFS share. Must be a LDAP DN, for example V(cn=home,cn=shares,ou=school,dc=example,dc=com).
aliases: [homeShare]
type: str
home_share_path:
description:
- Path to home NFS share, inside the homeShare.
aliases: [ homeSharePath ]
aliases: [homeSharePath]
type: str
home_telephone_number:
default: []
description:
- List of private telephone numbers.
aliases: [ homeTelephoneNumber ]
aliases: [homeTelephoneNumber]
type: list
elements: str
homedrive:
@ -138,48 +132,48 @@ options:
default: []
description:
- List of alternative e-mail addresses.
aliases: [ mailAlternativeAddress ]
aliases: [mailAlternativeAddress]
type: list
elements: str
mail_home_server:
description:
- FQDN of mail server
aliases: [ mailHomeServer ]
- FQDN of mail server.
aliases: [mailHomeServer]
type: str
mail_primary_address:
description:
- Primary e-mail address
aliases: [ mailPrimaryAddress ]
- Primary e-mail address.
aliases: [mailPrimaryAddress]
type: str
mobile_telephone_number:
default: []
description:
- Mobile phone number
aliases: [ mobileTelephoneNumber ]
- Mobile phone number.
aliases: [mobileTelephoneNumber]
type: list
elements: str
organisation:
description:
- Organisation
aliases: [ organization ]
- Organisation.
aliases: [organization]
type: str
overridePWHistory:
type: bool
default: false
description:
- Override password history
aliases: [ override_pw_history ]
- Override password history.
aliases: [override_pw_history]
overridePWLength:
type: bool
default: false
description:
- Override password check
aliases: [ override_pw_length ]
- Override password check.
aliases: [override_pw_length]
pager_telephonenumber:
default: []
description:
- List of pager telephone numbers.
aliases: [ pagerTelephonenumber ]
aliases: [pagerTelephonenumber]
type: list
elements: str
phone:
@ -196,35 +190,34 @@ options:
description:
- Primary group. This must be the group LDAP DN.
- If not specified, it defaults to V(cn=Domain Users,cn=groups,$LDAP_BASE_DN).
aliases: [ primaryGroup ]
aliases: [primaryGroup]
type: str
profilepath:
description:
- Windows profile directory
- Windows profile directory.
type: str
pwd_change_next_login:
choices: [ '0', '1' ]
choices: ['0', '1']
description:
- Change password on next login.
aliases: [ pwdChangeNextLogin ]
aliases: [pwdChangeNextLogin]
type: str
room_number:
description:
- Room number of users business address.
aliases: [ roomNumber ]
aliases: [roomNumber]
type: str
samba_privileges:
description:
- "Samba privilege, like allow printer administration, do domain
join."
aliases: [ sambaPrivileges ]
- Samba privilege, like allow printer administration, do domain join.
aliases: [sambaPrivileges]
type: list
elements: str
default: []
samba_user_workstations:
description:
- Allow the authentication only on this Microsoft Windows host.
aliases: [ sambaUserWorkstations ]
aliases: [sambaUserWorkstations]
type: list
elements: str
default: []
@ -251,7 +244,7 @@ options:
shell:
default: '/bin/bash'
description:
- Login shell
- Login shell.
type: str
street:
description:
@ -263,7 +256,7 @@ options:
type: str
unixhome:
description:
- Unix home directory
- Unix home directory.
- If not specified, it defaults to C(/home/$USERNAME).
type: str
userexpiry:
@ -274,33 +267,28 @@ options:
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)."
- 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 ]
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."
- 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)."
- 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)."
- 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
community.general.udm_user:
name: FooBar
@ -325,10 +313,10 @@ EXAMPLES = '''
firstname: Foo
lastname: Bar
position: 'cn=teachers,cn=users,ou=school,dc=school,dc=example,dc=com'
'''
"""
RETURN = '''# '''
RETURN = """# """
from datetime import date, timedelta
import traceback

View File

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

View File

@ -8,12 +8,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
DOCUMENTATION = r"""
module: uptimerobot
short_description: Pause and start Uptime Robot monitoring
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)"
requirements:
- Valid Uptime Robot API Key
@ -30,7 +29,7 @@ options:
description:
- Define whether or not the monitor should be running or paused.
required: true
choices: [ "started", "paused" ]
choices: ["started", "paused"]
monitorid:
type: str
description:
@ -43,9 +42,9 @@ options:
required: true
notes:
- 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
community.general.uptimerobot:
monitorid: 12345
@ -57,7 +56,7 @@ EXAMPLES = '''
monitorid: 12345
apikey: 12345-1234512345
state: started
'''
"""
import json

View File

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

View File

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