Test.pp:
notify {
|
'1':
|
}
|
|
define mynotify(Type[Notify] $req) {
|
notify {
|
$title:
|
}
|
$req -> Mynotify[$title]
|
}
|
|
mynotify {
|
'2':
|
req => Notify['1']
|
}
|
|
Expected:
Relationship works: Notify['1'] is triggered before Notify['2']
Result:
puppet apply test.pp
|
Error: Evaluation Error: Illegal relationship operand, can not form a relationship with an Object. A Catalog type is required. at /root/test.pp:9:8 on node foo
|
Workaround:
notify {
|
'1':
|
}
|
|
define mynotify(String $prereq) {
|
$req = Notify[$prereq]
|
notify {
|
$title:
|
}
|
$req -> Mynotify[$title]
|
}
|
|
mynotify {
|
'2':
|
prereq => '1'
|
}
|
Notice: Compiled catalog for foo in environment production in 0.48 seconds
|
Notice: 1
|
Notice: /Stage[main]/Main/Notify[1]/message: defined 'message' as '1'
|
Notice: 2
|
Notice: /Stage[main]/Main/Mynotify[2]/Notify[2]/message: defined 'message' as '2'
|
Notice: Applied catalog in 0.06 seconds
|