Ask Your Question

What are some dependable ways to determine whether an agent uses Puppet Enterprise or Opensource? (specific to gem providers and $PATH)

asked 2015-05-22 13:34:26 -0600

rnelson0 gravatar image

I have a profile that works well with Puppet Opensource but not with Puppet Enterprise because with PO I use rvm but with PE I should use pe_gem to install gems. This causes an issue when rvm installs the puppet gem as a dependency to other gems and the users (even root, since it's rvm) call puppet. The gem is used instead of /opt/puppet/bin/puppet.

I'd like to change the profile to detect the agent that is installed and use either rvm or pe_gem as the situation demands, in the hope of moving this profile into a public forge module. What are some recommended, reliable methods to determine what is in use?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-05-22 15:04:12 -0600

GregLarkin gravatar image

If you install the puppetlabs-stdlib module, it adds some facts including is_pe. You can test for true/false and then adjust your code handle the open-source vs. enterprise decision.

Here is some sample output showing the additional facts you'll have access to:

has_peadmin => true
is_pe => true
pe_build => 3.8.0
pe_concat_basedir => /var/opt/lib/pe-puppet/pe_concat
pe_major_version => 3
pe_minor_version => 8
pe_patch_version => 0
pe_version => 3.8.0
puppet_vardir => /var/opt/lib/pe-puppet
puppetversion => 3.8.0 (Puppet Enterprise 3.8.0)
edit flag offensive delete link more

answered 2015-05-25 04:12:41 -0600

Is parsing the output of puppet -V a solution for you:

On PE, it will return something like

# puppet -V
3.4.3 (Puppet Enterprise 3.2.2)

On POSS, it will return something like

# puppet -V
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-05-22 13:34:26 -0600

Seen: 162 times

Last updated: May 25 '15