From 489306ef154119364f9a4fca4cb0a6c6f7ef524c Mon Sep 17 00:00:00 2001 From: Alex Krzos Date: Sat, 30 Jan 2016 11:45:43 -0500 Subject: [PATCH] Add serve browbeat results out of httpd to browbeat install playbook. Change-Id: If623b5c06fff8c084e50ddb2227ed3a06160cdbd --- ansible/install/browbeat.yml | 2 + .../roles/browbeat/files/00-browbeat.conf | 14 +++++++ .../install/roles/browbeat/handlers/main.yml | 8 ++++ ansible/install/roles/browbeat/tasks/main.yml | 38 +++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 ansible/install/roles/browbeat/files/00-browbeat.conf create mode 100644 ansible/install/roles/browbeat/handlers/main.yml diff --git a/ansible/install/browbeat.yml b/ansible/install/browbeat.yml index 90a51a932..89fd6c66e 100644 --- a/ansible/install/browbeat.yml +++ b/ansible/install/browbeat.yml @@ -5,6 +5,8 @@ - hosts: undercloud remote_user: stack + vars: + results_in_httpd: true roles: - common - browbeat diff --git a/ansible/install/roles/browbeat/files/00-browbeat.conf b/ansible/install/roles/browbeat/files/00-browbeat.conf new file mode 100644 index 000000000..7fc0ec3ae --- /dev/null +++ b/ansible/install/roles/browbeat/files/00-browbeat.conf @@ -0,0 +1,14 @@ +# Browbeat httpd config to serve results on undercloud +# Installed via browbeat installer + +Listen 9000 + + ServerName browbeat-results + DocumentRoot "/home/stack/browbeat/results" + + Options Indexes FollowSymLinks + IndexOptions NameWidth=* + AllowOverride None + Require all granted + + \ No newline at end of file diff --git a/ansible/install/roles/browbeat/handlers/main.yml b/ansible/install/roles/browbeat/handlers/main.yml new file mode 100644 index 000000000..fbbd54e5a --- /dev/null +++ b/ansible/install/roles/browbeat/handlers/main.yml @@ -0,0 +1,8 @@ +--- +# +# Browbeat installer handlers +# + +- name: restart httpd + service: name=httpd state=restarted + become: true diff --git a/ansible/install/roles/browbeat/tasks/main.yml b/ansible/install/roles/browbeat/tasks/main.yml index 00e641e3a..0d2c0e2ab 100644 --- a/ansible/install/roles/browbeat/tasks/main.yml +++ b/ansible/install/roles/browbeat/tasks/main.yml @@ -43,6 +43,44 @@ - name: Setup Rally deployment shell: . /home/stack/browbeat-venv/bin/activate; . /home/stack/overcloudrc; rally deployment create --fromenv --name overcloud +# +# Serve results out of httpd if results_in_httpd is set to true +# + +- name: Setup browbeat.conf in /etc/httpd/conf.d + copy: + src: 00-browbeat.conf + dest: /etc/httpd/conf.d/00-browbeat.conf + owner: root + group: root + mode: 0644 + become: true + when: results_in_httpd + notify: + - restart httpd + +- name: Check iptables for browbeat port(9000) + shell: iptables -nvL | grep -q "dpt:9000" + become: true + changed_when: false + when: results_in_httpd + register: browbeat_results_port + ignore_errors: true + +- name: Open iptables for browbeat port(9000) + shell: /usr/sbin/iptables -I INPUT 1 -p tcp --dport 9000 -j ACCEPT + become: true + when: results_in_httpd and browbeat_results_port.rc == 1 + +- name: Set seboolean(httpd_read_user_content) + seboolean: name=httpd_read_user_content state=yes persistent=yes + become: true + when: results_in_httpd + +- name: Allow httpd to serve content in /home/stack + file: path=/home/stack state=directory mode=0755 + when: results_in_httpd + # # Nova boot image tasks #