aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-03-23 07:09:04 +0000
committerGerrit Code Review <review@openstack.org>2016-03-23 07:09:05 +0000
commit47cce66181cc3995b8269e7eb792e4017de375df (patch)
tree5b58d021fd758defb57313ee02f3792953ad4856 /ansible
parent1ef3dd1de022d736358c9d902d290d69e0d45286 (diff)
parent8ec7811037919e8e54f332f63db70b9ff6eb724c (diff)
downloadkolla-47cce66181cc3995b8269e7eb792e4017de375df.tar.gz
kolla-47cce66181cc3995b8269e7eb792e4017de375df.zip
Merge "Changes horizon log location to kolla_logs volume"
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/common/tasks/config.yml1
-rw-r--r--ansible/roles/common/templates/heka-horizon.toml.j213
-rw-r--r--ansible/roles/common/templates/heka.json.j27
-rw-r--r--ansible/roles/horizon/tasks/config.yml1
-rw-r--r--ansible/roles/horizon/tasks/start.yml4
-rw-r--r--ansible/roles/horizon/templates/horizon.conf.j25
6 files changed, 26 insertions, 5 deletions
diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml
index c4d401ced..9835a318b 100644
--- a/ansible/roles/common/tasks/config.yml
+++ b/ansible/roles/common/tasks/config.yml
@@ -26,6 +26,7 @@
- { name: "elasticsearch", enabled: "{{ enable_central_logging }}" }
- { name: "global", enabled: "yes" }
- { name: "haproxy", enabled: "{{ enable_haproxy }}" }
+ - { name: "horizon", enabled: "{{ enable_horizon }}" }
- { name: "keystone", enabled: "{{ enable_keystone }}" }
- { name: "mariadb", enabled: "{{ enable_rabbitmq }}" }
- { name: "openstack", enabled: "yes" }
diff --git a/ansible/roles/common/templates/heka-horizon.toml.j2 b/ansible/roles/common/templates/heka-horizon.toml.j2
new file mode 100644
index 000000000..d3d4ac100
--- /dev/null
+++ b/ansible/roles/common/templates/heka-horizon.toml.j2
@@ -0,0 +1,13 @@
+[horizon_apache_log_decoder]
+type = "SandboxDecoder"
+filename = "lua_decoders/os_horizon_apache_log.lua"
+ [horizon_apache_log_decoder.config]
+ apache_log_pattern = '%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"'
+
+[horizon_apache_logstreamer_input]
+type = "LogstreamerInput"
+decoder = "horizon_apache_log_decoder"
+log_directory = "/var/log/kolla"
+file_match = 'horizon/horizon-apache-(?P<Service>.+)-access\.log\.?(?P<Seq>\d*)$'
+priority = ["^Seq"]
+differentiator = ["horizon-apache-", "Service"]
diff --git a/ansible/roles/common/templates/heka.json.j2 b/ansible/roles/common/templates/heka.json.j2
index 1087c60d0..94bd31d1e 100644
--- a/ansible/roles/common/templates/heka.json.j2
+++ b/ansible/roles/common/templates/heka.json.j2
@@ -45,6 +45,13 @@
"owner": "heka",
"perm": "0600"
},
+ {
+ "source": "{{ container_config_directory }}/heka-horizon.toml",
+ "dest": "/etc/heka/heka-horizon.toml",
+ "owner": "heka",
+ "perm": "0600",
+ "optional": {{ (not enable_horizon | bool) | string | lower }}
+ },
{% for swift_service in swift_services %}
{
"source": "{{ container_config_directory }}/heka-{{ swift_service }}.toml",
diff --git a/ansible/roles/horizon/tasks/config.yml b/ansible/roles/horizon/tasks/config.yml
index 28ded6d71..d70d73adf 100644
--- a/ansible/roles/horizon/tasks/config.yml
+++ b/ansible/roles/horizon/tasks/config.yml
@@ -21,7 +21,6 @@
with_items:
- "horizon"
-
- name: Copying over local_settings
template:
src: "local_settings.j2"
diff --git a/ansible/roles/horizon/tasks/start.yml b/ansible/roles/horizon/tasks/start.yml
index 19d0f8759..b9d6eb14a 100644
--- a/ansible/roles/horizon/tasks/start.yml
+++ b/ansible/roles/horizon/tasks/start.yml
@@ -5,5 +5,7 @@
common_options: "{{ docker_common_options }}"
image: "{{ horizon_image_full }}"
name: "horizon"
- volumes: "{{ node_config_directory }}/horizon/:{{ container_config_directory }}/:ro"
+ volumes:
+ - "{{ node_config_directory }}/horizon/:{{ container_config_directory }}/:ro"
+ - "kolla_logs:/var/log/kolla/"
when: inventory_hostname in groups['horizon']
diff --git a/ansible/roles/horizon/templates/horizon.conf.j2 b/ansible/roles/horizon/templates/horizon.conf.j2
index 1881978d0..b43b2b843 100644
--- a/ansible/roles/horizon/templates/horizon.conf.j2
+++ b/ansible/roles/horizon/templates/horizon.conf.j2
@@ -1,11 +1,10 @@
-{% set apache_dir = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %}
{% set python_path = '/usr/lib/python2.7/site-packages' if kolla_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %}
Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:80
<VirtualHost *:80>
LogLevel warn
- ErrorLog /var/log/{{ apache_dir }}/horizon.log
- CustomLog /var/log/{{ apache_dir }}/horizon-access.log combined
+ ErrorLog /var/log/kolla/horizon/horizon.log
+ CustomLog /var/log/kolla/horizon/horizon-access.log combined
WSGIScriptReloading On
WSGIDaemonProcess horizon-http processes=5 threads=1 user=horizon group=horizon display-name=%{GROUP} python-path={{ python_path }}