Skip to content

Instantly share code, notes, and snippets.

@timss
Created May 18, 2018 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timss/56b9afe6495f06354ba77ee58ae2f6b2 to your computer and use it in GitHub Desktop.
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
- 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
$ 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