We're going to need information about the OS outside of
Ansible soon, so drop the OS detection code and start
storing the information as host variables instead.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/host_vars/libvirt-centos-7/main.yml | 4 ++
guests/host_vars/libvirt-debian-8/main.yml | 4 ++
guests/host_vars/libvirt-debian-9/main.yml | 4 ++
guests/host_vars/libvirt-debian-sid/main.yml | 4 ++
guests/host_vars/libvirt-fedora-27/main.yml | 4 ++
guests/host_vars/libvirt-fedora-28/main.yml | 4 ++
.../host_vars/libvirt-fedora-rawhide/main.yml | 4 ++
guests/host_vars/libvirt-freebsd-10/main.yml | 4 ++
guests/host_vars/libvirt-freebsd-11/main.yml | 4 ++
.../libvirt-freebsd-current/main.yml | 4 ++
guests/host_vars/libvirt-ubuntu-16/main.yml | 4 ++
guests/host_vars/libvirt-ubuntu-18/main.yml | 4 ++
guests/tasks/base.yml | 51 -------------------
13 files changed, 48 insertions(+), 51 deletions(-)
diff --git a/guests/host_vars/libvirt-centos-7/main.yml
b/guests/host_vars/libvirt-centos-7/main.yml
index c147830..4c80e22 100644
--- a/guests/host_vars/libvirt-centos-7/main.yml
+++ b/guests/host_vars/libvirt-centos-7/main.yml
@@ -13,3 +13,7 @@ projects:
- osinfo-db
- osinfo-db-tools
- virt-viewer
+
+package_format: rpm
+os_name: CentOS
+os_version: 7
diff --git a/guests/host_vars/libvirt-debian-8/main.yml
b/guests/host_vars/libvirt-debian-8/main.yml
index 954a037..a6875a4 100644
--- a/guests/host_vars/libvirt-debian-8/main.yml
+++ b/guests/host_vars/libvirt-debian-8/main.yml
@@ -11,3 +11,7 @@ projects:
- osinfo-db
- osinfo-db-tools
- virt-viewer
+
+package_format: deb
+os_name: Debian
+os_version: 8
diff --git a/guests/host_vars/libvirt-debian-9/main.yml
b/guests/host_vars/libvirt-debian-9/main.yml
index a588c09..cdc5a57 100644
--- a/guests/host_vars/libvirt-debian-9/main.yml
+++ b/guests/host_vars/libvirt-debian-9/main.yml
@@ -14,3 +14,7 @@ projects:
- osinfo-db-tools
- virt-manager
- virt-viewer
+
+package_format: deb
+os_name: Debian
+os_version: 9
diff --git a/guests/host_vars/libvirt-debian-sid/main.yml
b/guests/host_vars/libvirt-debian-sid/main.yml
index a588c09..5dd887b 100644
--- a/guests/host_vars/libvirt-debian-sid/main.yml
+++ b/guests/host_vars/libvirt-debian-sid/main.yml
@@ -14,3 +14,7 @@ projects:
- osinfo-db-tools
- virt-manager
- virt-viewer
+
+package_format: deb
+os_name: Debian
+os_version: Sid
diff --git a/guests/host_vars/libvirt-fedora-27/main.yml
b/guests/host_vars/libvirt-fedora-27/main.yml
index 00b0848..f131953 100644
--- a/guests/host_vars/libvirt-fedora-27/main.yml
+++ b/guests/host_vars/libvirt-fedora-27/main.yml
@@ -15,3 +15,7 @@ projects:
- osinfo-db-tools
- virt-manager
- virt-viewer
+
+package_format: rpm
+os_name: Fedora
+os_version: 27
diff --git a/guests/host_vars/libvirt-fedora-28/main.yml
b/guests/host_vars/libvirt-fedora-28/main.yml
index 00b0848..f115598 100644
--- a/guests/host_vars/libvirt-fedora-28/main.yml
+++ b/guests/host_vars/libvirt-fedora-28/main.yml
@@ -15,3 +15,7 @@ projects:
- osinfo-db-tools
- virt-manager
- virt-viewer
+
+package_format: rpm
+os_name: Fedora
+os_version: 28
diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml
b/guests/host_vars/libvirt-fedora-rawhide/main.yml
index 5044594..1bd3332 100644
--- a/guests/host_vars/libvirt-fedora-rawhide/main.yml
+++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml
@@ -20,3 +20,7 @@ projects:
- virt-manager
- virt-viewer
- virt-viewer+mingw
+
+package_format: rpm
+os_name: Fedora
+os_version: Rawhide
diff --git a/guests/host_vars/libvirt-freebsd-10/main.yml
b/guests/host_vars/libvirt-freebsd-10/main.yml
index 2ad4584..005acb4 100644
--- a/guests/host_vars/libvirt-freebsd-10/main.yml
+++ b/guests/host_vars/libvirt-freebsd-10/main.yml
@@ -15,3 +15,7 @@ projects:
- osinfo-db-tools
- virt-manager
- virt-viewer
+
+package_format: pkg
+os_name: FreeBSD
+os_version: 10
diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml
b/guests/host_vars/libvirt-freebsd-11/main.yml
index 2ad4584..dd06fc5 100644
--- a/guests/host_vars/libvirt-freebsd-11/main.yml
+++ b/guests/host_vars/libvirt-freebsd-11/main.yml
@@ -15,3 +15,7 @@ projects:
- osinfo-db-tools
- virt-manager
- virt-viewer
+
+package_format: pkg
+os_name: FreeBSD
+os_version: 11
diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml
b/guests/host_vars/libvirt-freebsd-current/main.yml
index 2ad4584..07f3f25 100644
--- a/guests/host_vars/libvirt-freebsd-current/main.yml
+++ b/guests/host_vars/libvirt-freebsd-current/main.yml
@@ -15,3 +15,7 @@ projects:
- osinfo-db-tools
- virt-manager
- virt-viewer
+
+package_format: pkg
+os_name: FreeBSD
+os_version: Current
diff --git a/guests/host_vars/libvirt-ubuntu-16/main.yml
b/guests/host_vars/libvirt-ubuntu-16/main.yml
index a588c09..92296b4 100644
--- a/guests/host_vars/libvirt-ubuntu-16/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-16/main.yml
@@ -14,3 +14,7 @@ projects:
- osinfo-db-tools
- virt-manager
- virt-viewer
+
+package_format: deb
+os_name: Ubuntu
+os_version: 16
diff --git a/guests/host_vars/libvirt-ubuntu-18/main.yml
b/guests/host_vars/libvirt-ubuntu-18/main.yml
index a588c09..8a45854 100644
--- a/guests/host_vars/libvirt-ubuntu-18/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-18/main.yml
@@ -14,3 +14,7 @@ projects:
- osinfo-db-tools
- virt-manager
- virt-viewer
+
+package_format: deb
+os_name: Ubuntu
+os_version: 18
diff --git a/guests/tasks/base.yml b/guests/tasks/base.yml
index 13d02f8..6310d96 100644
--- a/guests/tasks/base.yml
+++ b/guests/tasks/base.yml
@@ -1,55 +1,4 @@
---
-- name: Set additional facts (OS)
- set_fact:
- os_name: '{{ ansible_distribution }}'
-
-- name: Set additional facts (OS)
- set_fact:
- os_version: '{{ ansible_distribution_major_version }}'
- when:
- - ansible_distribution_major_version is defined
-
-- name: Set additional facts (OS)
- set_fact:
- os_version: Rawhide
- when:
- - os_name == 'Fedora'
- - ansible_distribution_release == 'Rawhide'
-
-- name: Set additional facts (OS)
- set_fact:
- os_version: Sid
- when:
- - os_name == 'Debian'
- - ansible_distribution_major_version is match("^.*/sid$")
-
-- name: Set additional facts (OS)
- set_fact:
- os_version: Current
- when:
- - ansible_distribution == 'FreeBSD'
- - ansible_distribution_release is match("^.*-CURRENT$")
-
-- name: Set additional facts (package format)
- set_fact:
- package_format: deb
- when:
- - ( os_name == 'Debian' or
- os_name == 'Ubuntu' )
-
-- name: Set additional facts (package format)
- set_fact:
- package_format: pkg
- when:
- - os_name == 'FreeBSD'
-
-- name: Set additional facts (package format)
- set_fact:
- package_format: rpm
- when:
- - ( os_name == 'CentOS' or
- os_name == 'Fedora' )
-
- name: Bootstrap the package module
command: apt-get install -y python-apt
args:
--
2.17.1