From b5104ec57e9350811118c2d5079fb031573e7023 Mon Sep 17 00:00:00 2001
From: Lars Beckers <lars.beckers@rwth-aachen.de>
Date: Fri, 22 Sep 2017 00:45:03 +0200
Subject: [PATCH] zabbix-repo: disable zabbix key when switching repos

---
 zabbix-repo/tasks/main.yml | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/zabbix-repo/tasks/main.yml b/zabbix-repo/tasks/main.yml
index cd2e6fc..8c7370b 100644
--- a/zabbix-repo/tasks/main.yml
+++ b/zabbix-repo/tasks/main.yml
@@ -1,10 +1,19 @@
 ---
 # this essentially does what zabbix-release does, but does not mitigate package signing
 
-# TODO place file
-# see: https://repo.zabbix.com/zabbix-official-repo.key
 - name: ensure apt got the key to verify the zabbix repo
   apt_key: data="{{lookup('file', 'zabbix.gpg')}}" state=present
+  when: debian_version == "jessie"
+  notify:
+    - update apt cache
+  tags:
+    - packages
+    - repos
+    - zabbix
+
+- name: ensure apt got the key to verify the zabbix repo
+  apt_key: data="{{lookup('file', 'zabbix.gpg')}}" state=absent
+  when: debian_version == "stretch"
   notify:
     - update apt cache
   tags:
@@ -37,10 +46,10 @@
     - repos
     - zabbix
 
-- meta: flush_handlers
-
 - name: ensure chr's key is present
   apt_key: data="{{lookup('file', 'chr.gpg')}}" state=present 
+  notify:
+    - update apt cache
   tags:
     - packages
     - repos 
@@ -59,3 +68,4 @@
     - zabbix
     - chr
 
+- meta: flush_handlers
-- 
GitLab