---
# file: roles/netdata/tasks/apache.yml

- name: "Enable Apache Status Module"
  apache2_module:
    name: 'status'
    state: 'present'
  notify: "Restart Apache"

- name: "Apache Status Site"
  template:
    src: 'apache.conf'
    dest: '/etc/apache2/sites-available/status{{ apache_conf_ext|default('.conf') }}'
    owner: 'root'
    group: 'root'
    mode: 644
  notify: "Restart Apache"

- name: "Enable Apache Status Site"
  command: a2ensite status creates=/etc/apache2/sites-enabled/status{{ apache_conf_ext|default('.conf') }}
  notify: "Restart Apache"