title: How to properly install a repository with Puppet
body: <p>I'm struggling to install a repository with Puppet, specifically the zabbix repository. I got the zabbix repository for CentOS 7 from <a href="https://tecadmin.net/install-zabbix-agent-on-centos-rhel/" rel="nofollow noreferrer">here</a>, and am using the following:</p>
  
  <pre><code>http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
  </code></pre>
  
  <p>I tried using the following Puppet code to install it on my node, and it didn't seem to work:</p>
  
  <pre><code>node 'puppet-agent' {
      include importRepos
      package { 'php':
          ensure =&gt; "installed",
      }
      package { 'zabbix-agent':
          ensure =&gt; "installed", 
      }
  
  }
  
  class importRepos {
      yumrepo { "zabbix":
          baseurl =&gt; "http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm",
          descr =&gt; "Zabbix repo to install Zabbix client on CentOS 7",
          enabled =&gt; 1,
          gpgcheck =&gt; 1
          }
  }
  </code></pre>
  
  <p>The error I got was:</p>
  
  <pre><code>...
  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.
  </code></pre>
  
  <p>I tried installing the deltarpm package, and now I get this error:</p>
  
  <pre><code>...
  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.
  </code></pre>
  
  <p>I then did a yum clean all and tried again and now I get this error:</p>
  
  <pre><code>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:
  </code></pre>
  
  <p>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?</p>