How about ending your script with a command that removes itself?

/bin/rm path_to_script
or
/bin/rm $0

Kent


On Tue, Mar 11, 2014 at 5:09 PM, nfwlpw <[email protected]> wrote:

> So I have a puppet module, that gets a script from files/, runs that
> script, and after it's done, I'd like to remove it.
>
> Unfortunately puppet doesn't seem to like to have 2 different File
> resource aliased to the same, so I can't do
>
> file { "myfile":
>     ensure => present,
>     source => "puppet:///...",
> }
>
> file { "remove myfile":
>     path => "myfile",
>    ensure => absent,
> }
>
> Puppet gave the error: err: Failed to apply catalog: Cannot alias
> File[remove myfile]...myfile already declared...
>
> The only work around I've found is using an exec resource.  Anyone know
> how to do this without exec?
>
> Thank you
>
>  --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/d503ce3f-7678-4056-8386-b7eaaa02eb66%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/d503ce3f-7678-4056-8386-b7eaaa02eb66%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Kent Brede

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2BnSE3_XR6nSYNCb%3Dgbq%3D%2BbMbDFveY5tg9VKbbUGYA%3DAf065cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to