Getting started

Example inventory

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


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({})) }}'


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

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

    - role: debops.nginx
      tags: [ 'role::nginx' ]
        - '{{ 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:

Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.
Tasks related to system package management like installing, upgrading or removing packages.
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.
Tasks related to cron job configuration.