Project

General

Profile

Actions

Bug #30165

open

wrong @host.puppetmaster rendered by templates when using multiples puppetmasters

Added by Yvan Broccard over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Hello,

I have discovered a weird behavour with the use of templates when using the @host.puppetmaster parameter.

I have 4 puppetmasters, among them one is the CA.
It worked in the past, but I have discovered now that it doesn't work as intended.
The puppetmaster set in the "edit host" is not used when rendering the template.

I have 4 foreman-proxies :
proxy A : environment production + puppet CA
proxy B : environment production
proxy C : environment testing
proxy D : environment lab

the @host.puppetmaster parameter is expanded correctly for hosts in the lab environment, but in the testing and production environment, it always display "proxy A", whatever setting it set on the node.

hammer host info --id 510
...
Puppet Environment: testing
Puppet CA Proxy: Proxy A
Puppet Master Proxy: Proxy C
Cert name: vmlabybr18.staging.rsvgnw.local
Managed: yes

I use the default template "kickstart default" which uses @host.puppetmaster a lot.
I have added some debug code in a "kickstart default custom post" template :

echo "This is the Puppetmaster : <%= @host.puppetmaster %>"

... and this code shows me "Proxy A" instead of "Proxy C". The puppet.conf is wrongly generated by foreman as a result (template puppet.conf)

I'm using Foreman 1.24.3 on CentOS7

I think it used to work as intended in the past.

Actions #1

Updated by Yvan Broccard over 4 years ago

  • Category set to Templates
Actions

Also available in: Atom PDF