From 3a7440b370f5c2bf6f255a6530349a3e680007b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= <radoslaw.piliszek@gmail.com>
Date: Mon, 21 Jun 2021 15:40:46 +0000
Subject: [PATCH] Fix host bootstrap pkg removal on Debian

The variable names are awful but this all agrees with the docs now.

Closes-Bug: #1933122
Change-Id: Icd3d140473886ba3c4847859cddccdb3c1376818
---
 ansible/roles/baremetal/tasks/install.yml            | 2 +-
 releasenotes/notes/bug-1933122-b34311ba73092080.yaml | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 releasenotes/notes/bug-1933122-b34311ba73092080.yaml

diff --git a/ansible/roles/baremetal/tasks/install.yml b/ansible/roles/baremetal/tasks/install.yml
index 8b08946b2..18f2bfd7c 100644
--- a/ansible/roles/baremetal/tasks/install.yml
+++ b/ansible/roles/baremetal/tasks/install.yml
@@ -150,7 +150,7 @@
     name: "{{ (ubuntu_pkg_removals | join(' ')).split() }}"
     state: absent
   become: True
-  when: ansible_distribution|lower == "ubuntu"
+  when: ansible_os_family == 'Debian'
 
 - name: Remove packages
   package:
diff --git a/releasenotes/notes/bug-1933122-b34311ba73092080.yaml b/releasenotes/notes/bug-1933122-b34311ba73092080.yaml
new file mode 100644
index 000000000..f0555693c
--- /dev/null
+++ b/releasenotes/notes/bug-1933122-b34311ba73092080.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    Fixes host bootstrap on Debian not removing the conflicting packages.
+    It now behaves in accordance with the docs.
+    `LP#1933122 <https://launchpad.net/bugs/1933122>`__
-- 
GitLab