2020-04-11 00:15:55 +00:00
|
|
|
- include_tasks: setup_user.yml
|
|
|
|
loop: "{{ users }}"
|
2020-04-15 21:31:28 +00:00
|
|
|
|
|
|
|
- stat:
|
|
|
|
path: "/var/lib/tor/{{ item.name }}/hostname"
|
|
|
|
loop: "{{ users }}"
|
|
|
|
register: onion_exists
|
|
|
|
changed_when: not onion_exists.stat.exists
|
2020-04-11 23:49:16 +00:00
|
|
|
|
2020-04-17 13:39:07 +00:00
|
|
|
- name: common-users-tor-reload
|
2020-04-11 23:49:16 +00:00
|
|
|
service:
|
|
|
|
name: tor
|
|
|
|
state: restarted
|
2020-04-15 21:31:28 +00:00
|
|
|
when: onion_exists.changed
|
2020-04-11 23:49:16 +00:00
|
|
|
|
2020-04-17 13:39:07 +00:00
|
|
|
- name: common-users-tor-wait
|
2020-04-11 23:49:16 +00:00
|
|
|
wait_for:
|
|
|
|
path: "/var/lib/tor/{{ item.name }}/hostname"
|
|
|
|
loop: "{{ users }}"
|
2020-04-15 21:31:28 +00:00
|
|
|
when: onion_exists.changed
|