Allow log directories to be configured

In some cases it is useful to be able to configure the directory into
which log files are written by bifrost services.

Of particular note is the kolla-ansible project which typically stores
log files in a docker volume mapped to /var/log/kolla/ inside
containers. Currently the bifrost_deploy container is unable to persist
its logs for this reason.

This change enables configuration of the log directory path for the
following services:

- ironic-api
- ironic-conductor
- ironic-inspector
- nginx

Change-Id: I452052fa2f9a55fac2f00b454a5ac70464c9d981
Closes-Bug: #1685871
This commit is contained in:
Mark Goddard 2017-04-25 10:07:55 +01:00
parent 47b4547a14
commit 7b29f145e8
6 changed files with 39 additions and 2 deletions

View File

@ -155,6 +155,15 @@ remote_syslog_server: String value, default undefined. If set, rsyslog is
remote_syslog_port: String value, default is 514. If set, custom port is
configured for remote syslog server.
ironic_log_dir: String value, default undefined. If set, it specifies a
a non-default log directory for ironic.
inspector_log_dir: String value, default undefined. If set, it specifies a
non-default log directory for inspector.
nginx_log_dir: String value, default /var/log/nginx. It specifies a log
directory for nginx.
### Hardware Inspection Support
Bifrost also supports the installation of ironic-inspector in standalone

View File

@ -133,6 +133,15 @@ inspector_manage_firewall: false
# Deprecated: ironic_auth_strategy will be removed in Pike.
ironic_auth_strategy: "noauth"
# Set ironic_log_dir to use a non-default log directory for ironic.
#ironic_log_dir:
# Set inspector_log_dir to use a non-default log directory for inspector.
#inspector_log_dir:
# Set nginx_log_dir to use a non-default log directory for nginx.
nginx_log_dir: /var/log/nginx
inspector_data_dir: "/opt/stack/ironic-inspector/var"
inspector_store_ramdisk_logs: true
# Note: inspector_port_addition has three valid values: all, active, pxe

View File

@ -11,6 +11,10 @@ auth_strategy = {{ inspector_auth | default('noauth') }}
{% endif %}
debug = {{ inspector_debug | bool }}
{% if inspector_log_dir is defined %}
log_dir = {{ inspector_log_dir }}
{% endif %}
[database]
connection=mysql+pymysql://inspector:{{ ironic_db_password }}@localhost/inspector?charset=utf8

View File

@ -26,6 +26,10 @@ auth_strategy = keystone
auth_strategy = noauth
{% endif %}
{% if ironic_log_dir is defined %}
log_dir = {{ ironic_log_dir }}
{% endif %}
[pxe]
pxe_append_params = systemd.journald.forward_to_console=yes {{ extra_kernel_options | default('') }}
pxe_config_template = $pybasedir/drivers/modules/ipxe_config.template

View File

@ -30,8 +30,8 @@ http {
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
access_log {{ nginx_log_dir }}/access.log;
error_log {{ nginx_log_dir }}/error.log;
##
# Gzip Settings

View File

@ -0,0 +1,11 @@
---
features:
- |
Allows log directories to be configured
In some cases it is useful to be able to configure the directory into which
log files are written by bifrost services.
It is now possible to configure the ironic, inspector and nginx log
directories using the ``ironic_log_dir``, ``inspector_log_dir``, and
``nginx_log_dir`` variables respectively.