Support Ubuntu 18.04 and 20.04 97/65097/1
authorThanh Ha <zxiiro@gmail.com>
Fri, 14 Aug 2020 15:29:23 +0000 (11:29 -0400)
committerThanh Ha <zxiiro@gmail.com>
Fri, 14 Aug 2020 15:36:42 +0000 (11:36 -0400)
Adds tests to validate this role against Ubuntu 18.04 and 20.04.
We also need to split off the systemd task to a separate service
role for Ubuntu as 18.04 and newer Docker images are missing systemd
in their base images. The service role works on 16.04 systems so we
can apply this one task to all Ubuntu systems.

Change-Id: I86f0ba719cb482cb3f00697be60dfe9e48749e1c
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
molecule/default/molecule.yml
tasks/main.yml

index 572361f..0d1e519 100644 (file)
@@ -12,6 +12,10 @@ platforms:
     image: centos:7
   - name: ubuntu1604
     image: ubuntu:16.04
+  - name: ubuntu1804
+    image: ubuntu:18.04
+  - name: ubuntu2004
+    image: ubuntu:20.04
 provisioner:
   name: ansible
 scenario:
index 08a913a..0e31f0a 100644 (file)
@@ -8,8 +8,16 @@
   package: name=haveged state=present
   become: true
 
-- name: Enable haveged service
+- name: Enable haveged service (Ubuntu)
+  service:
+    name: haveged
+    enabled: yes
+  become: true
+  when: ansible_distribution == 'Ubuntu'
+
+- name: Enable haveged service (RedHat)
   systemd:
     name: haveged
     enabled: yes
   become: true
+  when: ansible_os_family == "RedHat"