File handling

19 views
Skip to first unread message

Raj kumar V

unread,
Nov 28, 2013, 7:42:09 AM11/28/13
to puppet...@googlegroups.com
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

Rahul Khengare

unread,
Nov 28, 2013, 11:36:37 AM11/28/13
to puppet...@googlegroups.com
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   

Dan White

unread,
Nov 28, 2013, 3:55:38 PM11/28/13
to Puppet Users Mailing List
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.


It does several different package types.

--
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...@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.

Reply all
Reply to author
Forward
0 new messages