ansible-keycloak/roles/keycloak/tasks/fastpackages/check.yml

14 lines
421 B
YAML
Raw Normal View History

---
- block:
- name: "Check if package {{ package_name }} is already installed"
command: rpm -q {{ package_name }}
args:
warn: no
register: rpm_info
changed_when: rpm_info.failed
rescue:
- name: "If package {{ package_name }} is missing, add it to the yum install list."
set_fact:
packages_to_install: "{{ packages_to_install + [ package_name ] }}"
when: rpm_info.failed