Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
set an exported resource
define placeholder() {
# Nothing to do, it's a placeholder!
}
class bar {
Placeholder <<| title == "importantserver" |>>
file {
"/tmp/y":
require => Placeholder["importantserver"],
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