Merge pull request #545 from russoz-ansible/docs-review

review modules docs

SUMMARY

Review the doc blocks of the modules in the collection.

ISSUE TYPE


Docs Pull Request

COMPONENT NAME

plugins/modules/acl.py
plugins/modules/at.py
plugins/modules/authorized_key.py
plugins/modules/firewalld.py
plugins/modules/firewalld_info.py
plugins/modules/mount.py
plugins/modules/patch.py
plugins/modules/rhel_facts.py
plugins/modules/rhel_rpm_ostree.py
plugins/modules/seboolean.py
plugins/modules/selinux.py
plugins/modules/synchronize.py
plugins/modules/sysctl.py

Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Hideki Saito <saito@fgrep.org>
This commit is contained in:
softwarefactory-project-zuul[bot] 2024-06-27 09:29:59 +00:00 committed by GitHub
commit 38312cb8e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 129 additions and 128 deletions

View file

@ -25,7 +25,7 @@ options:
state: state:
description: description:
- Define whether the ACL should be present or not. - Define whether the ACL should be present or not.
- The C(query) state gets the current ACL without changing it, for use in C(register) operations. - The V(query) state gets the current ACL without changing it, for use in C(register) operations.
choices: [ absent, present, query ] choices: [ absent, present, query ]
default: query default: query
type: str type: str
@ -36,8 +36,8 @@ options:
default: true default: true
default: default:
description: description:
- If the target is a directory, setting this to C(true) will make it the default ACL for entities created inside the directory. - If O(path) is a directory, setting this to V(true) will make it the default ACL for entities created inside the directory.
- Setting C(default) to C(true) causes an error if the path is a file. - Setting O(default=true) causes an error if O(path) is a file.
type: bool type: bool
default: false default: false
entity: entity:
@ -53,7 +53,7 @@ options:
permissions: permissions:
description: description:
- The permissions to apply/remove can be any combination of C(r), C(w), C(x) - The permissions to apply/remove can be any combination of C(r), C(w), C(x)
- (read, write and execute respectively), and C(X) (execute permission if the file is a directory or already has execute permission for some user) (read, write and execute respectively), and C(X) (execute permission if the file is a directory or already has execute permission for some user)
type: str type: str
entry: entry:
description: description:
@ -67,8 +67,8 @@ options:
recursive: recursive:
description: description:
- Recursively sets the specified ACL. - Recursively sets the specified ACL.
- Incompatible with C(state=query). - Incompatible with O(state=query).
- Alias C(recurse) added in version 1.3.0. - Alias O(recurse) added in version 1.3.0.
type: bool type: bool
default: false default: false
aliases: [ recurse ] aliases: [ recurse ]
@ -81,7 +81,7 @@ options:
description: description:
- Select if and when to recalculate the effective right masks of the files. - Select if and when to recalculate the effective right masks of the files.
- See C(setfacl) documentation for more info. - See C(setfacl) documentation for more info.
- Incompatible with C(state=query). - Incompatible with O(state=query).
choices: [ default, mask, no_mask ] choices: [ default, mask, no_mask ]
default: default default: default
type: str type: str
@ -89,9 +89,9 @@ author:
- Brian Coca (@bcoca) - Brian Coca (@bcoca)
- Jérémie Astori (@astorije) - Jérémie Astori (@astorije)
notes: notes:
- The C(acl) module requires that ACLs are enabled on the target filesystem and that the C(setfacl) and C(getfacl) binaries are installed. - The M(ansible.posix.acl) module requires that ACLs are enabled on the target filesystem and that the C(setfacl) and C(getfacl) binaries are installed.
- As of Ansible 2.0, this module only supports Linux distributions. - As of Ansible 2.0, this module only supports Linux distributions.
- As of Ansible 2.3, the I(name) option has been changed to I(path) as default, but I(name) still works as well. - As of Ansible 2.3, the O(name) option has been changed to O(path) as default, but O(name) still works as well.
''' '''
EXAMPLES = r''' EXAMPLES = r'''

View file

@ -36,7 +36,7 @@ options:
choices: [ minutes, hours, days, weeks ] choices: [ minutes, hours, days, weeks ]
state: state:
description: description:
- The state dictates if the command or script file should be evaluated as present(added) or absent(deleted). - The state dictates if the command or script file should be evaluated as V(present) (added) or V(absent) (deleted).
type: str type: str
choices: [ absent, present ] choices: [ absent, present ]
default: present default: present

View file

@ -29,17 +29,17 @@ options:
path: path:
description: description:
- Alternative path to the authorized_keys file. - Alternative path to the authorized_keys file.
- The default value is the C(.ssh/authorized_keys) of the home of the user specified in the O(user) parameter. - The default value is the V(.ssh/authorized_keys) of the home of the user specified in the O(user) parameter.
- Most of the time, it's not necessary to set this key. - Most of the time, it is not necessary to set this key.
- Use the path to your target authorized_keys if you need to explicitly point on it. - Use the path to your target authorized_keys if you need to explicitly point on it.
type: path type: path
manage_dir: manage_dir:
description: description:
- Whether this module should manage the directory of the authorized key file. - Whether this module should manage the directory of the authorized key file.
- If set to C(true), the module will create the directory, as well as set the owner and permissions - If set to V(true), the module will create the directory, as well as set the owner and permissions
of an existing directory. of an existing directory.
- Be sure to set C(manage_dir=false) if you are using an alternate directory for authorized_keys, - Be sure to set O(manage_dir=false) if you are using an alternate directory for authorized_keys,
as set with C(path), since you could lock yourself out of SSH access. as set with O(path), since you could lock yourself out of SSH access.
- See the example below. - See the example below.
type: bool type: bool
default: true default: true
@ -56,17 +56,17 @@ options:
exclusive: exclusive:
description: description:
- Whether to remove all other non-specified keys from the authorized_keys file. - Whether to remove all other non-specified keys from the authorized_keys file.
- Multiple keys can be specified in a single C(key) string value by separating them by newlines. - Multiple keys can be specified in a single O(key) string value by separating them by newlines.
- This option is not loop aware, so if you use C(with_) , it will be exclusive per iteration of the loop. - This option is not loop aware, so if you use C(with_) , it will be exclusive per iteration of the loop.
- If you want multiple keys in the file you need to pass them all to C(key) in a single batch as mentioned above. - If you want multiple keys in the file you need to pass them all to O(key) in a single batch as mentioned above.
type: bool type: bool
default: false default: false
validate_certs: validate_certs:
description: description:
- This only applies if using a https url as the source of the keys. - This only applies if using a https url as the source of the keys.
- If set to C(false), the SSL certificates will not be validated. - If set to V(false), the SSL certificates will not be validated.
- This should only set to C(false) used on personally controlled sites using self-signed certificates as it avoids verifying the source site. - This should only set to V(false) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
- Prior to 2.1 the code worked as if this was set to C(true). - Prior to 2.1 the code worked as if this was set to V(true).
type: bool type: bool
default: true default: true
comment: comment:

View file

@ -17,7 +17,7 @@ options:
service: service:
description: description:
- Name of a service to add/remove to/from firewalld. - Name of a service to add/remove to/from firewalld.
- The service must be listed in output of firewall-cmd --get-services. - The service must be listed in output of C(firewall-cmd --get-services).
type: str type: str
protocol: protocol:
description: description:
@ -38,22 +38,22 @@ options:
type: str type: str
required: true required: true
description: description:
- Source port to forward from - Source port to forward from.
proto: proto:
type: str type: str
required: true required: true
description: description:
- protocol to forward - protocol to forward.
choices: [udp, tcp] choices: [udp, tcp]
toport: toport:
type: str type: str
required: true required: true
description: description:
- destination port - destination port.
toaddr: toaddr:
type: str type: str
description: description:
- Optional address to forward to - Optional address to forward to.
rich_rule: rich_rule:
description: description:
- Rich rule to add/remove to/from firewalld. - Rich rule to add/remove to/from firewalld.
@ -78,28 +78,28 @@ options:
zone: zone:
description: description:
- The firewalld zone to add/remove to/from. - The firewalld zone to add/remove to/from.
- Note that the default zone can be configured per system but C(public) is default from upstream. - Note that the default zone can be configured per system but V(public) is default from upstream.
- Available choices can be extended based on per-system configs, listed here are "out of the box" defaults. - Available choices can be extended based on per-system configs, listed here are "out of the box" defaults.
- Possible values include C(block), C(dmz), C(drop), C(external), C(home), C(internal), C(public), C(trusted), C(work). - Possible values include V(block), V(dmz), V(drop), V(external), V(home), V(internal), V(public), V(trusted), V(work).
type: str type: str
permanent: permanent:
description: description:
- Whether to apply this change to the permanent firewalld configuration. - Whether to apply this change to the permanent firewalld configuration.
- As of Ansible 2.3, permanent operations can operate on firewalld configs when it is not running (requires firewalld >= 0.3.9). - As of Ansible 2.3, permanent operations can operate on firewalld configs when it is not running (requires firewalld >= 0.3.9).
- Note that if this is C(false), I(immediate) defaults to C(true). - Note that if this is V(false), O(immediate=true) by default.
type: bool type: bool
default: false default: false
immediate: immediate:
description: description:
- Whether to apply this change to the runtime firewalld configuration. - Whether to apply this change to the runtime firewalld configuration.
- Defaults to C(true) if I(permanent=false). - Defaults to V(true) if O(permanent=false).
type: bool type: bool
default: false default: false
state: state:
description: description:
- Enable or disable a setting. - Enable or disable a setting.
- 'For ports: Should this port accept (enabled) or reject (disabled) connections.' - 'For ports: Should this port accept (V(enabled)) or reject (V(disabled)) connections.'
- The states C(present) and C(absent) can only be used in zone level operations (i.e. when no other parameters but zone and state are set). - The states V(present) and V(absent) can only be used in zone level operations (i.e. when no other parameters but zone and state are set).
type: str type: str
required: true required: true
choices: [ absent, disabled, enabled, present ] choices: [ absent, disabled, enabled, present ]
@ -114,13 +114,13 @@ options:
type: str type: str
offline: offline:
description: description:
- Ignores I(immediate) if I(permanent=true) and firewalld is not running. - Ignores O(immediate) if O(permanent=true) and firewalld is not running.
type: bool type: bool
default: false default: false
target: target:
description: description:
- firewalld Zone target - firewalld Zone target.
- If state is set to C(absent), this will reset the target to default - If O(state=absent), this will reset the target to default.
choices: [ default, ACCEPT, DROP, "%%REJECT%%" ] choices: [ default, ACCEPT, DROP, "%%REJECT%%" ]
type: str type: str
version_added: 1.2.0 version_added: 1.2.0

View file

@ -21,7 +21,7 @@ options:
zones: zones:
description: description:
- Gather information about specific zones. - Gather information about specific zones.
- If only works if C(active_zones) is set to C(false). - If only works if O(active_zones=false).
required: false required: false
type: list type: list
elements: str elements: str

View file

@ -24,20 +24,20 @@ options:
path: path:
description: description:
- Path to the mount point (e.g. C(/mnt/files)). - Path to the mount point (e.g. C(/mnt/files)).
- Before Ansible 2.3 this option was only usable as I(dest), I(destfile) and I(name). - Before Ansible 2.3 this option was only usable as O(ignore:dest), O(ignore:destfile), and O(name).
type: path type: path
required: true required: true
aliases: [ name ] aliases: [ name ]
src: src:
description: description:
- Device (or NFS volume, or something else) to be mounted on I(path). - Device (or NFS volume, or something else) to be mounted on I(path).
- Required when I(state) set to C(present), C(mounted) or C(ephemeral). - Required when O(state) set to V(present), V(mounted), or V(ephemeral).
- Ignored when I(state) set to C(absent) or C(unmounted). - Ignored when O(state) set to V(absent) or V(unmounted).
type: path type: path
fstype: fstype:
description: description:
- Filesystem type. - Filesystem type.
- Required when I(state) is C(present), C(mounted) or C(ephemeral). - Required when O(state) is V(present), V(mounted), or V(ephemeral).
type: str type: str
opts: opts:
description: description:
@ -46,53 +46,53 @@ options:
dump: dump:
description: description:
- Dump (see fstab(5)). - Dump (see fstab(5)).
- Note that if set to C(null) and I(state) set to C(present), - Note that if set to C(null) and O(state=present),
it will cease to work and duplicate entries will be made it will cease to work and duplicate entries will be made
with subsequent runs. with subsequent runs.
- Has no effect on Solaris systems or when used with C(ephemeral). - Has no effect on Solaris systems or when used with O(state=ephemeral).
type: str type: str
default: '0' default: '0'
passno: passno:
description: description:
- Passno (see fstab(5)). - Passno (see fstab(5)).
- Note that if set to C(null) and I(state) set to C(present), - Note that if set to C(null) and O(state=present),
it will cease to work and duplicate entries will be made it will cease to work and duplicate entries will be made
with subsequent runs. with subsequent runs.
- Deprecated on Solaris systems. Has no effect when used with C(ephemeral). - Deprecated on Solaris systems. Has no effect when used with O(state=ephemeral).
type: str type: str
default: '0' default: '0'
state: state:
description: description:
- If C(mounted), the device will be actively mounted and appropriately - If V(mounted), the device will be actively mounted and appropriately
configured in I(fstab). If the mount point is not present, the mount configured in I(fstab). If the mount point is not present, the mount
point will be created. point will be created.
- If C(unmounted), the device will be unmounted without changing I(fstab). - If V(unmounted), the device will be unmounted without changing I(fstab).
- C(present) only specifies that the device is to be configured in - V(present) only specifies that the device is to be configured in
I(fstab) and does not trigger or require a mount. I(fstab) and does not trigger or require a mount.
- C(ephemeral) only specifies that the device is to be mounted, without changing - V(ephemeral) only specifies that the device is to be mounted, without changing
I(fstab). If it is already mounted, a remount will be triggered. I(fstab). If it is already mounted, a remount will be triggered.
This will always return changed=True. If the mount point I(path) This will always return RV(ignore:changed=true). If the mount point O(path)
has already a device mounted on, and its source is different than I(src), has already a device mounted on, and its source is different than O(src),
the module will fail to avoid unexpected unmount or mount point override. the module will fail to avoid unexpected unmount or mount point override.
If the mount point is not present, the mount point will be created. If the mount point is not present, the mount point will be created.
The I(fstab) is completely ignored. This option is added in version 1.5.0. The I(fstab) is completely ignored. This option is added in version 1.5.0.
- C(absent) specifies that the mount point entry I(path) will be removed - V(absent) specifies that the mount point entry O(path) will be removed
from I(fstab) and will also unmount the mounted device and remove the from I(fstab) and will also unmount the mounted device and remove the
mount point. A mounted device will be unmounted regardless of I(src) or its mount point. A mounted device will be unmounted regardless of O(src) or its
real source. C(absent) does not unmount recursively, and the module will real source. V(absent) does not unmount recursively, and the module will
fail if multiple devices are mounted on the same mount point. Using fail if multiple devices are mounted on the same mount point. Using
C(absent) with a mount point that is not registered in the I(fstab) has V(absent) with a mount point that is not registered in the I(fstab) has
no effect. Use C(unmounted) instead.. no effect, use V(unmounted) instead.
- C(remounted) specifies that the device will be remounted for when you - V(remounted) specifies that the device will be remounted for when you
want to force a refresh on the mount itself (added in 2.9). This will want to force a refresh on the mount itself (added in 2.9). This will
always return changed=true. If I(opts) is set, the options will be always return RV(ignore:changed=true). If O(opts) is set, the options will be
applied to the remount, but will not change I(fstab). Additionally, applied to the remount, but will not change I(fstab). Additionally,
if I(opts) is set, and the remount command fails, the module will if O(opts) is set, and the remount command fails, the module will
error to prevent unexpected mount changes. Try using C(mounted) error to prevent unexpected mount changes. Try using V(mounted)
instead to work around this issue. C(remounted) expects the mount point instead to work around this issue. V(remounted) expects the mount point
to be present in the I(fstab). To remount a mount point not registered to be present in the I(fstab). To remount a mount point not registered
in I(fstab), use C(ephemeral) instead, especially with BSD nodes. in I(fstab), use V(ephemeral) instead, especially with BSD nodes.
- C(absent_from_fstab) specifies that the device mount's entry will be - V(absent_from_fstab) specifies that the device mount's entry will be
removed from I(fstab). This option does not unmount it or delete the removed from I(fstab). This option does not unmount it or delete the
mountpoint. mountpoint.
type: str type: str
@ -105,20 +105,20 @@ options:
- This might be useful if you need to configure mountpoints in a chroot environment. - This might be useful if you need to configure mountpoints in a chroot environment.
- OpenBSD does not allow specifying alternate fstab files with mount so do not - OpenBSD does not allow specifying alternate fstab files with mount so do not
use this on OpenBSD with any state that operates on the live filesystem. use this on OpenBSD with any state that operates on the live filesystem.
- This parameter defaults to /etc/fstab or /etc/vfstab on Solaris. - This parameter defaults to C(/etc/fstab) or C(/etc/vfstab) on Solaris.
- This parameter is ignored when I(state) is set to C(ephemeral). - This parameter is ignored when O(state=ephemeral).
type: str type: str
boot: boot:
description: description:
- Determines if the filesystem should be mounted on boot. - Determines if the filesystem should be mounted on boot.
- Only applies to Solaris and Linux systems. - Only applies to Solaris and Linux systems.
- For Solaris systems, C(true) will set C(yes) as the value of mount at boot - For Solaris systems, C(true) will set C(yes) as the value of mount at boot
in I(/etc/vfstab). in C(/etc/vfstab).
- For Linux, FreeBSD, NetBSD and OpenBSD systems, C(false) will add C(noauto) - For Linux, FreeBSD, NetBSD and OpenBSD systems, C(false) will add C(noauto)
to mount options in I(/etc/fstab). to mount options in C(/etc/fstab).
- To avoid mount option conflicts, if C(noauto) specified in C(opts), - To avoid mount option conflicts, if C(noauto) specified in O(opts),
mount module will ignore C(boot). mount module will ignore O(boot).
- This parameter is ignored when I(state) is set to C(ephemeral). - This parameter is ignored when O(state=ephemeral).
type: bool type: bool
default: true default: true
backup: backup:
@ -128,9 +128,9 @@ options:
type: bool type: bool
default: false default: false
notes: notes:
- As of Ansible 2.3, the I(name) option has been changed to I(path) as - As of Ansible 2.3, the O(name) option has been changed to O(path) as
default, but I(name) still works as well. default, but O(name) still works as well.
- Using C(remounted) with I(opts) set may create unexpected results based on - Using O(state=remounted) with O(opts) set may create unexpected results based on
the existing options already defined on mount, so care should be taken to the existing options already defined on mount, so care should be taken to
ensure that conflicting options are not present before hand. ensure that conflicting options are not present before hand.
''' '''

View file

@ -24,7 +24,7 @@ options:
basedir: basedir:
description: description:
- Path of a base directory in which the patch file will be applied. - Path of a base directory in which the patch file will be applied.
- May be omitted when C(dest) option is specified, otherwise required. - May be omitted when O(dest) option is specified, otherwise required.
type: path type: path
dest: dest:
description: description:
@ -37,7 +37,7 @@ options:
src: src:
description: description:
- Path of the patch file as accepted by the GNU patch tool. If - Path of the patch file as accepted by the GNU patch tool. If
C(remote_src) is C(false), the patch source file is looked up from the O(remote_src=false), the patch source file is looked up from the
module's I(files) directory. module's I(files) directory.
type: path type: path
required: true required: true
@ -50,8 +50,8 @@ options:
default: present default: present
remote_src: remote_src:
description: description:
- If C(false), it will search for src at originating/controller machine, if C(true) it will - If V(false), it will search for src at originating/controller machine,
go to the remote/target machine for the C(src). - If C(true), it will go to the remote/target machine for the O(src).
type: bool type: bool
default: false default: false
strip: strip:
@ -68,15 +68,15 @@ options:
default: false default: false
binary: binary:
description: description:
- Setting to C(true) will disable patch's heuristic for transforming CRLF - Setting to V(true) will disable patch's heuristic for transforming CRLF
line endings into LF. line endings into LF.
- Line endings of src and dest must match. - Line endings of O(src) and O(dest) must match.
- If set to C(false), C(patch) will replace CRLF in C(src) files on POSIX. - If set to V(false), C(patch) will replace CRLF in O(src) files on POSIX.
type: bool type: bool
default: false default: false
ignore_whitespace: ignore_whitespace:
description: description:
- Setting to C(true) will ignore white space changes between patch and input. - Setting to V(true) will ignore white space changes between patch and input.
type: bool type: bool
default: false default: false
notes: notes:

View file

@ -13,7 +13,7 @@ module: rhel_facts
version_added: 1.5.0 version_added: 1.5.0
short_description: Facts module to set or override RHEL specific facts. short_description: Facts module to set or override RHEL specific facts.
description: description:
- Compatibility layer for using the "package" module for rpm-ostree based systems via setting the "pkg_mgr" fact correctly. - Compatibility layer for using the M(ansible.builtin.package) module for rpm-ostree based systems via setting the C(pkg_mgr) fact correctly.
author: author:
- Adam Miller (@maxamillion) - Adam Miller (@maxamillion)
requirements: requirements:

View file

@ -25,12 +25,12 @@ requirements:
options: options:
name: name:
description: description:
- A package name or package specifier with version, like C(name-1.0). - A package name or package specifier with version, like V(name-1.0).
- Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name>=1.0) - Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name>=1.0).
- If a previous version is specified, the task also needs to turn C(allow_downgrade) on. - If a previous version is specified, the task also needs to turn C(allow_downgrade) on.
See the C(allow_downgrade) documentation for caveats with downgrading packages. See the C(allow_downgrade) documentation for caveats with downgrading packages.
- When using state=latest, this can be C('*') which means run C(yum -y update). - When using O(state=latest), this can be V('*') which means run C(yum -y update).
- You can also pass a url or a local path to a rpm file (using state=present). - You can also pass a url or a local path to a rpm file (using O(state=present)).
To operate on several packages this can accept a comma separated string of packages or (as of 2.0) a list of packages. To operate on several packages this can accept a comma separated string of packages or (as of 2.0) a list of packages.
aliases: [ pkg ] aliases: [ pkg ]
type: list type: list
@ -38,12 +38,12 @@ options:
default: [] default: []
state: state:
description: description:
- Whether to install (C(present) or C(installed), C(latest)), or remove (C(absent) or C(removed)) a package. - Whether to install (V(present) or V(installed), V(latest)), or remove (V(absent) or V(removed)) a package.
- C(present) and C(installed) will simply ensure that a desired package is installed. - V(present) and V(installed) will simply ensure that a desired package is installed.
- C(latest) will update the specified package if it's not of the latest available version. - V(latest) will update the specified package if it's not of the latest available version.
- C(absent) and C(removed) will remove the specified package. - V(absent) and V(removed) will remove the specified package.
- Default is C(None), however in effect the default action is C(present) unless the C(autoremove) option is - Default is C(null), however in effect the default action is V(present) unless the C(autoremove) option is
enabled for this module, then C(absent) is inferred. enabled for this module, then V(absent) is inferred.
type: str type: str
choices: [ absent, installed, latest, present, removed ] choices: [ absent, installed, latest, present, removed ]
notes: notes:

View file

@ -22,12 +22,12 @@ options:
type: str type: str
persistent: persistent:
description: description:
- Set to C(true) if the boolean setting should survive a reboot. - Set to V(true) if the boolean setting should survive a reboot.
type: bool type: bool
default: false default: false
state: state:
description: description:
- Desired boolean value - Desired boolean value.
type: bool type: bool
required: true required: true
ignore_selinux_state: ignore_selinux_state:

View file

@ -20,7 +20,7 @@ version_added: "1.0.0"
options: options:
policy: policy:
description: description:
- The name of the SELinux policy to use (e.g. C(targeted)) will be required if I(state) is not C(disabled). - The name of the SELinux policy to use (e.g. C(targeted)) will be required unless O(state=disabled).
type: str type: str
state: state:
description: description:
@ -30,7 +30,7 @@ options:
type: str type: str
update_kernel_param: update_kernel_param:
description: description:
- If set to I(true), will update also the kernel boot parameters when disabling/enabling SELinux. - If set to V(true), will update also the kernel boot parameters when disabling/enabling SELinux.
- The C(grubby) tool must be present on the target system for this to work. - The C(grubby) tool must be present on the target system for this to work.
default: false default: false
type: bool type: bool

View file

@ -14,12 +14,13 @@ DOCUMENTATION = r'''
module: synchronize module: synchronize
short_description: A wrapper around rsync to make common tasks in your playbooks quick and easy short_description: A wrapper around rsync to make common tasks in your playbooks quick and easy
description: description:
- C(synchronize) is a wrapper around rsync to make common tasks in your playbooks quick and easy. - M(ansible.posix.synchronize) is a wrapper around C(rsync) to make common tasks in your playbooks quick and easy.
- It is run and originates on the local host where Ansible is being run. - It is run and originates on the local host where Ansible is being run.
- Of course, you could just use the C(command) action to call rsync yourself, but you also have to add a fair number of - Of course, you could just use the M(ansible.builtin.command) action to call C(rsync) yourself, but you also have to add a fair number of
boilerplate options and host facts. boilerplate options and host facts.
- This module is not intended to provide access to the full power of rsync, but does make the most common - This module is not intended to provide access to the full power of C(rsync), but does make the most common
invocations easier to implement. You `still` may need to call rsync directly via C(command) or C(shell) depending on your use case. invocations easier to implement.
You I(still) may need to call C(rsync) directly via M(ansible.builtin.command) or M(ansible.builtin.shell) depending on your use case.
version_added: "1.0.0" version_added: "1.0.0"
options: options:
src: src:
@ -37,27 +38,27 @@ options:
dest_port: dest_port:
description: description:
- Port number for ssh on the destination host. - Port number for ssh on the destination host.
- Prior to Ansible 2.0, the ansible_ssh_port inventory var took precedence over this value. - Prior to Ansible 2.0, the C(ansible_ssh_port) inventory var took precedence over this value.
- This parameter defaults to the value of C(ansible_port), the C(remote_port) config setting - This parameter defaults to the value of C(ansible_port), the C(remote_port) config setting
or the value from ssh client configuration if none of the former have been set. or the value from ssh client configuration if none of the former have been set.
type: int type: int
mode: mode:
description: description:
- Specify the direction of the synchronization. - Specify the direction of the synchronization.
- In push mode the localhost or delegate is the source. - In V(push) mode the localhost or delegate is the source.
- In pull mode the remote host in context is the source. - In V(pull) mode the remote host in context is the source.
type: str type: str
choices: [ pull, push ] choices: [ pull, push ]
default: push default: push
archive: archive:
description: description:
- Mirrors the rsync archive flag, enables recursive, links, perms, times, owner, group flags and -D. - Mirrors the rsync archive flag, enables recursive, links, perms, times, owner, group flags, and C(-D).
type: bool type: bool
default: true default: true
checksum: checksum:
description: description:
- Skip based on checksum, rather than mod-time & size; Note that that "archive" option is still enabled by default - the "checksum" option will - Skip based on checksum, rather than mod-time & size; Note that that O(archive) option is still enabled by default -
not disable it. the O(checksum) option will not disable it.
type: bool type: bool
default: false default: false
compress: compress:
@ -73,8 +74,8 @@ options:
default: false default: false
delete: delete:
description: description:
- Delete files in I(dest) that do not exist (after transfer, not before) in the I(src) path. - Delete files in O(dest) that do not exist (after transfer, not before) in the O(src) path.
- This option requires I(recursive=true). - This option requires O(recursive=true).
- This option ignores excluded files and behaves like the rsync opt C(--delete-after). - This option ignores excluded files and behaves like the rsync opt C(--delete-after).
type: bool type: bool
default: false default: false
@ -130,17 +131,17 @@ options:
default: 0 default: 0
set_remote_user: set_remote_user:
description: description:
- Put user@ for the remote paths. - Put C(user@) for the remote paths.
- If you have a custom ssh config to define the remote user for a host - If you have a custom ssh config to define the remote user for a host
that does not match the inventory user, you should set this parameter to C(false). that does not match the inventory user, you should set this parameter to V(false).
type: bool type: bool
default: true default: true
ssh_connection_multiplexing: ssh_connection_multiplexing:
description: description:
- SSH connection multiplexing for rsync is disabled by default to prevent misconfigured ControlSockets from resulting in failed SSH connections. - SSH connection multiplexing for rsync is disabled by default to prevent misconfigured ControlSockets from resulting in failed SSH connections.
This is accomplished by setting the SSH C(ControlSocket) to C(none). This is accomplished by setting the SSH C(ControlSocket) to C(none).
- Set this option to C(true) to allow multiplexing and reduce SSH connection overhead. - Set this option to V(true) to allow multiplexing and reduce SSH connection overhead.
- Note that simply setting this option to C(true) is not enough; - Note that simply setting this option to V(true) is not enough;
You must also configure SSH connection multiplexing in your SSH client config by setting values for You must also configure SSH connection multiplexing in your SSH client config by setting values for
C(ControlMaster), C(ControlPersist) and C(ControlPath). C(ControlMaster), C(ControlPersist) and C(ControlPath).
type: bool type: bool
@ -182,7 +183,7 @@ options:
use_ssh_args: use_ssh_args:
description: description:
- In Ansible 2.10 and lower, it uses the ssh_args specified in C(ansible.cfg). - In Ansible 2.10 and lower, it uses the ssh_args specified in C(ansible.cfg).
- In Ansible 2.11 and onwards, when set to C(true), it uses all SSH connection configurations like - In Ansible 2.11 and onwards, when set to V(true), it uses all SSH connection configurations like
C(ansible_ssh_args), C(ansible_ssh_common_args), and C(ansible_ssh_extra_args). C(ansible_ssh_args), C(ansible_ssh_common_args), and C(ansible_ssh_extra_args).
type: bool type: bool
default: false default: false
@ -200,31 +201,31 @@ options:
type: bool type: bool
default: false default: false
_ssh_args: _ssh_args:
description: Internal use only. See C(use_ssh_args) for ssh arg settings. description: Internal use only. See O(use_ssh_args) for ssh arg settings.
type: str type: str
required: false required: false
notes: notes:
- rsync must be installed on both the local and remote host. - C(rsync) must be installed on both the local and remote host.
- For the C(synchronize) module, the "local host" is the host `the synchronize task originates on`, and the "destination host" is the host - For the M(ansible.posix.synchronize) module, the "local host" is the host I(the synchronize task originates on),
`synchronize is connecting to`. and the "destination host" is the host I(synchronize is connecting to).
- The "local host" can be changed to a different host by using `delegate_to`. This enables copying between two remote hosts or entirely on one - The "local host" can be changed to a different host by using C(delegate_to).
remote machine. This enables copying between two remote hosts or entirely on one remote machine.
- > - >
The user and permissions for the synchronize `src` are those of the user running the Ansible task on the local host (or the remote_user for a The user and permissions for the synchronize O(src) are those of the user running the Ansible task on the local host (or the remote_user for a
delegate_to host when delegate_to is used). C(delegate_to) host when C(delegate_to) is used).
- The user and permissions for the synchronize `dest` are those of the `remote_user` on the destination host or the `become_user` if `become=yes` is active. - The user and permissions for the synchronize `dest` are those of the `remote_user` on the destination host or the `become_user` if `become=yes` is active.
- In Ansible 2.0 a bug in the synchronize module made become occur on the "local host". This was fixed in Ansible 2.0.1. - In Ansible 2.0 a bug in the synchronize module made become occur on the "local host". This was fixed in Ansible 2.0.1.
- Currently, synchronize is limited to elevating permissions via passwordless sudo. This is because rsync itself is connecting to the remote machine - Currently, M(ansible.posix.synchronize) is limited to elevating permissions via passwordless sudo.
and rsync doesn't give us a way to pass sudo credentials in. This is because rsync itself is connecting to the remote machine and rsync doesn't give us a way to pass sudo credentials in.
- Currently there are only a few connection types which support synchronize (ssh, paramiko, local, and docker) because a sync strategy has been - Currently there are only a few connection types which support synchronize (ssh, paramiko, local, and docker) because a sync strategy has been
determined for those connection types. Note that the connection for these must not need a password as rsync itself is making the connection and determined for those connection types. Note that the connection for these must not need a password as rsync itself is making the connection and
rsync does not provide us a way to pass a password to the connection. rsync does not provide us a way to pass a password to the connection.
- Expect that dest=~/x will be ~<remote_user>/x even if using sudo. - Expect that O(dest=~/x) will be V(~<remote_user>/x) even if using sudo.
- Inspect the verbose output to validate the destination user/host/path are what was expected. - Inspect the verbose output to validate the destination user/host/path are what was expected.
- To exclude files and directories from being synchronized, you may add C(.rsync-filter) files to the source directory. - To exclude files and directories from being synchronized, you may add C(.rsync-filter) files to the source directory.
- rsync daemon must be up and running with correct permission when using rsync protocol in source or destination path. - rsync daemon must be up and running with correct permission when using rsync protocol in source or destination path.
- The C(synchronize) module enables `--delay-updates` by default to avoid leaving a destination in a broken in-between state if the underlying rsync process - The C(synchronize) module enables C(--delay-updates) by default to avoid leaving a destination in a broken in-between state if the underlying rsync process
encounters an error. Those synchronizing large numbers of files that are willing to trade safety for performance should disable this option. encounters an error. Those synchronizing large numbers of files that are willing to trade safety for performance should disable this option.
- link_destination is subject to the same limitations as the underlying rsync daemon. Hard links are only preserved if the relative subtrees - link_destination is subject to the same limitations as the underlying rsync daemon. Hard links are only preserved if the relative subtrees
of the source and destination are the same. Attempts to hardlink into a directory that is a subdirectory of the source will be prevented. of the source and destination are the same. Attempts to hardlink into a directory that is a subdirectory of the source will be prevented.

View file

@ -19,7 +19,7 @@ version_added: "1.0.0"
options: options:
name: name:
description: description:
- The dot-separated path (also known as I(key)) specifying the sysctl variable. - The dot-separated path (also known as O(key)) specifying the sysctl variable.
required: true required: true
aliases: [ 'key' ] aliases: [ 'key' ]
type: str type: str
@ -41,9 +41,9 @@ options:
default: false default: false
reload: reload:
description: description:
- If C(true), performs a I(/sbin/sysctl -p) if the C(sysctl_file) is - If V(true), performs a C(/sbin/sysctl -p) if the O(sysctl_file) is
updated. If C(false), does not reload I(sysctl) even if the updated. If V(false), does not reload C(sysctl) even if the
C(sysctl_file) is updated. O(sysctl_file) is updated.
type: bool type: bool
default: true default: true
sysctl_file: sysctl_file:
@ -53,7 +53,7 @@ options:
type: path type: path
sysctl_set: sysctl_set:
description: description:
- Verify token value with the sysctl command and set with -w if necessary. - Verify token value with the sysctl command and set with C(-w) if necessary.
type: bool type: bool
default: false default: false
author: author: