Update resource references for dependencies

The latest version of puppet now reports these as catalog failures so
this change removes the unnecessary references and the references
should be updated.

Change-Id: Id09c3358c5843510e6a2a8c0e2d4aeb3607e098b
Closes-Bug: #1702964
This commit is contained in:
ZhongShengping
2017-07-11 15:59:37 +08:00
parent 5dee44333a
commit 7ce50f94b8
8 changed files with 26 additions and 36 deletions

View File

@@ -71,9 +71,11 @@ define openstacklib::db::mysql (
ensure => present,
charset => $charset,
collate => $collate,
require => [ Class['mysql::server'], Class['mysql::client'] ],
}
Class['mysql::server'] ~> Mysql_database<| title == $dbname |>
Class['mysql::client'] ~> Mysql_database<| title == $dbname |>
if $create_user or $create_grant {
$allowed_hosts_list = unique(concat(any2array($allowed_hosts), [$host]))
$real_allowed_hosts = prefix($allowed_hosts_list, "${dbname}_")

View File

@@ -48,16 +48,18 @@ define openstacklib::db::mysql::host_access (
mysql_user { "${user}@${host}":
password_hash => $password_hash,
tls_options => $tls_options,
require => Mysql_database[$database],
}
Mysql_database<| title == $database |> ~>
Mysql_user<| title == "${user}@${host}" |>
}
if $create_grant {
mysql_grant { "${user}@${host}/${database}.*":
privileges => $privileges,
table => "${database}.*",
require => Mysql_user["${user}@${host}"],
user => "${user}@${host}",
}
Mysql_user<| title == "${user}@${host}" |> ~>
Mysql_grant<| title == "${user}@${host}/${database}.*" |>
}
}

View File

@@ -38,8 +38,10 @@ define openstacklib::policy::base (
lens => 'Json.lns',
incl => $file_path,
changes => "set dict/entry[*][.=\"${key}\"]/string \"${value}\"",
require => Augeas["${file_path}-${key}-${value}-add"],
}
Augeas<| title == "${file_path}-${key}-${value}-add" |> ~>
Augeas<| title == "${file_path}-${key}-${value}" |>
}

View File

@@ -91,9 +91,8 @@ define openstacklib::service_validation(
logoutput => 'on_failure',
}
anchor { "create ${service_name} anchor":
require => Exec["execute ${service_name} validation"],
}
anchor { "create ${service_name} anchor": } ->
Exec<| title == "execute ${service_name} validation" |>
}

View File

@@ -189,22 +189,20 @@ define openstacklib::wsgi::apache (
if !defined(File[$wsgi_script_dir]) {
file { $wsgi_script_dir:
ensure => directory,
owner => $user,
group => $group,
require => Package['httpd'],
ensure => directory,
owner => $user,
group => $group,
}
}
file { $service_name:
ensure => file,
links => follow,
path => "${wsgi_script_dir}/${wsgi_script_file}",
source => $wsgi_script_source,
owner => $user,
group => $group,
mode => '0644',
require => File[$wsgi_script_dir],
ensure => file,
links => follow,
path => "${wsgi_script_dir}/${wsgi_script_file}",
source => $wsgi_script_source,
owner => $user,
group => $group,
mode => '0644',
}
$wsgi_daemon_process_options = {
@@ -243,7 +241,10 @@ define openstacklib::wsgi::apache (
wsgi_chunked_request => $wsgi_chunked_request,
custom_fragment => $vhost_custom_fragment,
allow_encoded_slashes => $allow_encoded_slashes,
require => File[$service_name],
}
Package<| name == 'httpd' |>
~> File<| title == $wsgi_script_dir |>
~> File <| title == $service_name |>
~> Apache::Vhost<| title == $service_name |>
}

View File

@@ -20,7 +20,6 @@ describe 'openstacklib::policy::base' do
'lens' => 'Json.lns',
'incl' => '/etc/nova/policy.json',
'changes' => 'set dict/entry[*][.="context_is_admin or owner"]/string "foo:bar"',
'require' => 'Augeas[/etc/nova/policy.json-context_is_admin or owner-foo:bar-add]'
)
end

View File

@@ -43,10 +43,6 @@ describe 'openstacklib::service_validation' do
:logoutput => 'on_failure',
)}
it { is_expected.to contain_anchor("create #{title} anchor").with(
:require => "Exec[execute #{title} validation]",
)}
end
context 'with unless parameter' do
@@ -65,10 +61,6 @@ describe 'openstacklib::service_validation' do
:unless => 'pwd',
)}
it { is_expected.to contain_anchor("create #{title} anchor").with(
:require => "Exec[execute #{title} validation]",
)}
end
context 'with onlyif parameter' do
@@ -87,10 +79,6 @@ describe 'openstacklib::service_validation' do
:onlyif => 'pwd',
)}
it { is_expected.to contain_anchor("create #{title} anchor").with(
:require => "Exec[execute #{title} validation]",
)}
end
context 'when omitting a required parameter command' do

View File

@@ -52,7 +52,6 @@ describe 'openstacklib::wsgi::apache' do
'ensure' => 'directory',
'owner' => 'keystone',
'group' => 'keystone',
'require' => 'Package[httpd]'
)}
it { is_expected.to contain_file('keystone_wsgi').with(
@@ -84,7 +83,6 @@ describe 'openstacklib::wsgi::apache' do
'display-name' => 'keystone_wsgi',
},
'wsgi_application_group' => '%{GLOBAL}',
'require' => 'File[keystone_wsgi]',
'setenvif' => ['X-Forwarded-Proto https HTTPS=1']
)}
it { is_expected.to contain_concat("#{platform_params[:httpd_ports_file]}") }
@@ -128,7 +126,6 @@ describe 'openstacklib::wsgi::apache' do
'wsgi_application_group' => '%{GLOBAL}',
'wsgi_pass_authorization' => 'On',
'wsgi_chunked_request' => 'On',
'require' => 'File[keystone_wsgi]',
'custom_fragment' => 'LimitRequestFieldSize 81900',
'allow_encoded_slashes' => 'on',
)}