Add changed_when conditionals to avoid idempotence errors
This commit is contained in:
parent
a4f68f6487
commit
b4352beda1
@ -41,11 +41,13 @@
|
|||||||
url: "https://github.com/wazuh/wazuh/archive/{{ wazuh_agent_sources_installation.branch }}.tar.gz"
|
url: "https://github.com/wazuh/wazuh/archive/{{ wazuh_agent_sources_installation.branch }}.tar.gz"
|
||||||
dest: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz"
|
dest: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz"
|
||||||
delegate_to: "{{ inventory_hostname }}"
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Create folder to extract Wazuh branch
|
- name: Create folder to extract Wazuh branch
|
||||||
file:
|
file:
|
||||||
path: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}"
|
path: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Extract downloaded Wazuh branch from Github # Using shell instead of unarchive due to that module not working properlyh with --strip
|
- name: Extract downloaded Wazuh branch from Github # Using shell instead of unarchive due to that module not working properlyh with --strip
|
||||||
command: >-
|
command: >-
|
||||||
@ -53,7 +55,7 @@
|
|||||||
--strip 1
|
--strip 1
|
||||||
--directory /tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}
|
--directory /tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}
|
||||||
register: wazuh_untar
|
register: wazuh_untar
|
||||||
changed_when: wazuh_untar.rc ==0
|
changed_when: false
|
||||||
args:
|
args:
|
||||||
warn: false
|
warn: false
|
||||||
|
|
||||||
@ -75,6 +77,7 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '644'
|
mode: '644'
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Executing "install.sh" script to build and install the Wazuh Agent
|
- name: Executing "install.sh" script to build and install the Wazuh Agent
|
||||||
shell: ./install.sh > /tmp/build_agent_log.txt
|
shell: ./install.sh > /tmp/build_agent_log.txt
|
||||||
@ -87,8 +90,10 @@
|
|||||||
file:
|
file:
|
||||||
path: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz"
|
path: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz"
|
||||||
state: absent
|
state: absent
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Cleanup created folders
|
- name: Cleanup created folders
|
||||||
file:
|
file:
|
||||||
path: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}"
|
path: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
changed_when: false
|
||||||
Loading…
Reference in New Issue
Block a user