From 02f3308bf4b36e973ca3f67f23a5140ecb1f7097 Mon Sep 17 00:00:00 2001 From: Alexey Stupnikov Date: Sat, 24 Oct 2020 12:40:45 +0200 Subject: [PATCH] Optimize container_cli usage by mysql-open-files-limit validation mysql-open-files-limit could fail because Ansible fails to obtain container_cli definition from inventory. There are multiple playbooks that use container_cli to run various commands. All playbooks but mysql-open-files-limit define container_cli in different way. This patch aligns container_cli definition and usage for mysql-open-files-limit validation with other validations. Change-Id: Ie957b9bb046e006be0e5cc56bd749a2fe67178e8 Closes-Bug: #1901299 Related: rhbz#1891202 (cherry picked from commit a2f5c55edb0392b9c46cbf75fdb5bb757756fe5a) (cherry picked from commit bd800b9cbf34a85fe0c1ec145c1ddc28832a68d1) --- roles/mysql_open_files_limit/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/mysql_open_files_limit/tasks/main.yml b/roles/mysql_open_files_limit/tasks/main.yml index 439fa50ba..3eb6a641a 100644 --- a/roles/mysql_open_files_limit/tasks/main.yml +++ b/roles/mysql_open_files_limit/tasks/main.yml @@ -1,13 +1,13 @@ --- - name: Set container_cli fact from the inventory set_fact: - container_cli: "{{ hostvars[inventory_hostname].container_cli }}" + container_cli: "{{ hostvars[inventory_hostname].container_cli |default('podman', true) }}" - name: Get the open_files_limit value become: true shell: >- - "{{ container_cli|default('podman', true) }}" exec -u root - $("{{ container_cli|default('podman', true) }}" ps -q --filter "name=mysql|galera-bundle" | head -1) + "{{ container_cli }}" exec -u root + $("{{ container_cli }}" ps -q --filter "name=mysql|galera-bundle" | head -1) /bin/bash -c 'ulimit -n' changed_when: false register: mysqld_open_files_limit