26 lines
668 B
YAML
26 lines
668 B
YAML
# Need to check because we don't want to overwrite user content
|
|
# with symlinks in the name of idempotence :D
|
|
- name: webserver-multisite-check
|
|
stat:
|
|
path: "/home/{{ user.name }}/public/html"
|
|
# In case it's a symlink to elsewhere
|
|
follow: yes
|
|
register: publichtml
|
|
|
|
- name: webserver-multisite-folder
|
|
file:
|
|
path: "/home/{{ user.name }}/public/html"
|
|
state: directory
|
|
when: not publichtml.stat.exists
|
|
|
|
- name: webserver-multisite-symlink
|
|
file:
|
|
path: "/home/{{ user.name }}/public/html/{{ item }}"
|
|
src: "/home/{{ user.name }}/public_html"
|
|
state: link
|
|
loop:
|
|
- onion
|
|
- domain
|
|
- tilde
|
|
when: not publichtml.stat.exists
|