Ask Your Question

if I have multiple puppet masters how can I access the puppet file server reglardless of the master server

asked 2014-10-14 20:29:22 -0600

I have 2 puppet masters, fileserver is on node A, node B is just another puppet master which is not serving any file, I want to be able to access the puppet file server from any client regalrdless if the client has master A or master B how can I do that?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-17 14:41:32 -0600

cbarbour gravatar image

You can specify the master as part of the source parameter URL.

file { '/tmp/example.txt':
  ensure => 'file',
  source => 'puppet://',

When no hostname is provided, the Puppet agent automatically uses the master the client is currently connected to. Specifying a hostname explicitly overrides this behavior.

A best practice in this case would be to parameterize the source; the above approach creates an external dependency that could be problematic for local testing and development

class myclass (
  $source = 'puppet:///modules/myclass/example.txt',
) {
  file { '/tmp/example.txt':
    ensure => 'file',
    source => $::myclass::source,

In Hiera, add the following key:

myclass::source: 'puppet://'

Now the module works as you desire, but still supports convenient local testing.

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: 2014-10-14 20:29:22 -0600

Seen: 43 times

Last updated: Oct 17 '14