Remove haveged_service_enable variable 96/65096/1
authorThanh Ha <zxiiro@gmail.com>
Fri, 14 Aug 2020 15:30:43 +0000 (11:30 -0400)
committerThanh Ha <zxiiro@gmail.com>
Fri, 14 Aug 2020 15:36:36 +0000 (11:36 -0400)
This was added as a workaround because systemd didn't work correctly
on CentOS 7 systems when we originally added this test. This is no
longer the case so remove this workaround and apply systemd ansible
task for CentOS systems as for some reason the "service" task fails
on CentOS systems.

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

index 587b690..ed97d53 100644 (file)
@@ -1,2 +1 @@
 ---
-haveged_service_enable: true
index 8b17012..572361f 100644 (file)
@@ -10,16 +10,10 @@ lint: |
 platforms:
   - name: centos7
     image: centos:7
-    groups:
-      - centos
   - name: ubuntu1604
     image: ubuntu:16.04
 provisioner:
   name: ansible
-  inventory:
-    group_vars:
-      centos:
-        haveged_service_enable: false
 scenario:
   name: default
 verifier:
index 5358b3b..36e71a8 100644 (file)
@@ -1,5 +1,10 @@
 ---
 - name: Prepare
   hosts: all
-  gather_facts: false
-  tasks: []
+  gather_facts: true
+  tasks:
+    - name: Update APT cache
+      apt:
+        update_cache: yes
+      when: ansible_distribution == 'Ubuntu'
+      become: true
index 739973e..08a913a 100644 (file)
@@ -9,6 +9,7 @@
   become: true
 
 - name: Enable haveged service
-  service: name=haveged enabled=yes
-  when: haveged_service_enable | bool
+  systemd:
+    name: haveged
+    enabled: yes
   become: true