Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can I over ride default location of yumrepo files

I would like to use the type 'yumrepo' to generate a yum repo file, but I don't want to save it at /etc/yum.repos.d. Is there a way to tell Puppet where to save the generated repos file? I tried using the target attribute but it didn't work. Here is what I have in my class file. Is it even possible? If not, should I create my own yumrepo-like type or use a template?

$REPONAME = 'zfs-el7' $URL = 'http://archive.zfsonlinux.org/epel/7/$basearch/' $ENABLE = true $KEY = 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7' $GCHECK = true $MIRRORS = 'https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch' $SSL = true

yumrepo { $REPONAME: ensure => present, baseurl => $URL, descr => 'ZFS on Linux - OL7', enabled => $ENABLE, gpgkey => $KEY, gpgcheck => $GCHECK, mirrorlist => $MIRRORS, sslverify => $SSL, target => "/etc/zpatch/repos/${REPONAME}.repo", }

How can I over ride default location of yumrepo files

I would like to use the type 'yumrepo' to generate a yum repo file, but I don't want to save it at /etc/yum.repos.d. Is there a way to tell Puppet where to save the generated repos file? I tried using the target attribute but it didn't work. Here is what I have in my class file. Is it even possible? If not, should I create my own yumrepo-like type or use a template?

$REPONAME = 'zfs-el7'
$URL = 'http://archive.zfsonlinux.org/epel/7/$basearch/'
$ENABLE = true
$KEY = 'http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7'
$GCHECK = true
$MIRRORS = 'https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch'
$SSL = true

true yumrepo { $REPONAME: ensure => present, baseurl => $URL, descr => 'ZFS on Linux - OL7', enabled => $ENABLE, gpgkey => $KEY, gpgcheck => $GCHECK, mirrorlist => $MIRRORS, sslverify => $SSL, target => "/etc/zpatch/repos/${REPONAME}.repo", }

}