[Puppet Users] Unable to replace a symlink with regular file

Sean Kelly
2013-01-21T17:19:24Z

I am running Puppet 2.7.x (x varies from 14 to 20 on different machines).
 I am trying to use Puppet to deploy a new Zabbix agent configuration file.
On all machines where the file wasn''t a symlink, the deployment worked.
However, every machine where it is a link, Puppet refuses to replace teh
link with a regular file or do anything with it.

I''ve read the type reference, and I see nothing specific about forcing
symlink replacement. I''ve looked at the source, and it seems like
remove_existing should be unlinking teh symlink ahead of my new file. But,
it isn''t happening. Any suggestions on hwo to do this?

File {
        backup => main,
        owner => "root",
        group => $operatingsystem ? {
                freebsd => "wheel",
                default => "root",
        },
        mode => 644,
        ensure => present,
}

class zabbix {
file {
''/usr/local/etc/zabbix'':
ensure => ''directory'';
''/usr/local/etc/zabbix/zabbix_agentd.conf'':
content => template("zabbix/zabbix_agentd.conf.erb"),
}
...

root@victor:~# ls -ld /usr/local/etc/zabbix/zabbix_agentd.conf
lrwxr-xr-x  1 root  wheel  64 Dec  9  2011
/usr/local/etc/zabbix/zabbix_agentd.conf ->
/usr/local/flightaware/monitor-scripts/zabbix/zabbix_agentd.conf

root@victor:~# puppet agent --test --debug --color=no | grep
zabbix_agentd.conf 2>&1
debug: /Stage[main]/Zabbix/Service[zabbix_agentd]/subscribe: subscribes to
File[/usr/local/etc/zabbix/zabbix_agentd.conf]
debug: /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]:
Autorequiring File[/usr/local/etc/zabbix]
debug:
/Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]/mode:
Not managing symlink mode

Thanks!