---

## FIXME! or ssl ?
- name: Configure apache
  template:
    src: apache2-misp.conf.j2
    dest: "{{ apache_sitedir }}/misp.conf"
    mode: '0644'
    backup: yes
  notify:
    - restart webserver

- name: Debian | Disable default apache config
  file: dest=/etc/apache2/sites-enabled/000-default.conf state=absent
  notify:
    - restart webserver
  when: ansible_os_family == 'Debian'

- name: debian | ensure required modules are present
  apache2_module:
    state: present
    name: "{{ item }}"
  with_items:
    - headers
    - rewrite
  notify:
    - restart webserver
  when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

- name: Debian | Enable misp apache config
  file:
    src: "{{ apache_sitedir }}/misp.conf"
    dest: /etc/apache2/sites-enabled/misp.conf
    state: link
    validate: 'apachectl -t -f %s'
  notify:
    - restart webserver
  when: ansible_os_family == 'Debian'


---

## FIXME! or ssl ?
- name: Configure apache
  template:
    src: apache2-misp.conf.j2
    dest: "{{ apache_sitedir }}/misp.conf"
    mode: '0644'
    backup: yes

- name: Debian | Disable default apache config
  file: dest=/etc/apache2/sites-enabled/000-default.conf state=absent
  notify:
    - restart webserver
  when: ansible_os_family == 'Debian'

- name: debian | ensure required modules are present
  apache2_module:
    state: present
    name: "{{ item }}"
  with_items:
    - headers
    - rewrite
  notify:
    - restart webserver
  when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

- name: Debian | Enable misp apache config
  file:
    src: "{{ apache_sitedir }}/misp.conf"
    dest: /etc/apache2/sites-enabled/misp.conf
    state: link
    validate: 'apachectl -t -f %s'
  notify:
    - restart webserver
  when: ansible_os_family == 'Debian'


Revert "centos too deserves to restart webserver"
Revert "centos too deserves to restart webserver"

This reverts commit 60414734384f3fdadf0efcd0952ea5ad8d46f2e3.
