#+CAPTION: [[file:playbooks/timezone.yml][=playbooks/timezone.yml=]]
#+BEGIN_SRC conf :tangle playbooks/timezone.yml
---
-- hosts: core, dvrs, tvrs, webtvs
+- hosts: core, dvrs, tvrs, webtvs, notebooks
tasks:
- name: Get timezone.
command: date '+%Z'
when: ansible_date_time.tz != zone.stdout
register: new_tz
+ - name: Restart CronD.
+ become: yes
+ systemd:
+ service: cron
+ status: restarted
+ when: new_tz.changed
+
- hosts: dvrs
tasks:
- name: Restart AgentDVR.
---
-- hosts: core, dvrs, tvrs, webtvs
+- hosts: core, dvrs, tvrs, webtvs, notebooks
tasks:
- name: Get timezone.
command: date '+%Z'
when: ansible_date_time.tz != zone.stdout
register: new_tz
+ - name: Restart CronD.
+ become: yes
+ systemd:
+ service: cron
+ status: restarted
+ when: new_tz.changed
+
- hosts: dvrs
tasks:
- name: Restart AgentDVR.