Good day,
We recently installed puppet and foreman in our environment. We love it so
far, one item that we were curious about was the best method to install the
puppet agents?
We are using VMware, have computer resource connected to our lab VMware
environment.
I thought about trying to install the agent as like a post task but wasn't
sure what others have done?
We plan to use the api to kick off new host builds.
Any input or suggestions would be greatly appreciated.
Thank you
Did you try this add it into you kickstart
echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippet 'puppet.conf' %>
EOF
Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags
no_such_tag <%= @host.puppetmaster.blank? ? '' : "–server
#{@host.puppetmaster}" %> --no-daemonize
<% end -%>
Create a snippet of puppet.conf
%#
kind: snippet
name: puppet.conf
%>
<%
if @host.param_true?('enable-puppetlabs-pc1-repo') &&
(@host.operatingsystem.family == 'Debian' || @host.operatingsystem.family
== 'Redhat')
var_dir = '/opt/puppetlabs/puppet/cache'
log_dir = '/var/log/puppetlabs/puppet'
run_dir = '/var/run/puppetlabs'
ssl_dir = '/etc/puppetlabs/puppet/ssl'
else
if @host.operatingsystem.family == 'Freebsd'
var_dir = '/var/puppet'
else
var_dir = '/var/lib/puppet'
end
log_dir = '/var/log/puppet'
run_dir = '/var/run/puppet'
ssl_dir = '$vardir/ssl'
end
%>
[main]
vardir = <%= var_dir %>
logdir = <%= log_dir %>
rundir = <%= run_dir %>
ssldir = <%= ssl_dir %>
[agent]
pluginsync = true
report = true
ignoreschedules = true
<%- if @host.puppet_ca_server.strip -%>
ca_server = <%= @host.puppet_ca_server %>
<%- end -%>
certname = <%= @host.certname %>
environment = <%= @host.environment %>
server = <%= @host.puppetmaster %>
Thank you very much for the help Greg.
···
On Monday, October 31, 2016 at 2:58:30 PM UTC-5, Greg Sutcliffe wrote:
>
> The default templates that come with Foreman install Puppet by default,
> assuming the host has a Puppetmaster set in the UI. If you're not using the
> defaults, you can look at [1] for SSH-based provisioning and [2] for
> cloud-init based provisioning, which should get you going. Both of those
> actually reference [3] & [4], for detail.
>
> [1]
> https://github.com/theforeman/community-templates/blob/develop/kickstart/finish.erb#L63-L66
> [2]
> https://github.com/theforeman/community-templates/blob/develop/cloudinit/userdata_cloudinit.erb#L68-L73
> [3]
> https://github.com/theforeman/community-templates/blob/develop/snippets/puppetlabs_repo.erb
> [4]
> https://github.com/theforeman/community-templates/blob/develop/snippets/puppet_setup.erb
>
> Cheers
> Greg
>