>
> Is there a way to retrieve the parameter values of resource for previous
> client run during current execution of client.
> The reason for this question is how to handle scenario where path value of
> 'new_type' resource is changed to already
>
existing file whose contents are not changed.
Great, It worked for me.
Thanks Dylan, Reid and Michael.
Appreciate all your help.
Regards,
Ganesh
On Sat, Jun 20, 2015 at 2:21 PM, Dylan Ratcliffe <
dylan.ratcli...@puppetlabs.com> wrote:
> I would use the value of the $title variable to ensure both that you can
> refer to the new_type resour
I would use the value of the $title variable to ensure both that you can refer
to the new_type resource and that it will have a unique title each time the
defined type is called, to find out more check out this page, it has everything
you need to know about writing a defined type:
http://doc
Thanks Dylan.
This approach looks good as and users don't have to add file resource
explicitly.
>define new_type::something (
> $file_path,
>) {
> file { $file_path:
>ensure => file,
>notify=> New_type['another_resource'], --->*'another_resource'
must be a variable as it is tit
That's close,
You don't need to set ensure on a defined type unless you have exposed that
as a paremeter, and you do need to set ensure for that file.
Going back to the original issue of accessing the parameter of one resource
from another, i'll give a little example of how I envision it:
defi
@Reid: Agreed it make sense to reference another resource instead of path
string.
The links you shared are very helpful. Thanks!!!
@Dylan: While going through defined types i came across vhost here:
https://github.com/puppetlabs/puppetlabs-apache/blob/master/manifests/vhost.pp
I am not very clear
Assuming that the "file" and the "new_type" resource will always be
together I would wrap them in a defined type and expose everything you need
as parameters. That way both can have access to it without any hacky stuff.
I'm not sure of your level of Puppet knowledge so if that makes no sense
le
What Michael said about the design is worth considering.
If it makes sense to reference another resource instead of a path string
(e.g. File["myfile"]) and you're just curious about how to do it, there's
code that does similar things in the puppetlabs/transition module, as well
as in changes pe
Thanks Michael!!!
new_type resource need to read content of 'interface' file and perform some
action.
>Overloading the notify/require relationship to make that association would
be a bad idea - they're 1-to-many and many-to-1 relationships - and
probably complicated to make work.
Sorry i am ne
There's probably a way to do that, but I don't think it's a good idea.
In order to look at the 'path' attribute of the 'file' resource, you'd need
to specify which 'file' resource your new_type relates to. That means
new_type would have a property with the value File['interface'], which
isn't much
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_typ
11 matches
Mail list logo