]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/add-apache-vhost/tasks/add-vhost.yml
Rename `add_apache_vhost` -> `apache-vhost`
[ansible.git] / playbooks / debian / roles / add-apache-vhost / tasks / add-vhost.yml
1 - name: Configure site
2   become: true
3   template:
4     src: vhost.conf
5     dest: "/etc/apache2/sites-available/{{ virtual_host }}.conf"
6     owner: root
7     group: root
8     mode: '0640'
9     force: no
10   notify: Reload apache
11   when: vhost.rc != 0
12
13 - name: Enable site
14   become: true
15   command: "a2ensite {{ virtual_host }}"
16   notify: Reload apache
17   when: vhost.rc != 0
18
19 - name: Create directories
20   become: true
21   file:
22     path: "{{ item }}/{{ virtual_host }}"
23     state: directory
24     owner: root
25     group: www-data
26     mode: '0755'
27   loop: ['/usr/local/apache2/cgi-bin', '/usr/local/apache2/htdocs',
28          '/var/log/apache2',
29         ]
30   when: vhost.rc != 0