Skip to content

Commit

Permalink
[PLAT-13029] Adding lock timeouts for Ansible tasks
Browse files Browse the repository at this point in the history
Summary: Occasionally we see issues where ansible tasks fail acquiring yum lockfile. This diff adds explicit locks for all package/apt/yum tasks in Ansible playbooks.

Test Plan: Ensure universe creation still succeeds.

Reviewers: svarshney, amalyshev

Reviewed By: amalyshev

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D35558
  • Loading branch information
mchiddy committed Jun 6, 2024
1 parent 172b6fd commit 5487dc7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions managed/devops/preprovision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
apt:
name: python-minimal
state: present
lock_timeout: 600
when: ansible_distribution_major_version == "18"
when: ansible_distribution == "Ubuntu"
tags: yb-prebuilt-ami
Expand Down Expand Up @@ -185,6 +186,7 @@
- glibc-locale-source
- glibc-langpack-en
state: present
lock_timeout: 600

- name: Generate UTF-8 locales
become: yes
Expand Down
2 changes: 2 additions & 0 deletions managed/devops/roles/install_package/tasks/s3-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
name: "{{ item }}"
state: latest
update_cache: yes
lock_timeout: 600
with_items: "{{ yum_packages }}"

- name: Download-itest | Install awscli
Expand Down Expand Up @@ -56,4 +57,5 @@
yum:
name: "{{ item }}"
state: absent
lock_timeout: 600
with_items: "{{ yum_packages }}"
11 changes: 5 additions & 6 deletions managed/devops/roles/server_base/tasks/server_base_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
become_method: sudo
apt:
update_cache: yes
lock_timeout: 600
when: ansible_pkg_mgr == "apt"

- block:
Expand Down Expand Up @@ -128,6 +129,7 @@
name: "{{ item }}"
state: latest
update_cache: yes
lock_timeout: 600
with_items:
- "{{ linux_packages }}"
register: result
Expand All @@ -142,6 +144,7 @@
package:
name: "{{ item }}"
state: latest
lock_timeout: 600
with_items:
- "{{ linux_packages }}"
register: result
Expand All @@ -153,12 +156,10 @@
- name: Install linux packages we need on our YugaByte clusters on RedHat aarch64 architecture
become: yes
become_method: sudo
module_defaults:
yum:
lock_timeout: 600
package:
name: "{{ item }}"
state: latest
lock_timeout: 600
with_items:
- "{{ linux_packages + aarch64_packages }}"
register: result
Expand All @@ -173,12 +174,10 @@
- name: Install linux packages we need on our YugaByte clusters on Debian aarch64 architecture
become: yes
become_method: sudo
module_defaults:
yum:
lock_timeout: 600
package:
name: "{{ item }}"
state: latest
lock_timeout: 600
with_items:
- "{{ linux_packages + debian_aarch64_packages }}"
register: result
Expand Down

0 comments on commit 5487dc7

Please sign in to comment.