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