Getting started

Example inventory

To host the DebOps API, add the hosts to the debops_service_debops_api Ansible inventory host group:

[debops_service_debops_api]
hostname

Example playbook

Here's an example playbook that can be used to host the DebOps API on a set of hosts:

---

- name: Setup and manage a DebOps API server
  hosts: [ 'debops_service_debops_api' ]
  become: True

  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'

  roles:

    - role: debops.apt_preferences
      tags: [ 'role::apt_preferences' ]
      apt_preferences__dependent_list:
        - '{{ nginx_apt_preferences_dependent_list }}'

    - role: debops.ferm
      tags: [ 'role::ferm' ]
      ferm__dependent_rules:
        - '{{ nginx_ferm_dependent_rules }}'

    - role: debops.nginx
      tags: [ 'role::nginx' ]
      nginx__dependent_servers:
        - '{{ debops_api__nginx__servers }}'

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

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:

role::debops_api
Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.
role::debops_api:pkg
Tasks related to system package management like installing, upgrading or removing packages.
role::debops_api:git
Tasks related to git operations. Especially the tasks "DebOps API input data" can take up to one minute so you might want to skip them on subsequent role runs.
role::debops_api:cron
Tasks related to cron job configuration.