From a7ece2741d1bf961804dff2f08b000eb1ae5c2a0 Mon Sep 17 00:00:00 2001
From: Andrea Dell'Amico <andrea.dellamico@isti.cnr.it>
Date: Fri, 17 Apr 2020 19:25:12 +0200
Subject: [PATCH] Use the 'deb' parameter to install the zabbix repository.

---
 defaults/main.yml          | 2 +-
 tasks/zabbix-agent-deb.yml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/defaults/main.yml b/defaults/main.yml
index 1368d0b..4e88e25 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -2,6 +2,6 @@
 zabbix_agent_install: False
 zabbix_use_external_repo: True
 zabbix_repo_version: '4.0'
-zabbix_agent_ubuntu_repo: 'https://repo.zabbix.com/zabbix/{{ zabbix_repo_version }}/ubuntu/pool/main/z/zabbix-release/zabbix-release_{{ zabbix_repo_version }}-2+{{ ansible_distribution_release }}_all.deb'
+zabbix_agent_ubuntu_repo: 'https://repo.zabbix.com/zabbix/{{ zabbix_repo_version }}/{{ ansible_distribution | lower }}/pool/main/z/zabbix-release/zabbix-release_{{ zabbix_repo_version }}-2+{{ ansible_distribution_release }}_all.deb'
 zabbix_agent_centos_repo: 'https://repo.zabbix.com/zabbix/{{ zabbix_repo_version }}/rhel/{{ ansible_distribution_major_version }}/x86_64/zabbix-release-{{ zabbix_repo_version }}-1.el7.noarch.rpm'
 
diff --git a/tasks/zabbix-agent-deb.yml b/tasks/zabbix-agent-deb.yml
index ad32899..334bae3 100644
--- a/tasks/zabbix-agent-deb.yml
+++ b/tasks/zabbix-agent-deb.yml
@@ -2,7 +2,7 @@
 - name: Repository and packages, deb/ubuntu
   block:
   - name: Install the repository 
-    apt: pkg={{ zabbix_agent_ubuntu_repo }} state=present
+    apt: deb={{ zabbix_agent_ubuntu_repo }} state=present
     register: update_apt_cache
 
   - name: Update the apt cache if we just installed the repository