From 21ea598e8adfff92e427a3d631392a3a3cc50a90 Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Thu, 1 Feb 2024 01:26:16 +0100 Subject: [PATCH] Fix check mode always changed (#1175) --- molecule/zabbix_agent_tests/common/playbooks/prepare.yml | 1 + roles/zabbix_agent/molecule/with-server/prepare.yml | 1 + roles/zabbix_agent/tasks/Debian.yml | 1 + roles/zabbix_javagateway/tasks/Debian.yml | 1 + roles/zabbix_proxy/tasks/Debian.yml | 1 + roles/zabbix_server/tasks/Debian.yml | 1 + roles/zabbix_web/tasks/Debian.yml | 1 + 7 files changed, 7 insertions(+) diff --git a/molecule/zabbix_agent_tests/common/playbooks/prepare.yml b/molecule/zabbix_agent_tests/common/playbooks/prepare.yml index cf1100aab..2ad8efa3f 100644 --- a/molecule/zabbix_agent_tests/common/playbooks/prepare.yml +++ b/molecule/zabbix_agent_tests/common/playbooks/prepare.yml @@ -47,6 +47,7 @@ hosts: docker tasks: - name: "Download Docker CE repo file" + when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: url: https://download.docker.com/linux/centos/docker-ce.repo dest: /etc/yum.repos.d/docker-ce.repo diff --git a/roles/zabbix_agent/molecule/with-server/prepare.yml b/roles/zabbix_agent/molecule/with-server/prepare.yml index 582006d4e..e95cc9ad7 100644 --- a/roles/zabbix_agent/molecule/with-server/prepare.yml +++ b/roles/zabbix_agent/molecule/with-server/prepare.yml @@ -75,6 +75,7 @@ hosts: docker tasks: - name: "Download Docker CE repo file" + when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: url: https://download.docker.com/linux/centos/docker-ce.repo dest: /etc/yum.repos.d/docker-ce.repo diff --git a/roles/zabbix_agent/tasks/Debian.yml b/roles/zabbix_agent/tasks/Debian.yml index 6ded0ba03..014e490b2 100644 --- a/roles/zabbix_agent/tasks/Debian.yml +++ b/roles/zabbix_agent/tasks/Debian.yml @@ -65,6 +65,7 @@ (ansible_distribution == "Debian" and ansible_distribution_major_version < "12") - name: "Debian | Download gpg key" + when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: url: http://repo.zabbix.com/zabbix-official-repo.key dest: "{{ zabbix_gpg_key }}" diff --git a/roles/zabbix_javagateway/tasks/Debian.yml b/roles/zabbix_javagateway/tasks/Debian.yml index 4c4cff06d..74ad4cf75 100644 --- a/roles/zabbix_javagateway/tasks/Debian.yml +++ b/roles/zabbix_javagateway/tasks/Debian.yml @@ -46,6 +46,7 @@ (ansible_distribution == "Debian" and ansible_distribution_major_version < "12") - name: "Debian | Download gpg key" + when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: url: http://repo.zabbix.com/zabbix-official-repo.key dest: "{{ zabbix_gpg_key }}" diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml index 8e27e7d27..31029ee18 100644 --- a/roles/zabbix_proxy/tasks/Debian.yml +++ b/roles/zabbix_proxy/tasks/Debian.yml @@ -71,6 +71,7 @@ (ansible_distribution == "Debian" and ansible_distribution_major_version < "12") - name: "Debian | Download gpg key" + when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: url: http://repo.zabbix.com/zabbix-official-repo.key dest: "{{ zabbix_gpg_key }}" diff --git a/roles/zabbix_server/tasks/Debian.yml b/roles/zabbix_server/tasks/Debian.yml index ccfe6f121..5bd1be77f 100644 --- a/roles/zabbix_server/tasks/Debian.yml +++ b/roles/zabbix_server/tasks/Debian.yml @@ -70,6 +70,7 @@ (ansible_distribution == "Debian" and ansible_distribution_major_version < "12") - name: "Debian | Download gpg key" + when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: url: http://repo.zabbix.com/zabbix-official-repo.key dest: "{{ zabbix_gpg_key }}" diff --git a/roles/zabbix_web/tasks/Debian.yml b/roles/zabbix_web/tasks/Debian.yml index ae1c7de26..ffd12a367 100644 --- a/roles/zabbix_web/tasks/Debian.yml +++ b/roles/zabbix_web/tasks/Debian.yml @@ -88,6 +88,7 @@ (ansible_distribution == "Debian" and ansible_distribution_major_version < "12") - name: "Debian | Download gpg key" + when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: url: http://repo.zabbix.com/zabbix-official-repo.key dest: "{{ zabbix_gpg_key }}"