From 3041e5924466950f92f41268c34bd298809c6d30 Mon Sep 17 00:00:00 2001 From: h3po Date: Thu, 13 Aug 2020 12:52:47 +0200 Subject: [PATCH] handle package updates after changing the repo from stable to mainline on redhat --- tasks/setup-RedHat.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml index 2507397..487be48 100644 --- a/tasks/setup-RedHat.yml +++ b/tasks/setup-RedHat.yml @@ -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 \ No newline at end of file