Hi There, I am trying to do the following using puppet 1. Create a dir call mydir 2. Download a file from internet using Exec 3. Change the mode of the file 3. Install it and ensure running and service is enabled. 4. Delete it the installer file. When I do this until 3 rd step I am fine. But when I create the file resource again for deleting the installer files, it says it is already declared and cannot redeclare. Is there a option to fix this or I have to change the logic? Thanks Raj -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c45d6416-fd8e-4661-b09d-3da6d61b5906%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Hi Raj, In puppet you can not declare the same resource twice in a manifests. Workaround, You have to use exec resource which execute the command required for deletion of file Here you have to order all resource like file deletion( exec resource) has to be occurs at the last.. Thanks, Rahul On Thursday, November 28, 2013 1:12:09 PM UTC+5:30, Raj kumar V wrote:> > Hi There, > > I am trying to do the following using puppet > > 1. Create a dir call mydir > 2. Download a file from internet using Exec > 3. Change the mode of the file > 3. Install it and ensure running and service is enabled. > 4. Delete it the installer file. > > When I do this until 3 rd step I am fine. But when I create the file > resource again for deleting the installer files, it says it is already > declared and cannot redeclare. Is there a option to fix this or I have to > change the logic? > > Thanks > Raj >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d608e9b4-4385-4697-b07c-eef04364dd3d%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
You are describing a custom package provider. I use Fedora/CentOS/Red Hat type systems. If I wanted to do what you describe, I’d roll my own RPM. Check this out: https://github.com/jordansissel/fpm/wiki It does several different package types. On Nov 28, 2013, at 2:42 AM, Raj kumar V <vijayarajkumar@gmail.com> wrote:> Hi There, > > I am trying to do the following using puppet > > 1. Create a dir call mydir > 2. Download a file from internet using Exec > 3. Change the mode of the file > 3. Install it and ensure running and service is enabled. > 4. Delete it the installer file. > > When I do this until 3 rd step I am fine. But when I create the file resource again for deleting the installer files, it says it is already declared and cannot redeclare. Is there a option to fix this or I have to change the logic? > > Thanks > Raj > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c45d6416-fd8e-4661-b09d-3da6d61b5906%40googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/93D2E30B-841B-49EA-8668-42784ED8D1BA%40comcast.net. For more options, visit https://groups.google.com/groups/opt_out.