add clean up tasks for toggling units in config

This commit is contained in:
Pig Monkey 2016-01-30 14:17:01 -08:00
parent 499cc7463b
commit 9e362a2999
5 changed files with 48 additions and 2 deletions

View file

@ -37,7 +37,21 @@
tags:
- bitlbee
- name: Push dispatcher to activate Bitlbee on trusted networks
- name: Remove Bitlbee from trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=absent
line=bitlbee.service
when: bitlbee.run_on == "all"
tags:
- bitlbee
- name: Disable Bitlbee
service: name=bitlbee enabled=no
when: bitlbee.run_on == "trusted"
tags:
- bitlbee
- name: Add Bitlbee to trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=present
line=bitlbee.service

View file

@ -11,3 +11,7 @@
- name: Enable and start macchiato
service: name=macchiato.service enabled=yes state=started
when: network.spoof_mac == True
- name: Disable and stop macchiato
service: name=macchiato.service enabled=no state=stopped
when: network.spoof_mac == False

View file

@ -20,6 +20,20 @@
tags:
- mailsync
- name: Remove mailsync from trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=absent
line="mailsync@{{ user.name }}.timer"
when: mail.sync_on == "all"
tags:
- mailsync
- name: Disable mailsync timer
service: name="mailsync@{{ user.name }}.timer" enabled=no
when: mail.sync_on == "trusted"
tags:
- mailsync
- name: Add mailsync to trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=present

View file

@ -17,6 +17,10 @@
service: name=sshd.socket enabled=yes state=started
when: ssh.enable_sshd == True
- name: Disable and stop OpenSSH
service: name=sshd.socket enabled=no state=stopped
when: ssh.enable_sshd == False
- name: Install sshfs
pacman: name=sshfs state=present

View file

@ -39,7 +39,17 @@
service: name=tarsnapper.timer enabled=yes state=started
when: tarsnapper.timer.run_on == "all"
- name: Add tarsnapper to trusted unit list
- name: Remove Tarsnapper from trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=absent
line=tarsnapper.timer
when: tarsnapper.timer.run_on == "all"
- name: Disable Tarsnapper timer
service: name=tarsnapper.timer enabled=no
when: tarsnapper.timer.run_on == "trusted"
- name: Add Tarsnapper to trusted unit list
lineinfile: dest=/usr/local/etc/trusted_units
state=present
line=tarsnapper.timer