Skip to content

Commit

Permalink
Add lock_timeout to yum tasks for improved package installation relia…
Browse files Browse the repository at this point in the history
…bility
  • Loading branch information
YisDav committed Jan 17, 2025
1 parent 194d5d1 commit 7f1579d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file.

### Changed

- None
- Add Yum lock timeout to Ansible task ([#1511](https://github.com/wazuh/wazuh-ansible/pull/1511))

### Fixed

Expand Down
3 changes: 2 additions & 1 deletion roles/wazuh/ansible-filebeat-oss/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
yum:
name: "filebeat-{{ filebeat_version }}"
state: present
lock_timeout: 200
register: install
tags:
- install
Expand All @@ -31,7 +32,7 @@
tags:
- install
- init
until: "install is not failed"
until: "install is not failed"
retries: 10
delay: 10
when: ansible_os_family == 'Debian'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
yum:
name: "{{ wazuh_custom_packages_installation_agent_rpm_url }}"
state: present
lock_timeout: 200
when:
- ansible_os_family|lower == "redhat"
- wazuh_custom_packages_installation_agent_enabled
Expand Down
5 changes: 4 additions & 1 deletion roles/wazuh/ansible-wazuh-manager/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
- wazuh_manager_config.cluster.disable != 'yes'

- name: RedHat/CentOS/Fedora | Install OpenJDK 1.8
yum: name=java-1.8.0-openjdk state=present
yum:
name: java-1.8.0-openjdk
state: present
lock_timeout: 200
when:
- wazuh_manager_config.cis_cat.disable == 'no'
- wazuh_manager_config.cis_cat.install_java == 'yes'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
yum:
name: "{{ wazuh_custom_packages_installation_manager_rpm_url }}"
state: present
lock_timeout: 200
when:
- wazuh_custom_packages_installation_manager_enabled
- not (ansible_distribution|lower == "centos" and ansible_distribution_major_version >= "8")
Expand Down
5 changes: 4 additions & 1 deletion roles/wazuh/wazuh-indexer/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
yum:
name: amazon-linux-extras
state: present
when:
lock_timeout: 200
when:
- ansible_distribution == 'Amazon'
- ansible_distribution_major_version == '2'

Expand All @@ -40,6 +41,8 @@
- name: RedHat/CentOS/Fedora | Install Indexer dependencies
yum:
name: "{{ packages }}"
state: present
lock_timeout: 200
vars:
packages:
- wget
Expand Down

0 comments on commit 7f1579d

Please sign in to comment.