Add repos only when there're packages for install
At the moment we allow not to install packages by providing systemd_networkd_distro_packages as an empty list. When that happens it makes sense also to skip all tasks related to adding repositories when no packages are going to be installed. Not installing packages might be useful for containers creation or in situations when there is no networking yet, but we know that systemd-networkd is already present. Change-Id: I5e12cb0eb07b5eb8dcca462dbe8239a926ef80e6
This commit is contained in:
parent
356db62780
commit
0ae090b0d5
@ -28,6 +28,10 @@
|
||||
tags:
|
||||
- always
|
||||
|
||||
- name: Install required repos and packages
|
||||
when:
|
||||
- systemd_networkd_distro_packages | length > 0
|
||||
block:
|
||||
# Copy all factored-in GPG keys.
|
||||
# KeyID 2F86D6A1 from https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
|
||||
- name: If a keyfile is provided, copy the gpg keyfile to the key location
|
||||
@ -87,8 +91,6 @@
|
||||
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
|
||||
cache_valid_time: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary(600, omit) }}"
|
||||
enablerepo: "{{ systemd_networkd_enablerepo | default(omit) }}"
|
||||
when:
|
||||
- systemd_networkd_distro_packages | length > 0
|
||||
register: install_packages
|
||||
until: install_packages is success
|
||||
retries: 3
|
||||
|
Loading…
x
Reference in New Issue
Block a user