diff --git a/roles/copr/backend/tasks/main.yml b/roles/copr/backend/tasks/main.yml index c2fe62e1c6..c0f403cb2f 100644 --- a/roles/copr/backend/tasks/main.yml +++ b/roles/copr/backend/tasks/main.yml @@ -139,6 +139,28 @@ notify: - restart logstash +- name: get owner for results dir + stat: path=/var/lib/copr/public_html + register: copr_results_dir_st + +- name: change owner for results dir if it isn't copr + shell: "chown -R copr:copr /var/lib/copr/public_html" + when: copr_results_dir_st.stat.pw_name != "copr" + +- command: "ls -dZ /var/lib/copr/public_html/" + register: public_html_ls + +- name: update selinux context for results if root folder does not have proper type + command: "restorecon -vvRF /var/lib/copr/public_html/" + when: public_html_ls is defined and 'copr_data_t' not in public_html_ls.stdout + +- name: install cert to access fed-cloud09 + # TODO: remove this when fed-cloud09 receives external cert + include: install_cloud_cert.yml + +- name: set acl for logstash to access httpd logs + acl: name=/var/log/lighttpd entity=logstash etype=user permissions=rx state=present + - name: enable and run copr-backend services service: name="{{ item }}" enabled=yes state=running with_items: @@ -164,25 +186,3 @@ - name: setup monitoring include: "monitoring.yml" - -- name: get owner for results dir - stat: path=/var/lib/copr/public_html - register: copr_results_dir_st - -- name: change owner for results dir if it isn't copr - shell: "chown -R copr:copr /var/lib/copr/public_html" - when: copr_results_dir_st.stat.pw_name != "copr" - -- command: "ls -dZ /var/lib/copr/public_html/" - register: public_html_ls - -- name: update selinux context for results if root folder does not have proper type - command: "restorecon -vvRF /var/lib/copr/public_html/" - when: public_html_ls is defined and 'copr_data_t' not in public_html_ls.stdout - -- name: install cert to access fed-cloud09 - # TODO: remove this when fed-cloud09 receives external cert - include: install_cloud_cert.yml - -- name: set acl for logstash to access httpd logs - acl: name=/var/log/lighttpd entity=logstash etype=user permissions=rx state=present