Questions tagged [puppet]

Puppet is a configuration management tool (Unix & Windows) with its own Domain Specific Language.

Puppet is a configuration management tool for Unix and Windows. It works either standalone mode (puppet apply) or in client-server mode (puppet agent) with puppet agents running on client systems checking in with the master daemon on the server on a regular basis. Puppet's written in ruby, and puppet source code, i.e. puppet manifests, uses its own domain-specific language that focuses on declaring the system resources and it's intended state.

Combined with system provisioning tools (PXE, kickstart, FAI, etc), puppet can fully automate any software installation and configuration process that doesn't require a GUI interface.

More info:

Related:

1797 questions
27
votes
7 answers

Adding a yum repo to puppet before doing anything else

Is there a way to force puppet to do certain things first? For instance, I need it to install an RPM on all servers to add a yum repository (IUS Community) before I install any of the packages.
Jon Haddad
  • 1,362
21
votes
2 answers

How to do a file/dir exists conditional in Puppet?

I'm trying to write a function in puppet that will do a fail if the passed directory path does not exist. if File["/some/path"] always returns true, and if defined(File["/some/path"]) only returns true if the resource is defined in puppet,…
ddario
  • 491
  • 1
  • 3
  • 12
20
votes
2 answers

Puppet: Node name seems dependent on reverse dns?

I seem to be running into a little bit of a problem understanding how to get this to work. I have a new server I'm building sitting behind the office NAT at work, its reverse dns maps to office.mydomain.com, but I want the machine to be…
gnarf
  • 713
18
votes
5 answers

How do I access an environment variable in a puppet manifest?

How do I access an environment variable (from the puppet daemon's environment) in a puppet manifest?
joeforker
  • 2,409
16
votes
2 answers

How to change the polling interval of the Puppet master?

By default, Puppet clients ask for updates every 30 minutes. I would like to change this interval. What is the most convenient way to do it?
Lauri Lehmijoki
  • 283
  • 1
  • 2
  • 7
15
votes
1 answer

Puppet: ensure a file is empty

I would like to be sure that the motd file is empty. I would love to do like this: file { "/etc/motd": ensure => empty } This obviously does not work. Is there a simple way to ensure a file is empty instead using the "source" declaration and…
SamK
  • 1,366
14
votes
4 answers

Puppet: Test if Resource is defined, or create it

I've been trying to figure out a way to test if a resource is already defined in another file, and if not create it? A quick example: if File[$local_container] { alert("Testing - It existed $local_container") } else { file{…
gnarf
  • 713
14
votes
2 answers

Use puppet to set hostname?

Is there any way of setting a server's hostname using puppet? I could write a custom type, but maybe there's a simpler way. Thanks [Edit] Sorry, I should've mentioned I run puppet masterless, puppet is setup first and then it sets up everything…
14
votes
3 answers

Call Puppet function from Puppet template?

As of 0.24.8, can a Puppet template call a Puppet function? I can get similar functionality by calling the function in my manifest, assigning the return value to a variable, and then using the lookupvar('variable') in the template, but I'd like to…
sh-beta
  • 6,858
14
votes
1 answer

How do I recursively mirror a directory and its contents with puppet?

Let's say I have a module with files/etc/foo/{conf0, conf1, conf2, conf3, etc}. It's simple enough to place each of these files when the number of them is small: file { 'conf0': path => '/etc/foo/conf0', ensure => true, source =>…
user67165
12
votes
4 answers

how to set path when applying single puppet module?

I'm trying to run a single module like this: puppet apply --verbose --modulepath=moduleshere --noop -e 'include myclass' However, I get this kind of error, indicating the path is not set Parameter unless failed: '[ -e "${logfile}" ]' is not…
Goat Hess
  • 121
11
votes
4 answers

puppet only exec when file does NOT exist

I only want to exec following command when file (/usr/local/bin/papply) does not exist. not sure what to put there. exec { 'git add url': command =>'git remote add origin https://github.com/testing/puppet.git', require =>…
qinking126
  • 351
  • 1
  • 4
  • 12
11
votes
2 answers

How to get puppet to stop on the first error in a Manifest?

How do you configure puppet to just stop on the first failure instead of continuing on and just spewing errors for the rest of the steps that depends on the first failure?
user35861
11
votes
1 answer

How to enable systemd instantiated service with puppet?

I've got the following puppet service: service { "getty@ttyUSB0.service": provider => systemd, ensure => running, enable => true, } When I try to apply this configuration on my client, it throws the following error: err:…
Clayton Louden
  • 333
  • 1
  • 4
  • 16
11
votes
2 answers

What's the difference between include and require in puppet

I have a class in puppet if I have the following code: class A { require B .... } I get circular dependencies error. If I have: class A { include B .... } everything works fine
talg
  • 241
1
2 3
29 30