From 536934fe5000020b4f9f5ac25b12024636d3e0ff Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Thu, 21 Mar 2024 08:56:14 +0100 Subject: [PATCH] fup to #24 #25 - patch checkmk agent script locally and make role more idempotent --- tasks/main.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 2dfb8a2..ebf0b99 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,6 +15,16 @@ dest: "{{ _local_tmp }}/{{ checkmk_agent_name }}" mode: "0600" + - name: apply patches + delegate_to: localhost + check_mode: false + run_once: true + ansible.posix.patch: + src: "{{ item }}" + dest: "{{ _local_tmp }}/{{ checkmk_agent_name }}" + remote_src: false + with_items: "{{ opn_check_mk_patches | default([]) }}" + - name: copy {{ checkmk_agent_name }} from {{ _local_tmp }} ansible.builtin.copy: src: "{{ _local_tmp }}/{{ checkmk_agent_name }}" @@ -35,15 +45,6 @@ - opn_install_check_mk - checkmk_hostname is not defined -- name: apply patches - ansible.posix.patch: - src: "{{ item }}" - dest: "{{ opn_check_mk_path }}" - remote_src: false - with_items: "{{ opn_check_mk_patches | default([]) }}" - when: - - opn_install_check_mk - - name: create lib dirs ansible.builtin.file: path: "{{ opn_check_mk_lib_dir }}/{{ item }}"