Onion idempotent
This commit is contained in:
parent
15ca2904bb
commit
b4c3f624bc
|
@ -1,22 +1,16 @@
|
||||||
- stat:
|
|
||||||
path: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
|
|
||||||
register: conf_exists
|
|
||||||
|
|
||||||
- name: webserver-onion-hostname
|
- name: webserver-onion-hostname
|
||||||
command: "cat /var/lib/tor/{{ item.name }}/hostname"
|
command: "cat /var/lib/tor/{{ item.name }}/hostname"
|
||||||
register: web_onion
|
register: web_onion
|
||||||
when: not conf_exists.stat.exists
|
changed_when: false
|
||||||
|
|
||||||
- name: webserver-onion-config
|
- name: webserver-onion-config
|
||||||
template:
|
template:
|
||||||
src: ../files/onion.conf.j2
|
src: ../files/onion.conf.j2
|
||||||
dest: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
|
dest: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
|
||||||
notify: webserver-reload-nginx
|
notify: webserver-reload-nginx
|
||||||
when: not conf_exists.stat.exists
|
|
||||||
|
|
||||||
- name: webserver-onion-symlink
|
- name: webserver-onion-symlink
|
||||||
file:
|
file:
|
||||||
src: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
|
src: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
|
||||||
dest: "/etc/nginx/sites-enabled/{{ item.name }}.onion.conf"
|
dest: "/etc/nginx/sites-enabled/{{ item.name }}.onion.conf"
|
||||||
state: link
|
state: link
|
||||||
when: not conf_exists.stat.exists
|
|
||||||
|
|
Loading…
Reference in New Issue