only perform tor tasks when tor variable is defined

This commit is contained in:
Pig Monkey 2016-08-18 20:41:28 -07:00
parent 1db8763ca0
commit 948b2a3b9f
2 changed files with 5 additions and 5 deletions

View file

@ -19,7 +19,7 @@
- { role: macchiato, tags: ['macchiato'] }
- { role: ntp, tags: ['ntp'] }
- { role: firejail, tags: ['firejail'] }
- { role: tor, tags: ['tor'] }
- { role: tor, tags: ['tor'], when: "tor is defined" }
- { role: unbound, tags: ['unbound'] }
- { role: editors, tags: ['editors'] }
- { role: filesystems, tags: ['filesystems'] }

View file

@ -19,20 +19,20 @@
- name: Enable and start Tor
service: name=tor enabled=yes state=started
when: tor is defined and tor.run_on == "all"
when: tor.run_on == "all"
- name: Remove Tor from trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=absent
line=tor.service
when: tor is defined and tor.run_on == "all"
when: tor.run_on == "all"
- name: Disable Tor
service: name=tor enabled=no
when: tor is defined and tor.run_on == "trusted"
when: tor.run_on == "trusted"
- name: Add Tor to trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=present
line=tor.service
when: tor is defined and tor.run_on == "trusted"
when: tor.run_on == "trusted"