Getting started

Initial configuration

By default the debops.controller 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 controller__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.controller role, e. g. when provisioning a new DebOps environment.

Example inventory

To install DebOps on a remote host, you need to add it to the [debops_service_controller] Ansible host group:

[debops_service_controller]
hostname

Example playbook

Here's an example playbook that installs DebOps support on a host:

---

- name: Prepare host to be used as Ansible Controller
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debops_service_controller' ]
  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::controller' ]
      python__dependent_packages3:
        - '{{ controller__python__dependent_packages3 }}'
      python__dependent_packages2:
        - '{{ controller__python__dependent_packages2 }}'

    - role: ansible
      tags: [ 'role::ansible', 'skip::ansible' ]

    - role: controller
      tags: [ 'role::controller', 'skip::controller' ]

The playbooks is shipped with this role under docs/playbooks/controller.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::controller
Main role tag, should be used in the playbook to execute all of the role tasks.