handle package updates after changing the repo from stable to mainline on redhat

This commit is contained in:
h3po 2020-08-13 12:52:47 +02:00
parent ef4ade8267
commit 3041e59244
1 changed files with 10 additions and 1 deletions

View File

@ -7,8 +7,17 @@
group: "{{ root_group }}"
mode: 0644
when: nginx_yum_repo_enabled | bool
register: repo
- name: Clean the nginx repo
command: >
yum clean all --disablerepo="*" --enablerepo=nginx
args:
warn: false
when: repo.changed
- name: Ensure nginx is installed.
package:
name: "{{ nginx_package_name }}"
state: present
state: "{{ 'latest' if repo.changed else 'present' }}"
notify: restart nginx