]> git.somenet.org - root/pub/somesible.git/blob - roles/base/tor/tasks/main.yml
roles/base/backup/files
[root/pub/somesible.git] / roles / base / tor / tasks / main.yml
1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # 2017 by someone <someone@somenet.org>
5 #
6 ---
7 - name: install tor
8   apt:
9     pkg:
10     - tor
11     state: present
12     policy_rc_d: 101
13   when: setup_tor | bool
14   tags: "online"
15   ignore_errors: "{{ignore_online_errors | bool}}"
16
17
18 - name: copy torrc
19   copy:
20     src: "{{item}}"
21     dest: "/etc/tor/torrc"
22     mode: 0600
23     owner: "debian-tor"
24     group: "debian-tor"
25   with_first_found:
26     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/torrc"
27     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/torrc"
28     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/torrc"
29     - "default/torrc"
30   when: setup_tor | bool
31   notify: restart tor.service
32
33
34 # for each hidserv do a with first found.
35 - include_tasks: configure-hidserv.yml
36   with_items: "{{hidden_services}}"
37   loop_control:
38     loop_var: hs
39   when: setup_tor | bool
40
41
42 - name: enable and start tor.service
43   include_role: name="base/systemd/enable-and-start"
44   vars:
45     service_name: tor.service
46   when: setup_tor | bool