Getting started
Example inventory
The debops.resources
role is included by default in the common.yml
DebOps playbook, you don't need to add hosts to any groups to enable it.
Role provides a special variable, resources__src
which points to
ansible/resources/
directory located in the DebOps project directory,
relative to the currently used Ansible inventory. This variable can be used in
the item.src
keys of the file/archive lists to use the files from a central
location relative to the current DebOps project directory.
The ansible/resources/
directory is not created automatically, and role
does not check the existence of the specified files before using them.
An example usage:
resources__host_paths:
- '/tmp/example-dir'
resources__host_files:
- src: '{{ resources__src + "file.txt" }}'
dest: '/tmp/example-dir/file.txt'
Example playbook
If you are using this role without DebOps, here's an example Ansible playbook
that uses the debops.resources
role:
---
- name: Manage custom resources
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_resources' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: resources
tags: [ 'role::resources', 'skip::resources' ]