Hi all,

I'm looking for a way to run an exec statement if a file does not exist
on the server is this possible?

Example code:

====================

define yumrepo(srcpkg = "",name = "")

if(!exists("/etc/yum.repos.d/${name}.repo")) {

        if($srcpkg != "")
                {
                        exec{"rpm -Uh ${srcpkg}"},
                }
}
else
{
        file { '/etc/yum.repos.d/${name}.repo':
                source => "puppet:///modules/yumrepos/${name}.repo",
        }
}

==================

The idea is that if a repo is requested but the appropriate file does
not exist it is installed from the repo's RPM (where possible) otherwise
a file is pushed from the puppetmaster.

What I want to avoid is the repo RPM being installed at every puppet run
whilst also avoiding the need to push GPG keys (some of which are only
available via the repo's RPM as far as I can tell...)

If someone could give me some pointers, that would be great!

Thanks in advance,

Matt


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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