mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
split out TZ to 2-common
This commit is contained in:
parent
ae5a8e9896
commit
13f156c21d
2 changed files with 20 additions and 4 deletions
|
@ -32,10 +32,6 @@
|
||||||
- sysctl: name=net.ipv6.conf.default.disable_ipv6 value=1 state=present
|
- sysctl: name=net.ipv6.conf.default.disable_ipv6 value=1 state=present
|
||||||
- sysctl: name=net.ipv6.conf.lo.disable_ipv6 value=1 state=present
|
- sysctl: name=net.ipv6.conf.lo.disable_ipv6 value=1 state=present
|
||||||
|
|
||||||
- name: Set default Time Zone
|
|
||||||
shell: ln -sf /usr/share/zoneinfo/{{ iiab_TZ }} /etc/localtime
|
|
||||||
when: iiab_TZ is defined and iiab_TZ != ""
|
|
||||||
|
|
||||||
- name: Install custom profile file
|
- name: Install custom profile file
|
||||||
template: dest=/etc/profile.d/zzz_iiab.sh
|
template: dest=/etc/profile.d/zzz_iiab.sh
|
||||||
src=zzz_iiab.sh
|
src=zzz_iiab.sh
|
||||||
|
|
20
roles/2-common/tasks/tz.yml
Normal file
20
roles/2-common/tasks/tz.yml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
- name: Check if the TZ is not already set - Can Fail
|
||||||
|
shell: readlink /etc/localtime | awk -F "zoneinfo/" '{print $2}'
|
||||||
|
register: TZ_set
|
||||||
|
ignore_errors: True
|
||||||
|
|
||||||
|
- name: Set to UTC if the TZ is not set already set
|
||||||
|
set_fact: local_tz='UTC' iiab_TZ='UTC'
|
||||||
|
when: TZ_set.stdout == ""
|
||||||
|
|
||||||
|
- name: Set default Timezone - Debian
|
||||||
|
shell: timedatectl set-timezone {{ iiab_TZ }}
|
||||||
|
when: is_debuntu and iiab_TZ is defined and iiab_TZ != "" and iiab_TZ != "TZ_set.stdout"
|
||||||
|
|
||||||
|
- name: Set default Timezone - Redhat
|
||||||
|
shell: ln -sf /usr/share/zoneinfo/{{ iiab_TZ }} /etc/localtime
|
||||||
|
when: is_redhat and iiab_TZ is defined and iiab_TZ != "" and iiab_TZ != "TZ_set.stdout"
|
||||||
|
|
||||||
|
- name: override ansible on timezone
|
||||||
|
set_fact: local_tz=TZ_set.stdout
|
||||||
|
when: TZ_set.stdout != ""
|
Loading…
Add table
Add a link
Reference in a new issue