From 115bfe66c963b7f539084fdcdf4f6dc1f4601076 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Mon, 20 Nov 2017 11:54:11 +0100 Subject: [PATCH] Add template for vdr-addon-acpiwakeup.conf --- Manual.org | 40 ++++++++++++++----- roles/wakeup/tasks/main.yml | 18 ++++----- .../templates/vdr-addon-acpiwakeup.conf.j2 | 16 ++++++++ 3 files changed, 54 insertions(+), 20 deletions(-) create mode 100644 roles/wakeup/templates/vdr-addon-acpiwakeup.conf.j2 diff --git a/Manual.org b/Manual.org index dae334a..9bc3367 100644 --- a/Manual.org +++ b/Manual.org @@ -3576,18 +3576,38 @@ wakeup_method: "acpiwakeup" # file roles/wakeup/tasks/main.yml - name: install and configure vdr-addon-acpiwakeup - block: - - apt: - name: vdr-addon-acpiwakeup - state: present - - - lineinfile: - path: /etc/vdr/vdr-addon-acpiwakeup.conf - regexp: '^ACPI_ENABLED=' - line: 'ACPI_ENABLED="yes"' - + apt: + name: vdr-addon-acpiwakeup + state: present when: wakeup_method == "acpiwakeup" + +- name: expand template for /etc/vdr/vdr-addon-acpiwakeup.conf + template: + src: roles/wakeup/vdr-addon-acpiwakeup.conf.j2 + dest: /etc/vdr/vdr-addon-acpiwakeup.conf + #+END_SRC +*** templates +#+BEGIN_SRC jinja2 :tangle roles/wakeup/templates/vdr-addon-acpiwakeup.conf.j2 :padline no +{{ ansible_managed_file | comment }} + +# Activate/deactivate ACPIWakeup with yes/no: +ACPI_ENABLED="{% if wakeup_method == 'acpiwakeup' %}yes{% else %}no{% endif %}" + +# How many minutes should the machine wake up before the timer starts: +ACPI_START_AHEAD=5 + +# If you want your VDR machine to wakeup in regular intervals (i.e. for +# updating EPG data), specify the days of the week and the wakeup time. +# +# Days of the week for regular wakeup (not set=Disabled, 1=Monday...7=Sunday) +# ACPI_REGULAR_DAYS="1 2 3 4 5 6 7" + +# Wakeup time +#ACPI_REGULAR_TIME=01:00 # HH:MM + +#+END_SRC + ** grub-config *** default variables #+BEGIN_SRC yaml :tangle roles/grub-config/defaults/main.yml :mkdirp yes :padline no diff --git a/roles/wakeup/tasks/main.yml b/roles/wakeup/tasks/main.yml index 7395cdb..dd62d67 100644 --- a/roles/wakeup/tasks/main.yml +++ b/roles/wakeup/tasks/main.yml @@ -2,14 +2,12 @@ # file roles/wakeup/tasks/main.yml - name: install and configure vdr-addon-acpiwakeup - block: - - apt: - name: vdr-addon-acpiwakeup - state: present - - - lineinfile: - path: /etc/vdr/vdr-addon-acpiwakeup.conf - regexp: '^ACPI_ENABLED=' - line: 'ACPI_ENABLED="yes"' - + apt: + name: vdr-addon-acpiwakeup + state: present when: wakeup_method == "acpiwakeup" + +- name: expand template for /etc/vdr/vdr-addon-acpiwakeup.conf + template: + src: roles/wakeup/vdr-addon-acpiwakeup.conf.j2 + dest: /etc/vdr/vdr-addon-acpiwakeup.conf diff --git a/roles/wakeup/templates/vdr-addon-acpiwakeup.conf.j2 b/roles/wakeup/templates/vdr-addon-acpiwakeup.conf.j2 new file mode 100644 index 0000000..92ebfa7 --- /dev/null +++ b/roles/wakeup/templates/vdr-addon-acpiwakeup.conf.j2 @@ -0,0 +1,16 @@ +{{ ansible_managed_file | comment }} + +# Activate/deactivate ACPIWakeup with yes/no: +ACPI_ENABLED="{% if wakeup_method == 'acpiwakeup' %}yes{% else %}no{% endif %}" + +# How many minutes should the machine wake up before the timer starts: +ACPI_START_AHEAD=5 + +# If you want your VDR machine to wakeup in regular intervals (i.e. for +# updating EPG data), specify the days of the week and the wakeup time. +# +# Days of the week for regular wakeup (not set=Disabled, 1=Monday...7=Sunday) +# ACPI_REGULAR_DAYS="1 2 3 4 5 6 7" + +# Wakeup time +#ACPI_REGULAR_TIME=01:00 # HH:MM