Forum: CFEngine Help
Subject: Re: installing specific packages from local directory
Author: jmosco
Link to topic: https://cfengine.com/forum/read.php?3,25415,25641#msg-25641

I did something like this.  

# $Id$
#
# wget epel repo only of package is not already installed

bundle agent epel_wget {
         vars:
                 "epel_rpm" slist => {
                                 "epel-release-6-5.noarch.rpm"
                                     };

        classes:
                "epel_repo_exists"
                expression => fileexists("/tmp/$(epel_rpm)");

        commands:
                !epel_repo_exists::
                        "/usr/bin/wget -q -O /tmp/$(epel_rpm)  
http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm";
                        comment => "Downloading latest EPEL RPM.";
        reports:
                epel_repo_exists::
                        "EPEL repo already exists on disk";

        packages:
                centos.epel_repo_exists::
                "epel-release"
                package_policy => "add",
                package_select => "==",
                package_method => rpm_version("/tmp"),
                package_version => "6-5",
                package_architectures => { "noarch" };
}

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to