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
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debops_service_gunicorn' ]
  become: True

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

  roles:

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

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

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

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