base: Set LC_TIME correctly to get 24h clock
This commit is contained in:
parent
c08a8158f7
commit
1b9b9962a7
1 changed files with 21 additions and 0 deletions
|
@ -124,6 +124,27 @@
|
|||
dest: /etc/GREP_COLORS
|
||||
state: absent
|
||||
|
||||
- name: Check date format
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
set -o pipefail
|
||||
localectl status | grep -E '^\s+LC_TIME=C.UTF-8$'
|
||||
executable: /bin/bash
|
||||
register: locale_check
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
check_mode: false
|
||||
|
||||
- name: Set date format to use 24 hour clock
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- localectl
|
||||
- set-locale
|
||||
- LC_TIME=C.UTF-8
|
||||
register: result
|
||||
changed_when: result.rc == 0
|
||||
when: locale_check.rc != 0
|
||||
|
||||
- name: Store date and time for bash history
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/profile.d/history.sh
|
||||
|
|
Loading…
Add table
Reference in a new issue