Bug 1511158

Summary: puppet4 host is setup to use default puppet3 puppetdirs
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: Provisioning TemplatesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, dlobatog, egolov, mhulan
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.15.6.8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:29:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Pramuk 2017-11-08 19:12:16 UTC
Description of problem:
puppet4 host is setup for non-default p4 puppetdirs. nothing is broken but we diverted from p4 default dirs and I guess that's not what we want...

@p4 provisioned host:

[main]
vardir = /var/lib/puppet  < p3 default
logdir = /var/log/puppet  < p3 default
rundir = /var/run/puppet  < p3 default
ssldir = $vardir/ssl

It can be fixed by changes in "puppet.conf" provisioning template to extend first condition to include also enable-puppet4 param:

  if (@host.param_true?('enable-puppetlabs-pc1-repo') || @host.param_true?('enable-puppet4')) && (os_family == 'Debian' || os_family == 'Redhat' || os_name == 'SLES')

Version-Release number of selected component (if applicable):
Satellite 6.3.0 Beta Snap23 

How reproducible:
deterministic

Steps to Reproduce:
1. Provision p4 host (with AK bound to p4 repo and by "enable-puppet4" param set to true

2. Check puppetdirs in the puppet conf
# grep dir /etc/puppetlabs/puppet/puppet.conf 

Actual results:
vardir = /var/lib/puppet
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl

Expected results:
vardir = /opt/puppetlabs/puppet/cache
logdir = /var/log/puppetlabs/puppet
rundir = /var/run/puppetlabs
ssldir = /etc/puppetlabs/puppet/ssl

Comment 2 Daniel Lobato Garcia 2017-11-14 09:59:30 UTC
https://github.com/theforeman/community-templates/commit/1207a19b55051ed0687a33d7a8de1834dc2d46fb already fixes this upstream, and 1.16 Foreman includes it, so it shouldn't be hard to fix. 

I think I will just submit a Merge Request for this in Satellite, will update as soon as I know how to proceed.

Comment 4 Lukas Pramuk 2017-11-21 13:19:50 UTC
Verification is blocked by #1514902 (extra line break causing template to fail to render)

Comment 5 Marek Hulan 2017-11-21 16:44:14 UTC
If this is a manual verification, feel free to unlock the template, delete the \n and continue testing this BZ.

Comment 6 Lukas Pramuk 2017-11-22 10:24:30 UTC
I did and things are just fine - p3 works p4 works too. 
Once the fix lands I 'll verify this bz

Comment 7 Lukas Pramuk 2017-11-30 10:14:13 UTC
VERIFIED.

@satellite-6.3.0-21.0.beta.el7sat.noarch
foreman-1.15.6.12-1.el7sat.noarch

by manual reproducer described in comment#0:

@p4 host:

# grep dir /etc/puppetlabs/puppet/puppet.conf 
vardir = /opt/puppetlabs/puppet/cache
logdir = /var/log/puppetlabs/puppet
rundir = /var/run/puppetlabs
ssldir = /etc/puppetlabs/puppet/ssl

>>> puppet4 host is correctly setup for the default p4 puppetdirs while puppet3 host is still using its puppet3 defaults

Comment 8 Bryan Kearney 2018-02-21 17:29:59 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336