Browse Source

Use included functions and move vars to group for merging

master
Alex 2 years ago
parent
commit
8cc540e1d3
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
  1. 10
      handlers/main.yml
  2. 29
      tasks/main.yml

10
handlers/main.yml

@ -1,10 +0,0 @@
- name: Enable tor
systemd:
name: 'tor@default'
enabled: yes
state: restarted
daemon_reload: yes
- name: Restart tor
systemd:
name: 'tor@default'
state: restarted

29
tasks/main.yml

@ -1,27 +1,10 @@
- name: Create configuration directory
file:
path: '/etc/tor'
state: directory
tags:
- setup
- configs
- name: Copy configuration files
loop:
- { src: 'torrc.j2', dest: '/etc/tor/torrc' }
template:
follow: yes
src: 'torrc.j2'
dest: '/etc/tor/torrc'
notify: Restart tor
tags:
- update
- configs
- name: Install tor
apt:
install_recommends: no
name:
- tor
state: present
cache_valid_time: 3600
src: '{{ item.src }}'
dest: '{{ item.dest }}'
notify: Run service actions
tags:
- setup
- packages
notify: Enable tor
- config