You're trying something that's essentially timing based in puppet, which is 
more state based. You can't really tell puppet that a file should exist and 
not exist in the same run. Could you give some more info on what you're 
trying to accomplish with this? That way we might offer some ideas to help.

On Friday, November 16, 2012 4:04:05 AM UTC-8, Alex Stanhope wrote:
>
> I'd like to create a file, use it in a number of other puppetted 
> processes, then clean it up.
>
> I can create it:
>   file { 'bash-agent-key' :
>     path => "/home/${user}/.bash_keyautoload.tmp", 
>     content => template('ssh_agent_add/bash_keyautoload.erb'),
>     mode => 0700,
>     owner => $user,
>     group => $user,
>   }
>
> but when I try to delete it with either:
>   file { 'bash-agent-key' :
>     ensure => absent,
>   }
> or
>   file { 'bash-agent-key-delete' :
>     path => "/home/${user}/.bash_keyautoload.tmp", 
>     ensure => absent,
>   }
>
> I get an error message:
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Duplicate declaration: File[bash-agent-key] is already declared in file 
> /etc/puppet/modules/ssh_agent_add/manifests/init.pp at line 47; cannot 
> redeclare on node
> or
> Error: Failed to apply catalog: Cannot alias File[bash-agent-key-delete] 
> to ["/home/lightenn/.bash_keyautoload.tmp"] at 
> /etc/puppet/modules/ssh_agent_add/manifests/init.pp:73; resource ["File", 
> "/home/lightenn/.bash_keyautoload.tmp"] already declared at 
> /etc/puppet/modules/ssh_agent_add/manifests/init.pp:47
>
> Any guidance much appreciated.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/e2emA3vuAhoJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to