Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set prerun_command with inifile instead of augeas #13

Merged
merged 1 commit into from
Oct 9, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 12 additions & 5 deletions manifests/prerun_command.pp
Original file line number Diff line number Diff line change
@@ -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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where $puppetconf_path is being declared, I think it either needs to be added to params and redeclared as a local var like $command or perhaps just changed to $::confdir as previously discussed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in r10k::params::puppetconf_path, lines 23 and 33 in master :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;) I have merged but I think we should probably fully qualify the var as $r10k::params::puppetconf_path or redefine it as a param.

ensure => present,
section => 'agent',
}

ini_setting { 'r10k_prerun_command':
setting => 'prerun_command',
value => $command,
}
}