]> git.phdru.name Git - ansible.git/blobdiff - playbooks/debian/roles/add_apache_vhost/tasks/main.yml
Feat(add_apache_vhost): Setup `dehydrated` for the virtual host
[ansible.git] / playbooks / debian / roles / add_apache_vhost / tasks / main.yml
index d5f9ddd72a36b4a18a2d635f82f144dc79d5d2e7..8208d183757582044beea9c4daf76e1c1fb47a84 100644 (file)
@@ -4,30 +4,10 @@
   register: vhost
   changed_when: vhost.rc != 0
 
-- name: Configure site
-  become: true
-  template:
-    src: vhost.conf
-    dest: "/etc/apache2/sites-available/{{ virtual_host }}.conf"
-    owner: root
-    group: root
-    mode: '0640'
-    force: no
-  notify: Reload apache
+- name: Add vhost
+  import_tasks: add_vhost.yml
   when: vhost.rc != 0
 
-- name: Enable site
-  become: true
-  command: "a2ensite {{ virtual_host }}"
-  notify: Reload apache
-  when: vhost.rc != 0
-
-- name: Create log directory
-  become: true
-  file:
-    path: /var/log/apache2/{{ virtual_host }}
-    state: directory
-    owner: root
-    group: root
-    mode: '0640'
+- name: Run dehydrated for the vhost
+  import_tasks: dehydrated.yml
   when: vhost.rc != 0