Update in murano::application_package

* add unless and retries to murano_import_package exec

Change-Id: I05c75b988d365fc5c5716b3a61f94897dfe637ca
Closes-Bug: #1445034
This commit is contained in:
Igor Yozhikov 2015-04-17 17:09:11 +03:00
parent 65617981be
commit 06cd79ba9a
2 changed files with 11 additions and 6 deletions

View File

@ -165,7 +165,7 @@ class murano::api (
Murano_config<||> -> Exec['murano_manage_db_sync']
murano::application_package{'io.murano.zip':
murano::application_package{'io.murano':
os_username => $admin_user,
os_password => $admin_password,
os_auth_url => $keystone_auth_url,

View File

@ -11,13 +11,16 @@ define murano::application_package (
$os_auth_url = 'http://127.0.0.1:5000/v2.0/',
$mandatory = false,
) {
$package_path="/var/cache/murano/meta/${package_name}"
$package_path="/var/cache/murano/meta/${package_name}.zip"
$murano_cli_cmd = $package_category ? {
'' => "${murano_cli} package-import '${package_path}' --is-public --exists-action u",
default => "${murano_cli} package-import '${package_path}' -c '${package_category}' --is-public --exists-action u"
if $package_category {
$murano_cli_cmd = "${murano_cli} package-import '${package_path}' -c '${package_category}' --is-public --exists-action u"
} else {
$murano_cli_cmd = "${murano_cli} package-import '${package_path}' --is-public --exists-action u"
}
$murano_cli_pkgcheck = "${murano_cli} package-list 2>&1 | grep -q ${package_name}"
exec { "murano_import_package_${package_name}":
path => '/sbin:/usr/sbin:/bin:/usr/bin',
environment => [
@ -30,6 +33,8 @@ define murano::application_package (
command => $murano_cli_cmd,
user => $runas_user,
group => $runas_user,
onlyif => "test -e '${package_path}'"
tries => 3,
try_sleep => 10,
unless => $murano_cli_pkgcheck,
}
}