Use www-data user for bifrost nginx log directory

Bifrost uses the www-data user for nginx on debian/ubuntu, and nginx on
other platforms. Kolla-ansible currently uses the nginx user for all
platforms when creating a log directory. This change uses the www-data
user on debian/ubuntu when setting ownership of the bifrost nginx log
directory.

Change-Id: I142a158b6f2e8f8a46b684267f6fbb2a6e22a259
Closes-Bug: #1753750
This commit is contained in:
Mark Goddard 2018-03-06 13:25:16 +00:00
parent 376c607f37
commit 2f8c9f83fa

View File

@ -1,5 +1,8 @@
---
- name: Ensure log directories exist
vars:
nginx_user: "{{ 'www-data' if is_debian else 'nginx' }}"
is_debian: "{{ kolla_base_distro in ['debian', 'ubuntu'] }}"
command: >
docker exec bifrost_deploy
bash -c 'mkdir -p /var/log/kolla/ironic &&
@ -7,7 +10,7 @@
mkdir -p /var/log/kolla/ironic-inspector &&
chown ironic:ironic /var/log/kolla/ironic-inspector &&
mkdir -p /var/log/kolla/nginx &&
chown nginx:nginx /var/log/kolla/nginx'
chown {{ nginx_user }}:{{ nginx_user }} /var/log/kolla/nginx'
- name: Bootstrap bifrost (this may take several minutes)
command: >