Created
May 18, 2018 13:44
-
-
Save timss/56b9afe6495f06354ba77ee58ae2f6b2 to your computer and use it in GitHub Desktop.
Simple Ansible playbook for configuring systemd to restart the bluetooth service on resume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
connection: local | |
vars: | |
ask_become_pass: yes | |
tasks: | |
- name: Configure systemd to restart bluetooth service on resume | |
copy: | |
dest: /lib/systemd/system-sleep/bluetooth-resume | |
mode: 0755 | |
content: | | |
#!/bin/sh | |
case $1 in | |
post) | |
/bin/systemctl restart bluetooth | |
;; | |
esac | |
become: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ansible-playbook -i localhost, bluetooth_resume.yml | |
PLAY [all] ******************************************************************************************************************************** | |
TASK [Gathering Facts] ******************************************************************************************************************** | |
ok: [localhost] | |
TASK [Configure systemd to restart bluetooth service on resume] *************************************************************************** | |
changed: [localhost] | |
PLAY RECAP ******************************************************************************************************************************** | |
localhost : ok=2 changed=1 unreachable=0 failed=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment