diff --git a/defaults/main.yml b/defaults/main.yml index fd686f1c1d16babe0d888976e09dd8f3b8dc6fdc..f3e747ac7d439123ebb848bdf4ca521aed20a450 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,16 +1,16 @@ timers: - # timername: - # timer_precommand: pre-command before command (well done sherlock) - # timer_command: which command or script to execute - # timer_user: under which users the timer_command is executed. Default: root - # timer_OnCalendar: "*-*-* *:*:*" for example: *-*-* *:*:00 -> every minute - # Day Of the week Year-Month-Date Hour:Minute:Second - # timer_AccuracySec: Timer have a default accuracy of round about one minute. You can set the accuracy with this var. - # timer_persistent: Takes a boolean argument. If true, the time when the service unit was last triggered is stroed on disk. When the timer is activated, - # the service unit is triggered immediately if it would have been triggered at least once during the time when the timer was inactive. - # This is useful to catch up on missed runs of the service when the machine was off. - # Note that this setting only has an effect on timers configured with OnCalendar=.Defaults to false. - # timer_OnActiveSec: relative time after the timer unit was last activated - # timer_OnBootSec: Relative time after the computer was booted - # timer_OnStartupSec: Relative time after systemd was started - # timer_OnUnitActiveSec: Relative time after the service unit was last activated \ No newline at end of file +# timername: +# timer_precommand: pre-command before command (well done sherlock) +# timer_command: which command or script to execute +# timer_user: under which users the timer_command is executed. Default: root +# timer_OnCalendar: "*-*-* *:*:*" for example: *-*-* *:*:00 -> every minute +# Day Of the week Year-Month-Date Hour:Minute:Second +# timer_AccuracySec: Timer have a default accuracy of round about one minute. You can set the accuracy with this var. +# timer_persistent: Takes a boolean argument. If true, the time when the service unit was last triggered is stroed on disk. When the timer is activated, +# the service unit is triggered immediately if it would have been triggered at least once during the time when the timer was inactive. +# This is useful to catch up on missed runs of the service when the machine was off. +# Note that this setting only has an effect on timers configured with OnCalendar=.Defaults to false. +# timer_OnActiveSec: relative time after the timer unit was last activated +# timer_OnBootSec: Relative time after the computer was booted +# timer_OnStartupSec: Relative time after systemd was started +# timer_OnUnitActiveSec: Relative time after the service unit was last activated diff --git a/tasks/main.yml b/tasks/main.yml index 336d9f77ec4134a85ea5e2768d07bee52ef46310..02a1163f0c1e855d3d310ae71b4c85d782559f24 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,32 +1,32 @@ --- - name: Upload files and enable timer - + block: - name: Uploading service file template: - src: service.j2 - dest: "{{ systemd_base_path | default('/etc/systemd/system') }}/{{ item.key }}.service" - owner: "{{ item.value.timer_user | default('root') }}" - group: "{{ item.value.timer_user | default('root') }}" - mode: 0644 + src: service.j2 + dest: "{{ systemd_base_path | default('/etc/systemd/system') }}/{{ item.key }}.service" + owner: "{{ item.value.timer_user | default('root') }}" + group: "{{ item.value.timer_user | default('root') }}" + mode: 0644 with_dict: "{{ timers }}" - name: Uploading timer file template: - src: timer.j2 - dest: "{{ systemd_base_path | default('/etc/systemd/system') }}/{{ item.key }}.timer" - owner: "{{ item.value.timer_user | default('root') }}" - group: "{{ item.value.timer_user | default('root') }}" - mode: 0644 + src: timer.j2 + dest: "{{ systemd_base_path | default('/etc/systemd/system') }}/{{ item.key }}.timer" + owner: "{{ item.value.timer_user | default('root') }}" + group: "{{ item.value.timer_user | default('root') }}" + mode: 0644 with_dict: "{{ timers }}" - name: Enabling timers systemd: - name: "{{ item.key }}.timer" - state: restarted - enabled: true - masked: false - scope: "{{ systemd_scope | default('system') }}" + name: "{{ item.key }}.timer" + state: restarted + enabled: true + masked: false + scope: "{{ systemd_scope | default('system') }}" with_dict: "{{ timers }}" - - notify: Reload systemd \ No newline at end of file + + notify: Reload systemd