rdpusc
September 25, 2019, 10:37pm
#1
New Foreman 1.23.0 server installs puppet server 6.x and new VMs puppet agent 3.6 which gives certificate chain error. Installing puppet agent 6.9 on the host fixes the cert error.
How do we get foreman to install the right puppet agent version?
Thanks
ekohl
September 25, 2019, 11:38pm
#2
Assuming you’re doing kickstarts then I’d look for the parameters to enable the puppetlabs repo.
1 Like
On some of our CentOS systems, installing the puppet
package installs Puppet Agent 3.6. By default, Foreman installs the package provided by the OS. As ekohl says, the best solution is to enable the Puppetlabs repo.
On the Puppet Slack channels, some people are saying that the cert issue between Puppet Server 6.x and Puppet Agent 3.6 began recently.
rdpusc
September 26, 2019, 4:44pm
#4
The kickstart default template refers to version 5 and 6 so why is puppet agent 3 getting installed on new hosts?
kickstart default template
<% if puppet_enabled %>
<% if host_param_true?(‘enable-puppetlabs-repo’) || host_param_true?(‘enable-puppetlabs-puppet6-repo’) || host_param_true?(‘enable-puppetlabs-puppet5-repo’) -%>
<%= snippet ‘puppetlabs_repo’ %>
<% end -%>
<%= snippet ‘puppet_setup’ %>
<% end -%>
I believe that code will only activate if you set enable-puppetlabs-repo
enable-puppetlabs-puppet6-repo
or enable-puppetlabs-puppet5-repo
to true, which you would normally do at a OS or Hostgroup level.
Otherwise, the code will skip the snippet ‘puppetlabs_repo’
section and proceed onto snippet ‘puppet_setup’
.
Note that I had a similar issue with Ubuntu, which led to some downstream errors that were hard to figure out. See: Foreman vs. puppetlabs::puppet_agent: `he puppet_agent module does not support pre-Puppet 4 upgrades`
rdpusc
September 26, 2019, 6:43pm
#6
Hi
I set operating system parameter to enable-puppetlabs-puppet6-repo true and now puppet agent isnt getting installed at all
That’s the finish template the OS is using:
<%#
kind: finish
name: Preseed default finish
model: ProvisioningTemplate
oses:
- Debian
- Ubuntu
%>
<%
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || host_param_true?('force-puppet')
salt_enabled = host_param('salt_master') ? true : false
chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
%>
<% subnet = @host.subnet -%>
<% if subnet.respond_to?…
rdpusc
September 26, 2019, 6:52pm
#7
I tried this here
You only have to add enable-puppetlabs-puppet5-repo as a parameter of type boolean with value true. I prefer adding it on the operating system, but you can also add it as global parameter or host depending on granularity needed.
ekohl
September 26, 2019, 10:10pm
#8
Probably because that’s in EPEL.
rdpusc
September 26, 2019, 10:21pm
#9
I tried the OS parameter of enable-puppetlabs-puppet6-repo true and failed to install - no error message found yet just no puppet agent
rdpusc
September 26, 2019, 10:22pm
#10
its not installing puppet agent 3 either so not an EPEL issue I dont think
ekohl
September 26, 2019, 10:58pm
#11
Probably the known issue in 1.23:
rdpusc
September 27, 2019, 3:13pm
#12
I cant find the kickstart template to edit to add the fix in the the link above. None of the the kickstart templates have this. What template do we edit? - thanks from the link above its only one line to edit
repo_name = ‘puppetlabs-release’
repo_subdir = ‘’
elsif host_param_true?(‘enable-puppetlabs-puppet6-repo’)
repo_name = ‘puppetlabs-release-puppet6’
repo_name = ‘puppet6-release’
repo_subdir = ‘puppet6/’
elsif host_param_true?(‘enable-puppetlabs-puppet5-repo’)
repo_name = ‘puppet5-release’
rdpusc
September 27, 2019, 5:22pm
#14
This the kickstart finish template complete puppet section - still not working no puppet agent installed.
any ideas anyone?
<% if puppet_enabled %>
<% if host_param_true?(‘enable-puppetlabs-repo’) || host_param_true?(‘enable-puppetlabs-puppet6-repo’) || host_param_true?(‘enable-puppetlabs-puppet5-repo’) -%>
<%= snippet ‘puppetlabs_repo’ %>
if host_param_true?(‘enable-puppetlabs-repo’)
repo_name = ‘puppetlabs-release’
repo_subdir = ‘’
elsif host_param_true?(‘enable-puppetlabs-puppet6-repo’)
repo_name = ‘puppet6-release’
repo_subdir = ‘puppet6/’
elsif host_param_true?(‘enable-puppetlabs-puppet5-repo’)
repo_name = ‘puppet5-release’
<% end -%>
<%= snippet ‘puppet_setup’ %>
<% end -%>
ekohl
September 27, 2019, 5:30pm
#15
What are your host parameters during provisioning?
rdpusc
September 27, 2019, 5:38pm
#16
Host operating system parameters
enable-puppetlabs-puppet6-repo boolean true
rdpusc
September 30, 2019, 4:10pm
#17
Hi
Does the base centos repository need to have the puppet repo installed?
This is the correct current repo install for puppet-agent 6
rpm -Uvh https://yum.puppet.com/puppet6-release-el-7.noarch.rpm
rdpusc
October 2, 2019, 4:36pm
#18
I created an entire new template based on this and still no puppet agent install,
any ideas anyone?
rdpusc
October 7, 2019, 10:37pm
#19
Hi
It is very unclear how to make this change in the community default kickstart template
a little help please
rdpusc
October 8, 2019, 3:06pm
#20
What I am referring to specifically is the template has <% syntax and the patch doesnt