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

allow passing extra_params to puppet agent #10

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 1 deletion manifests/server.pp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
$post_hook_content = $puppet::params::post_hook_content, $post_hook_content = $puppet::params::post_hook_content,
$post_hook_name = $puppet::params::post_hook_name, $post_hook_name = $puppet::params::post_hook_name,
$agent_template = $puppet::params::agent_template, $agent_template = $puppet::params::agent_template,
$master_template = $puppet::params::master_template $master_template = $puppet::params::master_template,
$agent_params = undef
Copy link
Member

Choose a reason for hiding this comment

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

Why call it "agent_params" and only put it in server.pp? Do you not want it in init.pp too? If you don't, your example in the commit log doesn't work...

) inherits puppet::params { ) inherits puppet::params {
class { 'puppet::server::install': }~> class { 'puppet::server::install': }~>
class { 'puppet::server::config': } class { 'puppet::server::config': }
Expand Down
5 changes: 5 additions & 0 deletions templates/puppet.conf.erb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@
environment = <%= environment %> environment = <%= environment %>
certname = <%= clientcert %> certname = <%= clientcert %>
server = <%= puppetmaster rescue fqdn %> server = <%= puppetmaster rescue fqdn %>
<% if has_variable?("agent_params") and agent_params != :undef -%>
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't work - the variable is $puppet::agent_params (or $puppet::server::agent_params). You need to do something like:

$params = $puppet::agent_params

in config.pp and then use the local $params variable in the template.

<% agent_params.each do |param| -%>
<%= param %>
<% end -%>
<% end -%>