Accessing attribute value of defined in a resource in another resource implementation

15 views
Skip to first unread message

ganesh634

unread,
Jun 17, 2015, 11:44:07 AM6/17/15
to puppet...@googlegroups.com
Pasted below an example relation for new resource say 'new_type'.

 

        file

        { "interface":

                path    => "/var/tmp/test.txt",

                content => template("module/test_template.erb"),

                notify  => new_type['sample'],

        }

        new_type

        { "sample":

                path  => "/var/tmp/test.txt",

                active =>true,

                ensure=>present,

        }

 

In 'new_type' resource implementation I want to access value of 'path' attribute value from 'file' resource to determine certain action in 'new_type' resource.

With current approach I have to keep ‘path’ attribute in ‘new_type’ and mandate user to have ‘path’ value same as that of ‘path’ value in file resource.

 

How can I access 'file’ resource 'path' attribute value in 'new_type' resource implementation?

If it is possible I can remove the 'path' attribute from 'new_type' resource body as value of both path need to be same all the time. 
Reply all
Reply to author
Forward
0 new messages