]> git.phdru.name Git - ansible.git/blobdiff - playbooks/debian/roles/add-apache-vhost/tasks/main.yml
Refactor: Join tasks into blocks to factor out conditions
[ansible.git] / playbooks / debian / roles / add-apache-vhost / tasks / main.yml
index 2f0e03a9209a0e0f3f549d19ee8fe91c15be81fb..511a67676a96f1019f5d7cff98fe096173c05655 100644 (file)
@@ -4,10 +4,9 @@
   register: vhost_conf
   changed_when: not vhost_conf.stat.exists
 
-- name: Add vhost
-  import_tasks: add-vhost.yml
-  when: not vhost_conf.stat.exists
-
-- name: Run dehydrated for the vhost
-  import_tasks: dehydrated.yml
+- block:
+    - name: Add vhost
+      import_tasks: add-vhost.yml
+    - name: Run dehydrated for the vhost
+      import_tasks: dehydrated.yml
   when: not vhost_conf.stat.exists