Docs: Clean up of 'assemble' module docs (#46328)

This is part of a series of module doc cleanups.
pull/4420/head
Dag Wieers 2018-10-03 21:56:19 +02:00 committed by Sandra McCann
parent ba638f40cf
commit d6a581502f
1 changed files with 47 additions and 42 deletions

View File

@ -13,19 +13,24 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'], 'status': ['stableinterface'],
'supported_by': 'core'} 'supported_by': 'core'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: assemble module: assemble
short_description: Assembles a configuration file from fragments short_description: Assemble configuration files from fragments
description: description:
- Assembles a configuration file from fragments. Often a particular - Assembles a configuration file from fragments.
program will take a single configuration file and does not support a - Often a particular program will take a single configuration file and does not support a
C(conf.d) style structure where it is easy to build up the configuration C(conf.d) style structure where it is easy to build up the configuration
from multiple sources. C(assemble) will take a directory of files that can be from multiple sources. C(assemble) will take a directory of files that can be
local or have already been transferred to the system, and concatenate them local or have already been transferred to the system, and concatenate them
together to produce a destination file. Files are assembled in string sorting order. together to produce a destination file.
Puppet calls this idea I(fragments). - Files are assembled in string sorting order.
version_added: "0.5" - Puppet calls this idea I(fragments).
- This module is also supported for Windows targets.
notes:
- This module is also supported for Windows targets.
- See also M(copy) and M(template).
version_added: '0.5'
options: options:
src: src:
description: description:
@ -41,36 +46,36 @@ options:
you can get the original file back if you somehow clobbered it you can get the original file back if you somehow clobbered it
incorrectly. incorrectly.
type: bool type: bool
default: 'no' default: no
delimiter: delimiter:
description: description:
- A delimiter to separate the file contents. - A delimiter to separate the file contents.
version_added: "1.4" version_added: '1.4'
remote_src: remote_src:
description: description:
- If False, it will search for src at originating/master machine, if True it will - If C(no), it will search for src at originating/master machine.
go to the remote/target machine for the src. Default is True. - If C(yes), it will go to the remote/target machine for the src.
type: bool type: bool
default: 'yes' default: yes
version_added: "1.4" version_added: '1.4'
regexp: regexp:
description: description:
- Assemble files only if C(regex) matches the filename. If not set, - Assemble files only if C(regex) matches the filename.
all files are assembled. All "\\" (backslash) must be escaped as - If not set, all files are assembled.
"\\\\" to comply yaml syntax. Uses Python regular expressions; see - Every "\" (backslash) must be escaped as "\\" to comply to YAML syntax.
U(http://docs.python.org/2/library/re.html). - Uses L(Python regular expressions,http://docs.python.org/2/library/re.html).
ignore_hidden: ignore_hidden:
description: description:
- A boolean that controls if files that start with a '.' will be included or not. - A boolean that controls if files that start with a '.' will be included or not.
type: bool type: bool
default: 'no' default: no
version_added: "2.0" version_added: '2.0'
validate: validate:
description: description:
- The validation command to run before copying into place. The path to the file to - The validation command to run before copying into place.
validate is passed in via '%s' which must be present as in the sshd example below. - The path to the file to validate is passed in via '%s' which must be present as in the sshd example below.
The command is passed securely so shell features like expansion and pipes won't work. - The command is passed securely so shell features like expansion and pipes won't work.
version_added: "2.0" version_added: '2.0'
author: author:
- Stephen Fromm (@sfromm) - Stephen Fromm (@sfromm)
extends_documentation_fragment: extends_documentation_fragment:
@ -78,20 +83,20 @@ extends_documentation_fragment:
- decrypt - decrypt
''' '''
EXAMPLES = ''' EXAMPLES = r'''
# Example from Ansible Playbooks - name: Assemble from fragments from a directory
- assemble: assemble:
src: /etc/someapp/fragments src: /etc/someapp/fragments
dest: /etc/someapp/someapp.conf dest: /etc/someapp/someapp.conf
# When a delimiter is specified, it will be inserted in between each fragment - name: Inserted provided delimiter in between each fragment
- assemble: assemble:
src: /etc/someapp/fragments src: /etc/someapp/fragments
dest: /etc/someapp/someapp.conf dest: /etc/someapp/someapp.conf
delimiter: '### START FRAGMENT ###' delimiter: '### START FRAGMENT ###'
# Copy a new "sshd_config" file into place, after passing validation with sshd - name: Assemble a new "sshd_config" file into place, after passing validation with sshd
- assemble: assemble:
src: /etc/ssh/conf.d/ src: /etc/ssh/conf.d/
dest: /etc/ssh/sshd_config dest: /etc/ssh/sshd_config
validate: '/usr/sbin/sshd -t -f %s' validate: '/usr/sbin/sshd -t -f %s'