run db-sync with OpenStack users

When db-sync is run by OpenStack CLI tools (i.e. nova-manage), it writes
in /var/log/ with root user.
In the case where we don't use syslog, the service can't start since it
will try to write as non-root user in the log file.

This patch aims to run the commands with OpenStack users.
This commit is contained in:
Emilien Macchi
2014-04-15 17:28:28 +02:00
parent f709c91d1c
commit c7a4cdccad
12 changed files with 36 additions and 12 deletions

View File

@@ -146,7 +146,9 @@ class cloud::orchestration(
# We have to do this only on the primary node of the galera cluster to avoid race condition
# https://github.com/enovance/puppet-openstack-cloud/issues/156
exec {'heat_db_sync':
command => '/usr/bin/heat-manage --config-file /etc/heat/heat.conf db_sync',
command => 'heat-manage --config-file /etc/heat/heat.conf db_sync',
path => '/usr/bin',
user => 'heat',
unless => "/usr/bin/mysql heat -h ${heat_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
}