]> git.phdru.name Git - ansible.git/commitdiff
Fix(remove-systemd): Fix reboot condition
authorOleg Broytman <phd@phdru.name>
Tue, 23 Jul 2019 22:20:03 +0000 (01:20 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 23 Jul 2019 23:55:47 +0000 (02:55 +0300)
`purged.rc` is be undefined is SystemD has already been removed.

playbooks/debian/roles/remove-systemd/tasks/main.yml

index 144a05da3f34cfe2616ffc62aeae23c6ad5099f0..9c31cef258e7fdc4dbeec5b5fa6d449ec1341211 100644 (file)
@@ -35,8 +35,8 @@
 - name: Reboot if SystemD is still active
   become: true
   reboot:
-  when: purged.rc != 0
+  when: "'rc' in purged and purged.rc != 0"
 
 - name: Purge SystemD after reboot
   import_tasks: remove-systemd.yml
-  when: purged.rc != 0
+  when: "'rc' in purged and purged.rc != 0"