HomePhorge

Fixing #448 - relationships have their own syntax
2c153b12921dUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fixing #448 - relationships have their own syntax

You can now specify relationships directly in the language:

File[/foo] -> Service[bar]

Specifies a normal dependency while:

File[/foo] ~> Service[bar]

Specifies a subscription.

You can also do relationship chaining, specifying multiple
relationships on a single line:

File[/foo] -> Package[baz] -> Service[bar]

Note that while it's confusing, you don't have to have all
of the arrows be the same direction:

File[/foo] -> Service[bar] <~ Package[baz]

This can provide some succinctness at the cost of readability.

You can also specify full resources, rather than just
resource refs:

file { "/foo": ensure => present } -> package { bar: ensure => installed }

But wait! There's more! You can also specify a subscription on either side
of the relationship marker:

yumrepo { foo: .... }
package { bar: provider => yum, ... }
Yumrepo <| |> -> Package <| provider == yum |>

This, finally, provides easy many to many relationships in Puppet, but it also opens
the door to massive dependency cycles. This last feature is a very powerful stick,
and you can considerably hurt yourself with it.

Signed-off-by: Luke Kanies <luke@puppetlabs.com>

Details

Provenance
Luke Kanies <luke@puppetlabs.com>Authored on
test branch <puppet-dev@googlegroups.com>Committed on Feb 17 2010, 3:50 PM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU052f98fdac20: Fix #3408 - enable puppetd http compression
Branches
Unknown
Tags
Unknown

Event Timeline

test branch <puppet-dev@googlegroups.com> committed rPU2c153b12921d: Fixing #448 - relationships have their own syntax (authored by Luke Kanies <luke@puppetlabs.com>).Feb 17 2010, 3:50 PM