Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Mostafa-Hamdy-Elgiar/edac8d04c5188e4e9a2a158a3f8ab2d3 to your computer and use it in GitHub Desktop.
Save Mostafa-Hamdy-Elgiar/edac8d04c5188e4e9a2a158a3f8ab2d3 to your computer and use it in GitHub Desktop.
Ansible playbook to schedule display sleep (OS X)
---
- hosts: office-dashboard-terminal
become: yes
tasks:
- name: Ensure displays are up during office hours
cron:
name="Activate display"
minute="0"
hour="8"
weekday="1-5"
job="/usr/bin/pmset displaysleep 0"
- name: Ensure displays are down when no one is working
cron:
name="Disable display"
minute="0"
hour="18"
weekday="1-5"
job="/usr/bin/pmset displaysleep 1"
@Mostafa-Hamdy-Elgiar
Copy link
Author

Add multiple cron jobs in one playbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment