O'Reilly logo

Puppet 5 Essentials - Third Edition by Felix Frank, Martin Alfke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Declaring dependencies

The easiest way to bring order to such a straightforward manifest is resource chaining. The syntax for this is a simple ASCII arrow between two resources:

package { 'haproxy':  ensure => 'installed',}->file { '/etc/haproxy/haproxy.cfg':  ensure => file,  owner  => 'root',  group  => 'root',  mode   => '0644',  source => 'puppet:///modules/haproxy/etc/haproxy/haproxy.cfg',}->service {'haproxy':  ensure => 'running',}

This is only viable if all the related resources can be written next to each other. In other words, if the graphic representation of the dependencies does not form a straight chain, but more of a tree, star, or any other shape, this syntax is not sufficient.

Internally, Puppet will construct an ordered graph of resources ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required