debops.resources default variables¶
Sections
- Role configuration
- Manage parent directories
- Manage custom templates
- Manage custom paths
- Manage git repositories
- Manage custom remote resources
- Manage custom archives
- Manage custom files
- Manage pip and virtual environments
- Manage file capabilities
- Manage custom delayed paths
- Custom shell commands
- String replacement management
Role configuration¶
-
resources__enabled
¶
Enable or disable management of custom resources.
resources__enabled: True
-
resources__src
¶
Absolute path to the directory on Ansible Controller where custom resources can be found. You need to create this directory manually.
By default, path is relative to the Ansible inventory.
resources__src: '{{ inventory_dir | realpath + "/../resources/" }}'
-
resources__time_format
¶
Time format to be used for the Ansible ansible.builtin.file module.
This is used for example when the access_time
is specified.
It is set here to ISO 8601 because the Ansible
default format is hardly human readable
(without separators like -
and :
).
Example: 2023-05-23T23:42:42
resources__time_format: '%Y-%m-%dT%H:%M:%S'
Manage parent directories¶
This section allows to configure the behavior for non existing parent directories for destination file paths.
This applies to the following sections:
-
resources__parent_dirs_create
¶
Should the parent directories be created by the role? Not creating it will
cause an Ansible run time error when the directory does not exist.
The global setting can be overwritten for individual items using
item.parent_dirs_create
.
resources__parent_dirs_create: True
-
resources__parent_dirs_recurse
¶
Recursively set the specified file attributes of parent directories when
creating them.
The global setting can be overwritten for individual items using
item.parent_dirs_recurse
.
resources__parent_dirs_recurse: True
-
resources__parent_dirs_owner
¶
Unix system user who owns the parent directory.
See also resources__parent_dirs_recurse
.
The global setting can be overwritten for individual items using
item.parent_dirs_owner
.
resources__parent_dirs_owner: '{{ omit }}'
-
resources__parent_dirs_group
¶
Unix system group of the parent directory.
See also resources__parent_dirs_recurse
.
The global setting can be overwritten for individual items using
item.parent_dirs_group
.
resources__parent_dirs_group: '{{ omit }}'
-
resources__parent_dirs_mode
¶
Unix permissions of the parent directory.
See also resources__parent_dirs_recurse
.
The global setting can be overwritten for individual items using
item.parent_dirs_mode
.
resources__parent_dirs_mode: '{{ omit }}'
Manage custom templates¶
These variables define how the role will manage custom templates on remote hosts. See resources__templates for more details.
-
resources__templates
¶
Directory which contains templates that should be generated on all hosts in the Ansible inventory.
resources__templates: [ '{{ resources__src + "templates/by-group/all" }}' ]
-
resources__group_templates
¶
List of paths containing the directories of all the groups the current host is in, based on the content of group_names
.
See Ansible - Playbooks Variables.
For example if the host debian1
is member of group-name1
and group-name2
debops.resources will then search all template files inside the directories placed here: ansible/resources/templates/by-group/
.
Resulting in: [ "ansible/resources/templates/by-group/group-name1", "ansible/resources/templates/by-group/group-name2" ]
.
Read the documentation about resources__templates for more details on templating with debops.resources.
resources__group_templates: '{{ group_names | map("regex_replace", "^(.*)$", resources__src + "templates/by-group/\1") | list }}'
-
resources__host_templates
¶
Directory which contains templates that should be generated on specific hosts in the Ansible inventory.
resources__host_templates: [ '{{ resources__src + "templates/by-host/" + inventory_hostname }}' ]
Manage custom paths¶
These lists allow you to manage file and directory paths on remote hosts using Ansible ansible.builtin.file module. By default role treats specified paths as directory names which should be present on the remote host. You can use all parameters supported by the Ansible ansible.builtin.file module.
See resources__paths for more details.
-
resources__paths
¶
Paths managed on all hosts in Ansible inventory.
resources__paths: []
-
resources__group_paths
¶
Paths managed on hosts in a specific group in Ansible inventory.
resources__group_paths: []
-
resources__host_paths
¶
Paths managed on specific hosts in Ansible inventory.
resources__host_paths: []
Manage git repositories¶
These lists allow you to manage git repositories on remote hosts using the Ansible ansible.builtin.git module. See resources__repositories for more details.
-
resources__repositories
¶
Manage git repositories on all hosts in the Ansible inventory.
resources__repositories: []
-
resources__group_repositories
¶
Manage git repositories on hosts in a specific Ansible inventory group.
resources__group_repositories: []
-
resources__host_repositories
¶
Manage git repositories on specific hosts in the Ansible inventory.
resources__host_repositories: []
Manage custom remote resources¶
These lists allow you to specify remote resources to download to the hosts using the Ansible ansible.builtin.get_url module. You can download files over HTTP, HTTPS, FTP and use all options supported by this module.
See resources__urls for more details.
-
resources__urls
¶
Manage online resources on all hosts in Ansible inventory.
resources__urls: []
-
resources__group_urls
¶
Manage online resources on hosts in a specific group in Ansible inventory.
resources__group_urls: []
-
resources__host_urls
¶
Manage online resources on specific hosts in Ansible inventory.
resources__host_urls: []
Manage custom archives¶
These lists allow you to unpack archives stored on Ansible Controller to remote hosts using the Ansible ansible.builtin.unarchive module. You can use all of the parameters supported by this module.
See resources__archives for more details.
-
resources__archives
¶
Manage archives on all hosts in Ansible inventory.
resources__archives: []
-
resources__group_archives
¶
Manage archives on hosts in specific group in Ansible inventory.
resources__group_archives: []
-
resources__host_archives
¶
Manage archives on specific hosts in Ansible inventory.
resources__host_archives: []
Manage custom files¶
These lists allow you to manage file contents on remote hosts, either by copying files from the Ansible Controller, or providing the contents directly in Ansible inventory. You can use all parameters supported by the Ansible ansible.builtin.copy module.
See resources__files for more details.
-
resources__files
¶
Manage file contents on all hosts in Ansible inventory.
resources__files: []
-
resources__group_files
¶
Manage file contents on hosts in a specific group in Ansible inventory.
resources__group_files: []
-
resources__host_files
¶
Manage file contents on specific hosts in Ansible inventory.
resources__host_files: []
Manage pip and virtual environments¶
These lists allow you to manage Python library dependencies. See Python Virtual Environment management documentation for more details.
-
resources__pip
¶
Manage Python library dependencies on all hosts in Ansible inventory.
resources__pip: []
-
resources__group_pip
¶
Manage Python library dependencies on hosts in a specific group in Ansible inventory.
resources__group_pip: []
-
resources__host_pip
¶
Manage Python library dependencies on specific hosts in Ansible inventory.
resources__host_pip: []
Manage file capabilities¶
These lists allow you to manipulate file privileges using the Linux capabilities(7) system. You can use all parameters supported by the Ansible community.general.capabilities module.
See resources__capabilities for more details.
-
resources__file_capabilities
¶
Manage file capabilities on all hosts in Ansible inventory.
resources__file_capabilities: []
-
resources__group_file_capabilities
¶
Manage file capabilities on hosts in a specific group in Ansible inventory.
resources__group_file_capabilities: []
-
resources__host_file_capabilities
¶
Manage file capabilities on specific hosts in Ansible inventory.
resources__host_file_capabilities: []
-
resources__combined_file_capabilities
¶
Variable which combines all other file capabilities variables and is used in the role tasks.
resources__combined_file_capabilities: '{{ resources__file_capabilities
+ resources__group_file_capabilities
+ resources__host_file_capabilities }}'
Manage custom delayed paths¶
These lists allow you to manage file and directory paths on remote hosts
using the Ansible ansible.builtin.file module.
The lists can be used exactly the same as
resources__(?:group_|host_)?paths
from the Manage custom paths section.
The only difference is that the custom delayed paths are handled after all
non delayed resources.
This allows to create symbolic links to files provided by
resources__(?:group_|host_)?files
for example.
See resources__paths for more details.
-
resources__delayed_paths
¶
Paths managed on all hosts in Ansible inventory.
resources__delayed_paths: []
-
resources__group_delayed_paths
¶
Paths managed on hosts in a specific group in Ansible inventory.
resources__group_delayed_paths: []
-
resources__host_delayed_paths
¶
Paths managed on specific hosts in Ansible inventory.
resources__host_delayed_paths: []
Custom shell commands¶
The variables below let you define shell commands (or even small shell
scripts) to execute on the remote hosts as the root
UNIX account. You
need to ensure idempotency by yourself. This is not a replacement for
a normal Ansible role.
See resources__commands for more details.
-
resources__commands
¶
List of shell commands which should be executed on all hosts in the Ansible inventory.
resources__commands: []
-
resources__group_commands
¶
List of shell commands which should be executed on hosts in a specific Ansible inventory group.
resources__group_commands: []
-
resources__host_commands
¶
List of shell commands which should be executed on specific hosts in the Ansible inventory.
resources__host_commands: []
-
resources__combined_commands
¶
Variable which combines all other shell command variables and is used in the role tasks.
resources__combined_commands: '{{ resources__commands
+ resources__group_commands
+ resources__host_commands }}'
String replacement management¶
The variables below let you define string replacement in files.
-
resources__replacements
¶
List of replacements which should be executed on all hosts in the Ansible inventory.
resources__replacements: []
-
resources__group_replacements
¶
List of replacements which should be executed on hosts in a specific Ansible inventory group.
resources__group_replacements: []
-
resources__host_replacements
¶
List of replacements which should be executed on specific hosts in the Ansible inventory.
resources__host_replacements: []
-
resources__combined_replacements
¶
Variable which combines all other line replacements variables and is used in the role tasks.
resources__combined_replacements: '{{ resources__replacements
+ resources__group_replacements
+ resources__host_replacements }}'