From 5b308d69c7d9a6356b1a300b8cf2d9448ffa4644 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Fri, 4 Oct 2013 16:56:22 +0200 Subject: [PATCH] Set prerun_command with inifile instead of augeas This also fixes the deprecation warning of `r10k synchronize` --- manifests/params.pp | 3 +++ manifests/prerun_command.pp | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index ec209670..57756c93 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -15,6 +15,9 @@ $repo_path = '/var/repos' $remote = "ssh://${git_server}${repo_path}/modules.git" + # prerun_command in puppet.conf + $prerun_command = 'r10k deploy environment -p' + # Bundle to get bleeding edge instead of gem $use_bundle = false diff --git a/manifests/prerun_command.pp b/manifests/prerun_command.pp index 87339a7b..a8d6bf09 100644 --- a/manifests/prerun_command.pp +++ b/manifests/prerun_command.pp @@ -1,9 +1,16 @@ # This class will configure r10k to run as part of the masters agent run class r10k::prerun_command ( - $command = 'r10k synchronize' -){ - augeas{'puppet.conf prerun_command' : - context => '/files//puppet.conf/agent', - changes => "set prerun_command 'r10k synchronize'", + $command = $r10k::params::prerun_command +) inherits r10k::params { + + Ini_setting { + path => "$puppetconf_path/puppet.conf", + ensure => present, + section => 'agent', + } + + ini_setting { 'r10k_prerun_command': + setting => 'prerun_command', + value => $command, } }