[libvirt-jenkins-ci PATCH 1/2] ansible: Use systemd module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using the module is preferable to calling systemctl(1) directly
because it's better integrated into Ansible (eg. the task will be
marked as "ok" instead of "changed" when the service has already
been enabled) and allows us to perform service activation in a
single step instead of two.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 ansible/tasks/jenkins.yml | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ansible/tasks/jenkins.yml b/ansible/tasks/jenkins.yml
index 087033d..563f220 100644
--- a/ansible/tasks/jenkins.yml
+++ b/ansible/tasks/jenkins.yml
@@ -48,12 +48,10 @@
   when:
     - use_systemd
 
-- name: Reload systemd status
-  command: systemctl daemon-reload
-  when:
-    - use_systemd
-
 - name: Enable Jenkins agent
-  command: systemctl enable jenkins
+  systemd:
+    name: jenkins.service
+    enabled: yes
+    daemon_reload: yes
   when:
     - use_systemd
-- 
2.13.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux