diff --git a/ansible/roles/yum/tasks/custom_repo.yml b/ansible/roles/yum/tasks/custom_repo.yml index 72034be0c..355b346bc 100644 --- a/ansible/roles/yum/tasks/custom_repo.yml +++ b/ansible/roles/yum/tasks/custom_repo.yml @@ -25,4 +25,4 @@ retries: 3 delay: 10 until: "'failed' not in register_yum_command" - when: ansible_os_family == 'RedHat' + become: true diff --git a/ansible/roles/yum/tasks/main.yml b/ansible/roles/yum/tasks/main.yml index 07f63a3e0..a27a33a72 100644 --- a/ansible/roles/yum/tasks/main.yml +++ b/ansible/roles/yum/tasks/main.yml @@ -1,8 +1,7 @@ --- +- block: + - include: redhat.yml + when: yum_use_local_mirror | bool -- include: redhat.yml - when: - - ansible_os_family == "RedHat" - - yum_use_local_mirror - -- include: custom_repo.yml + - include: custom_repo.yml + when: ansible_os_family == 'RedHat'