31 lines
735 B
YAML
31 lines
735 B
YAML
---
|
|
- name: Set /etc/timezone
|
|
copy:
|
|
content: |
|
|
{{ timezone_zone }}
|
|
dest: /etc/timezone
|
|
mode: 0644
|
|
owner: root
|
|
group: root
|
|
backup: yes
|
|
|
|
- name: 'Look for /usr/share/zoneinfo/{{ timezone_zone }}'
|
|
stat:
|
|
path: '/usr/share/zoneinfo/{{ timezone_zone }}'
|
|
register: timezone_zoneinfo
|
|
|
|
- name: 'Link /etc/localtime to /usr/share/zoneinfo/{{ timezone_zone }}'
|
|
file:
|
|
src: '/usr/share/zoneinfo/{{ timezone_zone }}'
|
|
dest: /etc/localtime
|
|
state: link
|
|
mode: 0644
|
|
when: timezone_zoneinfo.stat.exists
|
|
|
|
- name: Setup timezone for Alpine Linux
|
|
command:
|
|
cmd: '/sbin/setup-timezone {{ timezone_zone }}'
|
|
creates: '/etc/zoneinfo/{{ timezone_zone }}'
|
|
when: ansible_os_family == "Alpine"
|
|
|