---

- name: celerity server install
  apt:
    force_apt_get: true
    install_recommends: false
    name: celerity-server
  register: apt_status
  retries: 60
  until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)

- name: config celerity server
  notify: restart celerity-server
  template:
    src: celerity-config.py.j2
    dest: /etc/celerity/config.py
  changed_when: "'molecule-idempotence-notest' not in ansible_skip_tags"

- name: ensure celerity server is running
  service:
    name: celerity-server
    enabled: true
    state: started

# FIREWALL

- name: firewall
  when: celerity_firewall_enabled
  vars:
    ferm_rules_filename: "{{ celerity_ferm_rules_filename }}"
    ferm_input_rules: "{{ celerity_ferm_input_rules }}"
    ferm_output_rules: "{{ celerity_ferm_output_rules }}"
    ferm_global_settings: "{{ celerity_ferm_global_settings }}"
  include_role:
    name: ferm-configure

- meta: flush_handlers

...
