---
  # Parameters:
  #  prudentia_dir (provided)
  #  tz
  #
  # Example usage:
  #  - include: "{{prudentia_dir}}/tasks/timezone.yml tz={{tz}}"

  - name: Set default timezone
    shell: echo {{tz}} > /etc/timezone
    when: ansible_os_family == "Debian"
    sudo: yes
    tags: timezone

  - name: Reconfigure timezone data
    command: dpkg-reconfigure -f noninteractive tzdata
    when: ansible_os_family == "Debian"
    sudo: yes
    tags: timezone

  - name: Schedule daily NTP update
    cron: name="ntp-update" hour="1" job="/usr/sbin/ntpdate ntp.ubuntu.com pool.ntp.org > /dev/null"
    when: ansible_os_family == "Debian"
    sudo: yes
    tags: timezone

---
  # Parameters:
  #  prudentia_dir (provided)
  #  tz
  #
  # Example usage:
  #  - include: "{{prudentia_dir}}/tasks/timezone.yml tz={{tz}}"

  - name: Set default timezone
    shell: echo {{tz}} > /etc/timezone
    when: ansible_os_family == "Debian"
    sudo: yes
    tags: timezone

  - name: Reconfigure timezone data
    command: dpkg-reconfigure -f noninteractive tzdata
    when: ansible_os_family == "Debian"
    sudo: yes
    tags: timezone

  - name: Schedule daily NTP update
    cron: name="ntp-update" hour="1" job="/usr/sbin/ntpdate pool.ntp.org ntp.ubuntu.com > /dev/null"
    when: ansible_os_family == "Debian"
    sudo: yes
    tags: timezone

Switch first priority to pool.ntp.org as ntp.ubuntu.com is often busy
fix(ntpdate): Switch first priority to pool.ntp.org as ntp.ubuntu.com is often busy
