Getting started¶
Initial configuration¶
By default the debops.debops
role will install the DebOps playbooks and roles
from GitHub in the background, using either the batch
command from the at
package, or if the former is not available, async
Ansible task. Keep in mind
that downloading all of the repositories might take a while and the code won't be
available for some time after initial Ansible playbook run.
If you cannot accept this behaviour you can set debops__update_method
to
sync
. This will make the roles and playbooks immediately available after the
task is run. However, this will introduce a significant delay in every playbook
run even when no upstream changes will be found. You should only choose this if
you plan to run debops
from the same playbook where you also include the
debops.debops
role, e. g. when provisioning a new DebOps environment.
Example inventory¶
To install DebOps on a remote host, you need to add it to
[debops_recursively]
Ansible host group:
[debops_recursively]
hostname
Example playbook¶
Here's an example playbook that installs DebOps support on a host:
---
- name: Install DebOps recursively
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_service_debops' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: keyring
tags: [ 'role::keyring', 'skip::keyring', 'role::ansible' ]
keyring__dependent_apt_keys:
- '{{ ansible__keyring__dependent_apt_keys }}'
- role: apt_preferences
tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
apt_preferences__dependent_list:
- '{{ ansible__apt_preferences__dependent_list }}'
- role: python
tags: [ 'role::python', 'skip::python', 'role::debops' ]
python__dependent_packages3:
- '{{ debops__python__dependent_packages3 }}'
python__dependent_packages2:
- '{{ debops__python__dependent_packages2 }}'
- role: ansible
tags: [ 'role::ansible', 'skip::ansible' ]
- role: debops
tags: [ 'role::debops', 'skip::debops' ]
The playbooks is shipped with this role under
docs/playbooks/debops.yml
from which you can symlink it to your
playbook directory.
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 a host was first
configured to speed up playbook execution, when you are sure that most of the
configuration is already in the desired state.
Available role tags:
role::debops
- Main role tag, should be used in the playbook to execute all of the role tasks.