Skip to content

Instantly share code, notes, and snippets.

@lak
Forked from jordansissel/Running it
Created October 14, 2010 23:44
Show Gist options
  • Select an option

  • Save lak/627292 to your computer and use it in GitHub Desktop.

Select an option

Save lak/627292 to your computer and use it in GitHub Desktop.
define placeholder() {
# Nothing to do, it's a placeholder!
}
class bar {
Placeholder <<| title == "importantserver" |>> { before => File['/tmp/y'] }
file {
"/tmp/y":
content => "Importantserver is ready!\n";
}
}
include bar
define placeholder() {
# Nothing to do, it's a placeholder!
}
class foo {
@@placeholder {
"importantserver":
}
}
include foo
# The first run fails because there is no 'importantserver' placeholder resource.
frontend1(~) % puppet apply --storeconfigs --config ./puppet.conf pull.pp
Could not find dependency Placeholder[importantserver] for File[/tmp/y] at /home/jordan/pull.pp:12
# Have another server export this resource
ops(~/pp) % puppet apply --storeconfigs --config ./puppet.conf push.pp
# Try again, which works because the exported resource is found.
frontend1(~) !1! % puppet apply --storeconfigs --config ./puppet.conf pull.pp
notice: /Stage[main]/Bar/File[/tmp/y]/content: content changed '{md5}5a2f711ba4198f0db5e6b9e38a8f2d64' to '{md5}53cadf1c93f077aae3747e6507d7aa8e'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment