From 0765e30eb38135fa258b06e5e076fed4120cfdd1 Mon Sep 17 00:00:00 2001 From: Talha Bin Rizwan Date: Thu, 4 Apr 2024 16:48:10 +0500 Subject: [PATCH] PMM-12998 Log message on ansible self update. --- update/ansible/playbook/tasks/update.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/update/ansible/playbook/tasks/update.yml b/update/ansible/playbook/tasks/update.yml index 38bf3705f6..2758c5c89a 100644 --- a/update/ansible/playbook/tasks/update.yml +++ b/update/ansible/playbook/tasks/update.yml @@ -22,14 +22,20 @@ - vmproxy - grafana-db-migrator pre_tasks: - - name: Check for updates of ansible-core package + - name: Check for updates of ansible-core package | EL9 shell: yum list updates ansible-core | grep -q 'ansible-core' && echo 'Available' || echo 'Not Available' register: ansible_core_update + when: + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' - - name: Log message if ansible-core package needs update + - name: Log message if ansible-core package needs update | EL9 debug: msg: "The ansible-core package needs update. Playbook will re-run to apply the changes." - when: ansible_core_update.stdout == "Available" + when: + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + - ansible_core_update.stdout == "Available" - name: Remove ansible RPM if installed | EL9 when: