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>
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:
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"