Make Heka collect Manila logs

Partially implements: blueprint heka

Change-Id: I3fadbf29f5219a293b8b1114d192e27888be2c59
This commit is contained in:
Mauricio Lima 2016-03-03 10:47:38 -05:00
parent 50130834bf
commit 285e42a99c
5 changed files with 20 additions and 6 deletions

View File

@ -6,5 +6,5 @@ filename = "lua_decoders/os_openstack_log.lua"
type = "LogstreamerInput" type = "LogstreamerInput"
decoder = "openstack_log_decoder" decoder = "openstack_log_decoder"
log_directory = "/var/log/kolla" log_directory = "/var/log/kolla"
file_match = '(?P<Service>nova|glance|keystone|neutron|cinder|heat|murano|magnum|mistral)/(?P<Program>.*)\.log' file_match = '(?P<Service>nova|glance|keystone|neutron|cinder|heat|murano|magnum|mistral|manila)/(?P<Program>.*)\.log'
differentiator = ["Service", "_", "Program"] differentiator = ["Service", "_", "Program"]

View File

@ -2,7 +2,6 @@
debug = {{ manila_logging_debug }} debug = {{ manila_logging_debug }}
log_dir = /var/log/kolla/manila log_dir = /var/log/kolla/manila
use_forwarded_for = true
my_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} my_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}

View File

@ -1,8 +1,8 @@
FROM {{ namespace }}/{{ image_prefix }}manila-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}manila-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_manila_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_manila_extend_start
{{ include_footer }} {{ include_footer }}

View File

@ -14,9 +14,9 @@ ADD manila-base-archive /manila-base-source
RUN ln -s manila-base-source/* manila \ RUN ln -s manila-base-source/* manila \
&& useradd --user-group manila \ && useradd --user-group manila \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /manila \ && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /manila \
&& mkdir -p /etc/manila /var/lib/manila /var/cache/manila /var/log/manila /home/manila \ && mkdir -p /etc/manila /var/lib/manila /var/cache/manila /home/manila \
&& cp -r /manila/etc/manila/* /etc/manila/ \ && cp -r /manila/etc/manila/* /etc/manila/ \
&& chown -R manila: /etc/manila /var/lib/manila /var/cache/manila /var/log/manila /home/manila \ && chown -R manila: /etc/manila /var/lib/manila /var/cache/manila /home/manila \
&& sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/manila/rootwrap.conf && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/manila/rootwrap.conf
COPY manila_sudoers /etc/sudoers.d/manila_sudoers COPY manila_sudoers /etc/sudoers.d/manila_sudoers
@ -25,4 +25,9 @@ RUN chmod 750 /etc/sudoers.d \
{% endif %} {% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN touch /usr/local/bin/kolla_manila_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_manila_extend_start
RUN usermod -a -G kolla manila RUN usermod -a -G kolla manila

View File

@ -0,0 +1,10 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/manila" ]]; then
mkdir -p /var/log/kolla/manila
fi
if [[ $(stat -c %a /var/log/kolla/manila) != "755" ]]; then
chmod 755 /var/log/kolla/manila
fi
source /usr/local/bin/kolla_manila_extend_start