0

I'm struggling to install a repository with Puppet, specifically the zabbix repository. I got the zabbix repository for CentOS 7 from here, and am using the following:

http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

I tried using the following Puppet code to install it on my node, and it didn't seem to work:

node 'puppet-agent' {
    include importRepos
    package { 'php':
        ensure => "installed",
    }
    package { 'zabbix-agent':
        ensure => "installed", 
    }

}

class importRepos {
    yumrepo { "zabbix":
        baseurl => "http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm",
        descr => "Zabbix repo to install Zabbix client on CentOS 7",
        enabled => 1,
        gpgcheck => 1
        }
}

The error I got was:

...
Execution of '/usr/bin/yum -d 0 -e 0 -y install zabbix-agent' returned 1: Delta RPMs disabled because /usr/bin/applydeltarpm not installed.


Error downloading packages:
  zabbix-agent-3.4.15-1.el7.x86_64: [Errno 256] No more mirrors to try.

I tried installing the deltarpm package, and now I get this error:

...
Error downloading packages:
  zabbix-agent-3.4.15-1.el7.x86_64: [Errno 256] No more mirrors to try.
Error: /Stage[main]/Main/Node[puppet-agent]/Package[zabbix-agent]/ensure: change from purged to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install zabbix-agent' returned 1: No Presto metadata available for zabbix


Error downloading packages:
  zabbix-agent-3.4.15-1.el7.x86_64: [Errno 256] No more mirrors to try.

I then did a yum clean all and tried again and now I get this error:

Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install zabbix-agent' returned 1: One of the configured repositories failed (Zabbix repo to install Zabbix client on CentOS 7),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

It recommends that I disable the repo, so I'm not sure what mistake I made but for some reason it doesn't seem that the repo is valid based on how I configured it.Does anyone know how I can get the zabbix repo to work in Puppet so that I can install the zabbix agent?

1 Answer 1

0

Turns out I had the wrong general idea. I can just install the package and specify the RPM as the source and it will work. I've tested the following code and it worked:

package { 'zabbix-release':
  ensure => 'installed',
  source => 'http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm',
  provider => 'rpm'
}

This will install the RPM for me and I can install zabbix-agent from there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .