Add serve browbeat results out of httpd to browbeat install playbook.

Change-Id: If623b5c06fff8c084e50ddb2227ed3a06160cdbd
This commit is contained in:
Alex Krzos 2016-01-30 11:45:43 -05:00
parent 9b1b4d75f1
commit 489306ef15
4 changed files with 62 additions and 0 deletions

View File

@ -5,6 +5,8 @@
- hosts: undercloud
remote_user: stack
vars:
results_in_httpd: true
roles:
- common
- browbeat

View File

@ -0,0 +1,14 @@
# Browbeat httpd config to serve results on undercloud
# Installed via browbeat installer
Listen 9000
<VirtualHost *:9000>
ServerName browbeat-results
DocumentRoot "/home/stack/browbeat/results"
<Directory "/home/stack/browbeat/results">
Options Indexes FollowSymLinks
IndexOptions NameWidth=*
AllowOverride None
Require all granted
</Directory>
</VirtualHost>

View File

@ -0,0 +1,8 @@
---
#
# Browbeat installer handlers
#
- name: restart httpd
service: name=httpd state=restarted
become: true

View File

@ -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
#