Hi,

I'm trying to use a condition based on the existance of a file. Something 
like this:

    if find_file('/etc/if_this_file_exists') {
        file { '/etc/create_this_file':
            ensure => present,
            owner  => 'root',
            group  => 'root',
            mode   => '0755',
            source => 
"puppet:///modules/${module_name}/etc/create_this_file",
        }
    }

This is working correctly in a laboratory environment launched with:

[root@labserver ~]# puppet apply --modulepath=/home/user/git/ -e "include 
my_module" --verbose --noop
Info: Loading facts
Notice: Compiled catalog for labserver in environment lab in 0.04 seconds
Info: Applying configuration version '1579255663'
Notice: /Stage[main]/my_module::Files/File[/...]/mode: current_value 
'0777', should be '0755' (noop)
Notice: /Stage[main]/my_module::Files/File[/....]/mode: current_value 
'0777', should be '0755' (noop)
Notice: /Stage[main]/my_module::Files/File[/...]/mode: current_value 
'0777', should be '0644' (noop)
Notice: /Stage[main]/my_module::Files/File[/...]/mode: current_value 
'0777', should be '0770' (noop)
Notice: /Stage[main]/my_module::Files/File[/...]/ensure: current_value 
'absent', should be 'file' (noop)
Notice: Class[my_module::Files]: Would have triggered 'refresh' from 5 
events
Notice: Stage[main]: Would have triggered 'refresh' from 1 event
Notice: Applied catalog in 0.12 second

But when I execute this from a server-client infrastructure it seems like 
the conditionals don't work They are not even processed:

[root@devserver ~]# puppet agent -tv --debug --noop
...
Debug: /Stage[main]/previous_module::Install/File[/...]: Adding autorequire 
relationship with User[root]
Debug: /Stage[main]/my_module::Files/File[/...]: Adding autorequire 
relationship with File[/etc/cron.daily]
Debug: /Stage[main]/my_module::Files/File[/...]: Adding autorequire 
relationship with User[root]
Debug: /Stage[main]/next_module::Config/App::Conf[00-syslog]/File[/...]: 
Adding autorequire relationship with User[root]
...

Sorry I have to modify the output so I don't show the real paths & files.

Can anyone explain to me why is this not working, please?

Thanks & regards,

JoaquĆ­n

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a13df78f-e816-47e8-92d7-3cc46c316276%40googlegroups.com.

Reply via email to