Skip to content

Commit

Permalink
Run 'keystone db_sync' as keystone user.
Browse files Browse the repository at this point in the history
Running db_sync as root can cause permissions issues due to the fact
that the keystone log file gets owned as root
(/var/log/keystone/keystone.log).

This makes this module usable when using packages on Fedora 18.

Change-Id: I2c75db61474fb14f898c530bec2e8aad1230ad7c
  • Loading branch information
dprince authored and bodepd committed Apr 10, 2013
1 parent d01e076 commit 7adce5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions manifests/init.pp
Expand Up @@ -184,9 +184,11 @@
# created
exec { 'keystone-manage db_sync':
path => '/usr/bin',
user => 'keystone',
refreshonly => true,
notify => Service['keystone'],
subscribe => Package['keystone'],
require => User['keystone'],
}
}
}
6 changes: 4 additions & 2 deletions spec/classes/keystone_spec.rb
Expand Up @@ -89,11 +89,13 @@
) }

it 'should only migrate the db if $enabled is true' do
if param_hash[:enabled]
if param_hash['enabled']
should contain_exec('keystone-manage db_sync').with(
:user => 'keystone',
:refreshonly => true,
:notify => 'Service[keystone]',
:subscribe => ['Package[keystone]', 'Concat[/etc/keystone/keystone.conf]']
:subscribe => 'Package[keystone]',
:require => 'User[keystone]'
)
end
end
Expand Down

0 comments on commit 7adce5b

Please sign in to comment.