Compare commits

..

No commits in common. "main" and "v0.1.0" have entirely different histories.
main ... v0.1.0

3 changed files with 16 additions and 60 deletions

View File

@ -1,10 +1,20 @@
{% from "system/map.jinja" import system_settings with context %}
{% set settings = system_settings['sleep'] %}
{% if salt['grains']['get']('os_family') == 'FreeBSD' %}
include:
- system.sleep.freebsd
{% else %}
include:
- system.sleep.linux
{% if settings.disable %}
disable_sleep_target:
service.masked:
- name: 'sleep.target'
disable_suspend_target:
service.masked:
- name: 'suspend.target'
disable_hibernate_target:
service.masked:
- name: 'hibernate.target'
disable_hybrid-sleep_target:
service.masked:
- name: 'hybrid-sleep.target'
{% endif %}

View File

@ -1,16 +0,0 @@
{% from "system/map.jinja" import system_settings with context %}
{% set settings = system_settings['sleep'] %}
{% if settings.disable %}
# Disable sleep via sysctl
sleep_disable_sysctl:
sysctl.present:
- name: 'kern.suspend_blocked'
- value: '1'
{% else %}
# Enable sleep via sysctl
sleep_enable_sysctl:
sysctl.present:
- name: 'kern.suspend_blocked'
- value: '0'
{% endif %}

View File

@ -1,38 +0,0 @@
{% from "system/map.jinja" import system_settings with context %}
{% set settings = system_settings['sleep'] %}
{% if settings.disable %}
# Disable common sleep states
disable_sleep_target:
service.masked:
- name: 'sleep.target'
disable_suspend_target:
service.masked:
- name: 'suspend.target'
disable_hibernate_target:
service.masked:
- name: 'hibernate.target'
disable_hybrid-sleep_target:
service.masked:
- name: 'hybrid-sleep.target'
{% else %}
# Enable sleep states
enable_sleep_target:
service.unmasked:
- name: 'sleep.target'
enable_suspend_target:
service.unmasked:
- name: 'suspend.target'
enable_hibernate_target:
service.unmasked:
- name: 'hibernate.target'
enable_hybrid-sleep_target:
service.unmasked:
- name: 'hybrid-sleep.target'
{% endif %}