Switch openstacklib::policyrcd class to policy_rcd provider

Switch using of policyrcd class to policy_rcd provider because
provider can be called multiple times and be consistent across
all modules.

Change-Id: Idc3e6a8d9ed34941c1506370846c340064ff57ff
Depends-On: I1bad3301729fa6310d9d1a50c22c621ffe44e24a
This commit is contained in:
Denis Egorenko 2016-06-20 14:13:11 +03:00
parent 50cdfe9678
commit 33e051ca75

View File

@ -709,15 +709,16 @@ class keystone(
}
if $manage_policyrcd {
# openstacklib::policyrcd only affects debian based systems.
Class['::openstacklib::policyrcd'] -> Package['keystone']
Class['::openstacklib::policyrcd'] -> Package['httpd']
# openstacklib policy_rcd only affects debian based systems.
Policy_rcd <| title == 'keystone' |> -> Package['keystone']
Policy_rcd['apache2'] -> Package['httpd']
# we don't have keystone service anymore starting from Newton
if ($::operatingsystem == 'Ubuntu') and (versioncmp($::operatingsystemmajrelease, '16') >= 0) {
class { '::openstacklib::policyrcd': services => ['apache2'] }
$policy_services = 'apache2'
} else {
class { '::openstacklib::policyrcd': services => ['keystone', 'apache2'] }
$policy_services = ['keystone', 'apache2']
}
ensure_resource('policy_rcd', $policy_services, { ensure => present, 'set_code' => '101' })
}
include ::keystone::db