DEBOPS.CONTROLLER(5)

NAME
debops.controller - Prepare host to be used as Ansible Controller

SYNOPSIS

debops service/controller [--limit group,host,...] [--diff] [--check] [--tags tag1,tag2,...] [--skip-tags tag1,tag2,...] [<ansible-playbook options>] ...

DESCRIPTION

DebOps <http://www.debops.org/> is a set of Python scripts, Ansible playbooks and Ansible roles designed to work together to create a consistent data center environment based on Debian GNU/Linux distribution.

This role installs the DebOps scripts, playbooks and roles on a specified host. It can be used to create remote Ansible Controller hosts, which then can be used to control other hosts using DebOps. Roles and playbooks will be installed by default in a central, system-wide location, available to all users.

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.

AUTHOR
Maciej Delmanowski

COPYRIGHT
2014-2022, Maciej Delmanowski, Nick Janetakis, Robin Schneider and others