Files
The variable cl_files is a dictionary of the files that shall be managed by this role. It’s
optional which Ansible module will be used to manage a file. More options can be applied at the same
file. For example, it is possible to create a file by the Ansible module template and modify it
by the module lineinfile later. Several options, listed in the default order, are available
- copy:
If the attribute
copyfileis defined in the dictionary.- template:
If the attribute
templateis defined in the dictionary.- markers:
Create blockinfile markers. If the attribute
markersis defined in the dictionary.- patch:
If the attribute
patchis defined in the dictionary.- lineinfile:
If the attribute
dictorlinesis defined in the dictionary.- blockinfile:
If the attribute
blocksis defined in the dictionary.- ini_file:
If the attribute
iniis defined in the dictionary.- ucl:
If the attribute
uclis defined in the dictionary.- sysrc:
If the attribute
sysrcis defined in the dictionary.
The variable cl_files_order controls the order of the execution. Multiple options will be
applied in this order when present in the dictionary of a file definition. In addition to the
options, listed above, there are create-backup and delete-backup tasks to backup files that
was changed if enabled by cl_backup (default: false). By default, the backup files are created
after copy, template, and markers. Fit the order of the execution to your needs.
Table of Contents