We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5837ae4 commit 2575ed1Copy full SHA for 2575ed1
roles/locales/tasks/main.yml
@@ -56,6 +56,12 @@
56
label: "{{ item.line }}"
57
when: ansible_os_family == "Debian"
58
59
+ - name: Check that the /etc/locale.conf exists
60
+ stat:
61
+ path: /etc/locale.conf
62
+ register: locale_conf
63
+ when: ansible_os_family == "RedHat"
64
+
65
- name: Set locale "{{ locale }}" into /etc/locale.conf
66
lineinfile:
67
dest: "/etc/locale.conf"
@@ -69,7 +75,7 @@
69
75
- {regexp: '^LC_ALL=', line: 'LC_ALL={{ locale }}'}
70
76
loop_control:
71
77
72
- when: ansible_os_family == "RedHat"
78
+ when: ansible_os_family == "RedHat" and locale_conf.stat.exists
73
79
74
80
- name: Set locale "{{ locale }}" into /etc/environment
81
0 commit comments