]> git.phdru.name Git - ansible.git/blobdiff - playbooks/roles/debian/add-apache-vhost/tasks/main.yml
Refactor: Move OS-specific roles under common `roles/`
[ansible.git] / playbooks / roles / debian / add-apache-vhost / tasks / main.yml
diff --git a/playbooks/roles/debian/add-apache-vhost/tasks/main.yml b/playbooks/roles/debian/add-apache-vhost/tasks/main.yml
new file mode 100644 (file)
index 0000000..511a676
--- /dev/null
@@ -0,0 +1,12 @@
+- name: Check vhost
+  stat:
+    path: "/etc/apache2/sites-enabled/{{ virtual_host }}.conf"
+  register: vhost_conf
+  changed_when: not vhost_conf.stat.exists
+
+- 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