2020-04-17 17:35:08 +00:00
|
|
|
- stat:
|
|
|
|
path: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
|
|
|
|
register: conf_exists
|
|
|
|
|
2020-04-17 16:15:20 +00:00
|
|
|
- name: webserver-onion-hostname
|
2020-04-11 23:49:16 +00:00
|
|
|
command: "cat /var/lib/tor/{{ item.name }}/hostname"
|
|
|
|
register: web_onion
|
2020-04-17 17:35:08 +00:00
|
|
|
when: not conf_exists.stat.exists
|
2020-04-11 23:49:16 +00:00
|
|
|
|
2020-04-17 16:15:20 +00:00
|
|
|
- name: webserver-onion-config
|
2020-04-11 23:49:16 +00:00
|
|
|
template:
|
|
|
|
src: ../files/onion.conf.j2
|
|
|
|
dest: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
|
|
|
|
notify: reload nginx
|
2020-04-17 17:35:08 +00:00
|
|
|
when: not conf_exists.stat.exists
|
2020-04-11 23:49:16 +00:00
|
|
|
|
2020-04-17 16:15:20 +00:00
|
|
|
- name: webserver-onion-symlink
|
2020-04-11 23:49:16 +00:00
|
|
|
file:
|
|
|
|
src: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
|
|
|
|
dest: "/etc/nginx/sites-enabled/{{ item.name }}.onion.conf"
|
|
|
|
state: link
|
2020-04-17 17:35:08 +00:00
|
|
|
when: not conf_exists.stat.exists
|