From 51daac22c63e28030d052d6afa97143268e81d8e Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Mon, 18 May 2020 19:50:20 +0100 Subject: [PATCH] Do not rebuild initramfs for containers Containers do not have an initramfs so this is not useful, and fails for Centos-7 with: Can't write to /boot: Directory /boot does not exist or is not accessible. Change-Id: Ibc6ff871ad6984d4e0f29693f4827f57169aef92 --- handlers/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/handlers/main.yml b/handlers/main.yml index e1935cf..1f2068a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -28,7 +28,7 @@ - name: (RE)Gather facts post setup setup: - gather_subset: "network" + gather_subset: "network,hardware,virtual" listen: Restart systemd-networkd - name: Restart systemd-resolved @@ -44,3 +44,11 @@ - name: Update initramfs command: "{{ systemd_networkd_update_initramfs }}" + when: + - ansible_virtualization_type != "systemd-nspawn" + - ansible_virtualization_type != "lxc" + - ansible_virtualization_type != "lxd" + - ansible_virtualization_type != "podman" + - ansible_virtualization_type != "docker" + - ansible_virtualization_type != "systemd_container" + - ansible_virtualization_type != "container"