Getting started

Example inventory

To enable Green Unicorn service on a host, that host should be added to to a specific Ansible inventory group:

[debops_service_gunicorn]
hostname

Example playbook

If you are using this role without DebOps, here's an example Ansible playbook that uses the debops.gunicorn role:

---

- name: Manage Green Unicorn service
  hosts: [ 'debops_service_gunicorn' ]
  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', 'skip::apt_preferences' ]
      apt_preferences__dependent_list:
        - '{{ gunicorn__apt_preferences__dependent_list }}'

    - role: debops.logrotate
      tags: [ 'role::logrotate', 'skip::logrotate' ]
      logrotate__dependent_config:
        - '{{ gunicorn__logrotate__dependent_config }}'

    - role: debops.python
      tags: [ 'role::python', 'skip::python', 'role::gunicorn' ]
      python__dependent_packages3:
        - '{{ gunicorn__python__dependent_packages3 }}'
      python__dependent_packages2:
        - '{{ gunicorn__python__dependent_packages2 }}'

    - role: debops.gunicorn
      tags: [ 'role::gunicorn', 'skip::gunicorn' ]