From 396d711be9506b634f57ca01a7b880c863989abe Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Wed, 14 Oct 2020 15:01:34 +1300 Subject: [PATCH] Added option force install/reinstall on RHEL --- defaults/main.yml | 7 ++++++- tasks/RedHat.yml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 55e6cfe..b4647dc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -22,4 +22,9 @@ cmk_auth: "&_username={{ cmk_username }}&_secret={{ cmk_secret }}" # This variable is used to detect whether this is a fresh install # Is changed to true if check-mk-agent gets installed -cmk_fresh_install: false \ No newline at end of file +cmk_fresh_install: false + +# This variable if set to true will force installation to run regardless of whether +# CheckMK is already installed. +# Breaks idempotence but allows role to be used to force upgrade agents. +cmk_force_install: false diff --git a/tasks/RedHat.yml b/tasks/RedHat.yml index 9f6a88b..7cc2742 100644 --- a/tasks/RedHat.yml +++ b/tasks/RedHat.yml @@ -29,6 +29,6 @@ file: path: /tmp/check-mk-agent.rpm state: absent - when: "'check-mk-agent' not in ansible_facts.packages" + when: "'check-mk-agent' not in ansible_facts.packages or cmk_force_install" tags: - check_mk_agent