From: Thanh Ha Date: Fri, 14 Aug 2020 15:29:23 +0000 (-0400) Subject: Support Ubuntu 18.04 and 20.04 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F65097%2F1;p=ansible%2Froles%2Fhaveged-install.git Support Ubuntu 18.04 and 20.04 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 --- diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 572361f..0d1e519 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -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: diff --git a/tasks/main.yml b/tasks/main.yml index 08a913a..0e31f0a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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"