File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 66 tags :
77 - timezone
88
9+ - name : Set the timezone for apt systems
10+ command : timedatectl set-timezone {{ timezone }}
11+ when :
12+ - current_tz.stdout|default("") != timezone
13+ - ansible_distribution_major_version|int >= 20
14+ tags :
15+ - timezone
16+
917- name : Set the timezone in /etc/timezone
1018 copy :
1119 content : " {{ timezone }}"
1422 group : root
1523 mode : 0644
1624 # Default is used below to avoid breaking check mode
17- when : current_tz.stdout|default("") != timezone
25+ when :
26+ - current_tz.stdout|default("") != timezone
27+ - ansible_distribution_major_version|int < 20
1828 register : etc_timezone
1929 tags :
2030 - timezone
2131
2232- name : Inform the OS of the new timezone
2333 command : dpkg-reconfigure --frontend noninteractive tzdata
24- when : etc_timezone is changed
34+ when :
35+ - etc_timezone is changed
36+ - ansible_distribution_major_version|int < 20
2537 tags :
2638 - timezone
2739
Original file line number Diff line number Diff line change 2525- import_tasks : zypper_systems.yml
2626 when : ansible_pkg_mgr == "zypper"
2727
28+ - name : Capture current_clocksource content
29+ shell : " cat /sys/devices/system/clocksource/clocksource0/current_clocksource"
30+ failed_when : false
31+ register : current_clocksource
32+
2833- name : Set the hardware clock
2934 command : hwclock --systohc
35+ # unless system clock is using kvm-clock
36+ when : current_clocksource.stdout.find('kvm-clock') == -1
3037 tags :
3138 - timezone
3239
Original file line number Diff line number Diff line change 2323 name : " {{ pip_version }}"
2424 state : present
2525 enablerepo : epel
26- when : ansible_pkg_mgr == "yum" and ansible_distribution != 'Fedora'
26+ when : (ansible_pkg_mgr == "yum" and ansible_distribution != 'Fedora') or
27+ (ansible_pkg_mgr == "dnf" and ansible_distribution != 'Fedora')
2728
2829- name : Install python-pip on apt based systems.
2930 apt :
You can’t perform that action at this time.
0 commit comments