Getting started

Default configuration

The role will detect presence of a MariaDB database server and use it if available. If not, a SQLite database will be automatically configured on the server. You can configure MariaDB database using the debops.mariadb_server Ansible role.

Example inventory

To install and configure Etherpad on a host, it needs to be present in the [debops_service_etherpad] Ansible inventory group:

[debops_service_etherpad]
hostname

Example playbook

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

---

- name: Manage Etherpad service
  hosts: [ 'debops_service_etherpad' ]
  become: True

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

  roles:

    - role: debops.keyring
      tags: [ 'role::keyring', 'skip::keyring',
              'role::nodejs', 'role::mariadb', 'role::postgresql', 'role::nginx' ]
      keyring__dependent_apt_keys:
        - '{{ nodejs__keyring__dependent_apt_keys }}'
        - '{{ mariadb__keyring__dependent_apt_keys if (etherpad__database == "mysql") else [] }}'
        - '{{ postgresql__keyring__dependent_apt_keys if (etherpad__database == "postgresql") else [] }}'
        - '{{ nginx__keyring__dependent_apt_keys }}'

    - role: debops.etc_services
      tags: [ 'role::etc_services', 'skip::etc_services' ]
      etc_services__dependent_list:
        - '{{ etherpad__etc_services__dependent_list }}'

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

    - role: debops.apt_preferences
      tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
      apt_preferences__dependent_list:
        - '{{ nginx__apt_preferences__dependent_list }}'
        - '{{ nodejs__apt_preferences__dependent_list }}'

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

    - role: debops.ferm
      tags: [ 'role::ferm', 'skip::ferm' ]
      ferm__dependent_rules:
        - '{{ nginx__ferm__dependent_rules }}'

    - role: debops.python
      tags: [ 'role::python', 'skip::python', 'role::mariadb', 'role::postgresql' ]
      python__dependent_packages3:
        - '{{ postgresql__python__dependent_packages3 if etherpad__database == "postgres" else [] }}'
        - '{{ mariadb__python__dependent_packages3 if etherpad__database == "mysql" else [] }}'
        - '{{ nginx__python__dependent_packages3 }}'
      python__dependent_packages2:
        - '{{ postgresql__python__dependent_packages2 if etherpad__database == "postgres" else [] }}'
        - '{{ mariadb__python__dependent_packages2 if etherpad__database == "mysql" else [] }}'
        - '{{ nginx__python__dependent_packages2 }}'

    - role: debops.mariadb
      tags: [ 'role::mariadb', 'skip::mariadb' ]
      mariadb__dependent_users:
        - '{{ etherpad__mariadb__dependent_users }}'
      mariadb__dependent_databases:
        - '{{ etherpad__mariadb__dependent_databases }}'
      when: etherpad__database == 'mysql'

    - role: debops.postgresql
      tags: [ 'role::postgresql', 'skip::postgresql' ]
      postgresql__dependent_roles:
        - '{{ etherpad__postgresql__dependent_roles }}'
      postgresql__dependent_groups:
        - '{{ etherpad__postgresql__dependent_groups }}'
      postgresql__dependent_databases:
        - '{{ etherpad__postgresql__dependent_databases }}'
      postgresql__dependent_pgpass:
        - '{{ etherpad__postgresql__dependent_pgpass }}'
      when: etherpad__database == 'postgres'

    - role: debops.nginx
      tags: [ 'role::nginx', 'skip::nginx' ]
      nginx__dependent_servers:
        - '{{ etherpad__nginx__dependent_servers }}'
      nginx__dependent_upstreams:
        - '{{ etherpad__nginx__dependent_upstreams }}'

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

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::etherpad
Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.
role::etherpad:source
Run tasks related to install Etherpad from source.
role::etherpad:config
Run tasks related to configuring Etherpad.
role::etherpad:plugins
Run tasks which install the defined Etherpad plugins.
role::etherpad:api:call
Run tasks API call tasks. Can be used for rapid API calls.
role::etherpad:api
Same as role::etherpad:api:call but ensures that the service is running and waiting for it to start before trying.