From f1b742c6e733f99cd3300a048154ce74548ff9de Mon Sep 17 00:00:00 2001 From: Pig Monkey Date: Sat, 14 Jan 2017 17:47:34 -0800 Subject: [PATCH] move bluetooth masking to bluetooth role --- group_vars/all | 3 ++- playbook.yml | 3 ++- roles/bluetooth/tasks/main.yml | 7 +++++++ roles/laptop/tasks/main.yml | 8 -------- 4 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 roles/bluetooth/tasks/main.yml diff --git a/group_vars/all b/group_vars/all index 4eae7cf..836b00a 100644 --- a/group_vars/all +++ b/group_vars/all @@ -126,7 +126,8 @@ nameservers: - 209.244.0.3 # Level 3 - 74.82.42.42 # Hurricane Electric -bluetooth: False +bluetooth: + disable: False firejail: blacklist: diff --git a/playbook.yml b/playbook.yml index 339692b..a6c51fe 100644 --- a/playbook.yml +++ b/playbook.yml @@ -60,8 +60,9 @@ - { role: calibre, tags: ['calibre'] } - { role: aws, tags: ['aws'] } - { role: parcimonie, tags: ['parcimonie'], when: "tor is defined" } - - { role: localtime, tags: ['localtime'], when: "localtime is defined" } + - { role: localtime, tags: ['localtime'], when: "localtime is defined" } - { role: wormhole, tags: ['wormhole'] } + - { role: bluetooth, tags: ['bluetooth'], when: "bluetooth is defined" } vars_prompt: - name: user_password prompt: "Enter desired user password" diff --git a/roles/bluetooth/tasks/main.yml b/roles/bluetooth/tasks/main.yml new file mode 100644 index 0000000..34595a6 --- /dev/null +++ b/roles/bluetooth/tasks/main.yml @@ -0,0 +1,7 @@ +- name: Block the bluetooth service + service: name="rfkill-block@bluetooth.service" enabled=yes state=started + when: bluetooth.disable == True + +- name: Unblock the bluetooth service + service: name="rfkill-block@bluetooth.service" enabled=no state=stopped + when: bluetooth.disable == False diff --git a/roles/laptop/tasks/main.yml b/roles/laptop/tasks/main.yml index d6aafc4..735a6ae 100644 --- a/roles/laptop/tasks/main.yml +++ b/roles/laptop/tasks/main.yml @@ -21,11 +21,3 @@ - name: Enable and start lowbatt timer service: name=lowbatt.timer enabled=yes state=started - -- name: Block the bluetooth service - service: name="rfkill-block@bluetooth.service" enabled=yes state=started - when: bluetooth == False - -- name: Unblock the bluetooth service - service: name="rfkill-block@bluetooth.service" enabled=no state=stopped - when: bluetooth == True