diff --git a/manifests/config/secret.pp b/manifests/config/secret.pp index c690b29f..d2bd8128 100644 --- a/manifests/config/secret.pp +++ b/manifests/config/secret.pp @@ -51,23 +51,12 @@ onlyif => "rd keys info -p '${keystorage_path}'", } } else { - exec { - default: - path => ['/bin', '/usr/bin', '/usr/local/bin'], - environment => $rundeck::cli::environment, - ; - "Create rundeck ${type}: ${keystorage_path}": - command => "rd keys create -t ${type} -p '${keystorage_path}' -f '${keystorage_dir}/${_filename}'", - unless => "rd keys info -p '${keystorage_path}'", - refreshonly => true, - subscribe => File["${keystorage_dir}/${_filename}"], - ; - "Update rundeck ${type}: ${keystorage_path}": - command => "rd keys update -t ${type} -p '${keystorage_path}' -f '${keystorage_dir}/${_filename}'", - onlyif => "rd keys info -p '${keystorage_path}'", - refreshonly => true, - subscribe => File["${keystorage_dir}/${_filename}"], - ; + exec { "Create/update rundeck ${type}: ${keystorage_path}": + command => "if rd keys info -p '${keystorage_path}'; then rd keys update -t ${type} -p '${keystorage_path}' -f '${keystorage_dir}/${_filename}'; else rd keys create -t ${type} -p '${keystorage_path}' -f '${keystorage_dir}/${_filename}'; fi", + path => ['/bin', '/usr/bin', '/usr/local/bin'], + environment => $rundeck::cli::environment, + refreshonly => true, + subscribe => File["${keystorage_dir}/${_filename}"], } } }