Hi,

I am trying to install Apache with a default set of config files. I have 
the following class:

class base_apache {

    case $operatingsystem {
        windows: {
            file { 'apache_installer_package':
                path            => 'D:/Downloads/Puppet/',
                ensure          => directory,
                source          => 'puppet:///files/Apache-Installers/',
                recurse         => true,
                purge           => false,
                source_permissions => ignore,
                replace         => no,
                before          => Package['Apache HTTP Server 2.2.25']
            }

            package { 'Apache HTTP Server 2.2.25':
                ensure          => installed,
                source          => 
'D:\\Downloads\\Puppet\\httpd-2.2.25-win32-x86-openssl-0.9.8y.msi',
                install_options => {'INSTALLDIR' => 
'D:\Apache2.2','SERVICENAME' => 'Apache.2.2','ALLUSERS' => 1},
                before          => File['default_apache_config']
            }

            file { 'default_apache_config':
                path            => "D:/Apache2.2/conf",
                ensure          => directory,
                source          => 'puppet:///files/Apache2.2/conf',
                recurse         => true,
                purge           => true,
                source_permissions => ignore,
                replace         => yes,
            }
        }
    }
}

As you can see, I am installing Apache using MSI package and then copying 
over the default set of configs. This works, however.... If I make a 
modification to the config files, Puppet will notice that it has changed 
and overwrite it on the next run. 

What I want it to do if copy the files ONLY IF the "package" directive had 
to install Apache. If it already existed on the server and it didn't do 
anything, don't do the File['default_apache_config'] bit... I could set 
replace => no but then it wouldn't work on the first one run either as the 
installer creates its own default set of configs.

Is this possible or do I have to be a bit cleverer than that?

Thanks
Alex

-- 
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/63463e7d-b280-43e2-9ebc-6e87eb43635a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to