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

@@ -170,7 +170,9 @@ class cloud::image(
# 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 {'glance_db_sync':
command => '/usr/bin/glance-manage db_sync',
command => 'glance-manage db_sync',
user => 'glance',
path => '/usr/bin',
unless => "/usr/bin/mysql glance -h ${glance_db_host} -u ${encoded_glance_user} -p${encoded_glance_password} -e \"show tables\" | /bin/grep Tables"
}