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:

  - '/tmp/example-dir'

  - 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
  hosts: [ 'debops_all_hosts', 'debops_service_resources' ]
  become: True


    - role: debops.resources
      tags: [ 'role::resources' ]

Ansible tags

You can use Ansible --tags or --skip-tags parameters to limit what tasks are performed during Ansible run. This can be used after host is first configured to speed up playbook execution, when you are sure that most of the configuration has not been changed.

Available role tags:

Main role tag, should be used in the playbook to execute all tasks.
Manage paths on the remote hosts.
Manage online resources on the remote hosts.
Unpack archives on the remote hosts.
Manage file contents on the remote hosts.
Manage delayed paths on the remote hosts.