From f43996fda55c96aeb4a4bdc04df5fd753acbd428 Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Wed, 12 Aug 2015 11:13:01 +0200 Subject: [PATCH] Rely on autorequire for config resource ordering Currently we specify the ordering of config resources wherever it is necessary based on the presence of the file it will write to, or the presence of the package in charge of providing the file it will write to. Those kind of ordering can be specified directly at the resource level using the autorequire mechanism. With this patch, any config resource will make sure the package in charge of providing the file will be installed first. Change-Id: If90d097129bad922511465345d577df37d84e78b --- lib/puppet/type/tuskar_config.rb | 5 +++++ manifests/api.pp | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/puppet/type/tuskar_config.rb b/lib/puppet/type/tuskar_config.rb index d78cc9e..a11dcd8 100644 --- a/lib/puppet/type/tuskar_config.rb +++ b/lib/puppet/type/tuskar_config.rb @@ -39,4 +39,9 @@ Puppet::Type.newtype(:tuskar_config) do defaultto false end + + autorequire(:package) do + 'tuskar-api' + end + end diff --git a/manifests/api.pp b/manifests/api.pp index 25b9dc7..cfad3a9 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -111,7 +111,6 @@ class tuskar::api( Tuskar_config<||> ~> Exec['post-tuskar_config'] Tuskar_config<||> ~> Service['tuskar-api'] - Package['tuskar-api'] -> Tuskar_config<||> if $::tuskar::database_connection { if($::tuskar::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {