123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- ---
- - name: Selinux... selinux targets
- sefcontext:
- target: "{{ item }}"
- setype: httpd_sys_rw_content_t
- state: present
- register: filecontext
- with_items:
- - '{{ nc_data_dir }}(/.*)?'
- - '{{ http_webroot }}/nextcloud/config(/.*)?'
- - '{{ http_webroot }}/nextcloud/apps(/.*)?'
- - '{{ http_webroot }}/nextcloud/custom_apps(/.*)?'
- - '{{ http_webroot }}/nextcloud/assets(/.*)?'
- - '{{ http_webroot }}/nextcloud/.htaccess'
- - '{{ http_webroot }}/nextcloud/.user.ini'
- - '{{ http_webroot }}/nextcloud/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?'
- - name: Selinux... enable seboolean settings
- seboolean:
- name: "{{ item }}"
- state: yes
- persistent: yes
- with_items:
- - httpd_can_sendmail
- - httpd_unified
- - httpd_graceful_shutdown
- - httpd_can_network_relay
- - httpd_can_network_connect
- - httpd_can_network_connect_db
- - daemons_enable_cluster_mode
- #- httpd_execmem
- ###- name: Selinux... enable seboolean settings
- ### command: semodule -i {{ role_path }}/files/{{ item }}
- ### loop:
- ### - httpd-to-php-fpm.pp
- ### - httpd-to-redis-socket.pp
- ### - httpd-to-upload-tmp.pp
- - name: Selinux... Run restore context to reload selinux
- shell: restorecon -R -v {{ item.target }}
- when: filecontext.results[item.index] is changed
- with_items:
- - { index: 0, target: '{{ nc_data_dir }}/' }
- - { index: 1, target: '{{ http_webroot }}/nextcloud/' }
- - name: Selinux... Restart {{ http_service_name }} service
- service:
- name: "{{ http_service_name }}"
- state: restarted
|