diff --git a/playbook.yml b/playbook.yml index f3710c8..4b316c7 100644 --- a/playbook.yml +++ b/playbook.yml @@ -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'] } diff --git a/roles/tor/tasks/main.yml b/roles/tor/tasks/main.yml index f1b9a84..eee694c 100644 --- a/roles/tor/tasks/main.yml +++ b/roles/tor/tasks/main.yml @@ -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"