---

- name: RedHat | Ensure selinux context for MISP httpd directories
  command: "chcon -R httpd_sys_rw_content_t {{ item }}"
# FIXME! sefcontext module not working
#  sefcontext:
#    target: "{{ item }}(/.*)?"
#    setype: httpd_sys_rw_content_t
#    state: present
  with_items:
    - /var/www/MISP/app/files
    - /var/www/MISP/app/files/terms
    - /var/www/MISP/app/files/scripts/tmp
    - /var/www/MISP/app/Plugin/CakeResque/tmp
    - /var/www/MISP/app/tmp
    - /var/www/MISP/app/webroot/img/orgs
    - /var/www/MISP/app/webroot/img/custom
    - "{{ misp_rootdir }}/.gnupg"

---

- name: RedHat | Ensure selinux context for MISP httpd directories
  sefcontext:
    target: "{{ item }}(/.*)?"
    setype: httpd_sys_rw_content_t
    state: present
  with_items:
    - /var/www/MISP/app/files
    - /var/www/MISP/app/files/terms
    - /var/www/MISP/app/files/scripts/tmp
    - /var/www/MISP/app/Plugin/CakeResque/tmp
    - /var/www/MISP/app/tmp
    - /var/www/MISP/app/webroot/img/orgs
    - /var/www/MISP/app/webroot/img/custom
    - "{{ misp_rootdir }}/.gnupg"

Revert "manual command for chcon as sefcontext module does not seem to work"
Revert "manual command for chcon as sefcontext module does not seem to work"

This reverts commit abb40b5d9cb9da991bd04ea42c84b2d699e4d142.
