Wednesday, January 21, 2015

Daily Puppet 3 - Inheritance

With the inheritance we can set the order in which resources are applied on an agent.

A test manifest is shown below, it is rather simple one.





Here we have defined a class “ownerfile”, which has a resource file “/tmp/owner.txt”. There is another file “/tmp/depenfile”, which will be created after the owners.txt file.


First owner.txt file is created and then depenfile is created.


Another approach is using the “require”



In the above manifest it is shown that,
File resource “/tmp/dependrequire.txt”  defined which requires another resource which is a file resource too, “tmp/owners.txt”
First owners.txt is created as it is required by the file resource dependrequire.txt. Then dependrequire.txt is created.

No comments:

Post a Comment