2014-08-26 18:08:15 -05:00

124 lines
3.0 KiB
YAML

---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Download Kibana
get_url: >
url={{ kibana_url }}
dest=/tmp/kibana.tar.gz
mode=0644
- name: Extract Kibana
unarchive: >
copy=no
src=/tmp/kibana.tar.gz
dest=/opt
- name: Link Kibana Directory
file: >
state=link
src=/opt/kibana-3.1.0
dest={{ kibana_root }}
owner={{ system_user }}
group={{ system_group }}
- name: create self-signed SSL cert
command: >
openssl req -new -nodes -x509 -subj
"/C=US/ST=Texas/L=San Antonio/O=IT/CN={{ kibana_server_name }}"
-days 365
-keyout /etc/ssl/private/apache.key
-out /etc/ssl/certs/apache.cert
-extensions v3_ca
creates=/etc/ssl/certs/apache.cert
when: kibana_self_signed is defined and kibana_self_signed == true
- name: enable mod_rewrite
command: a2enmod rewrite
- name: enable mod_ssl
command: a2enmod ssl
- name: enable mod_proxy
command: a2enmod proxy
- name: enable mod_proxy_http (protocol handler)
command: a2enmod proxy_http
- name: Kibana Setup
template: >
src={{ item }}
dest="/etc/apache2/sites-available/{{ item }}"
owner={{ system_user }}
group={{ system_group }}
register: results
with_items:
- 000-kibana.conf
- name: Fix Apache2 Paths
template: >
src={{ item }}
dest="/etc/apache2/{{ item }}"
owner=root
group=root
with_items:
- apache2.conf
- name: Drop Apache2 Ports File
template: >
src={{ item }}
dest="/etc/apache2/{{ item }}"
owner=root
group=root
with_items:
- ports.conf
- name: Kibana Config
template: >
src={{ item }}
dest="{{ kibana_root }}/{{ item }}"
owner={{ system_user }}
group={{ system_group }}
register: results
with_items:
- config.js
- name: Link Kibana Site
file: >
state=link
src=/etc/apache2/sites-available/000-kibana.conf
dest=/etc/apache2/sites-enabled/000-kibana.conf
owner={{ system_user }}
group={{ system_group }}
- name: Remove Apache Default Site
file: >
state=absent
path=/etc/apache2/sites-enabled/000-default.conf
- name: Create kibana http_auth user
htpasswd: path=/etc/apache2/users name=kibana password={{ kibana_password }} owner=root group=www-data mode=0640 create=yes state=present
- name: Install Next Gen RPC Dashboard
template: >
src={{ item }}
dest="/opt/kibana/app/dashboards/{{ item }}"
owner=root
group=root
with_items:
- Next-Gen-RPC.json
- name: Restart Apache
service: name=apache2 state=restarted