From 741f44b35ed04001fe4f026f96b538405c45de1f Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Thu, 22 Jun 2023 21:07:18 +1200 Subject: [PATCH 1/8] locale_gen: fix --- .../tasks/{locale_gen.yml => basic.yml} | 60 +++++++++---------- .../targets/locale_gen/tasks/main.yml | 2 +- .../targets/locale_gen/vars/main.yml | 6 ++ 3 files changed, 37 insertions(+), 31 deletions(-) rename tests/integration/targets/locale_gen/tasks/{locale_gen.yml => basic.yml} (56%) create mode 100644 tests/integration/targets/locale_gen/vars/main.yml diff --git a/tests/integration/targets/locale_gen/tasks/locale_gen.yml b/tests/integration/targets/locale_gen/tasks/basic.yml similarity index 56% rename from tests/integration/targets/locale_gen/tasks/locale_gen.yml rename to tests/integration/targets/locale_gen/tasks/basic.yml index c6bdcc046b2..8c96d2cec4e 100644 --- a/tests/integration/targets/locale_gen/tasks/locale_gen.yml +++ b/tests/integration/targets/locale_gen/tasks/basic.yml @@ -4,96 +4,96 @@ # SPDX-License-Identifier: GPL-3.0-or-later - name: Is the locale we're going to test against installed? - shell: locale -a | grep pt_BR + command: locale -a register: initial_state ignore_errors: true - name: Make sure the locale is not installed locale_gen: - name: pt_BR + name: "{{ locale_basic }}" state: absent - name: Is the locale present? - shell: locale -a | grep pt_BR + command: locale -a register: cleaned ignore_errors: true - name: Make sure the locale is not present assert: that: - - "cleaned.rc == 1" + - locale_basic not in cleaned.stdout - name: Install the locale locale_gen: - name: pt_BR + name: "{{ locale_basic }}" state: present - register: output + register: output_present - name: Is the locale present? - shell: locale -a | grep pt_BR - register: post_check_output + command: locale -a + register: post_check_output_present ignore_errors: true - name: Make sure the locale is present and we say we installed it assert: that: - - "post_check_output.rc == 0" - - "output.changed" + - locale_basic in post_check_output_present.stdout + - output_present is changed - name: Install the locale a second time locale_gen: - name: pt_BR + name: "{{ locale_basic }}" state: present - register: output + register: output_present_idempotent - name: Is the locale present? - shell: locale -a | grep pt_BR - register: post_check_output + command: locale -a + register: post_check_output_present_idempotent ignore_errors: true - name: Make sure the locale is present and we reported no change assert: that: - - "post_check_output.rc == 0" - - "not output.changed" + - locale_basic in post_check_output_present_idempotent.stdout + - output_present_idempotent is not changed - name: Remove the locale locale_gen: - name: pt_BR + name: "{{ locale_basic }}" state: absent - register: output + register: output_absent - name: Is the locale present? - shell: locale -a | grep pt_BR - register: post_check_output + command: locale -a + register: post_check_output_absent ignore_errors: true - name: Make sure the locale is absent and we reported a change assert: that: - - "post_check_output.rc == 1" - - "output.changed" + - locale_basic not in post_check_output_absent.stdout + - output_absent is changed - name: Remove the locale a second time locale_gen: - name: pt_BR + name: "{{ locale_basic }}" state: absent - register: output + register: output_absent_idempotent - name: Is the locale present? - shell: locale -a | grep pt_BR - register: post_check_output + command: locale -a + register: post_check_output_absent_idempotent ignore_errors: true - name: Make sure the locale is absent and we reported no change assert: that: - - "post_check_output.rc == 1" - - "not output.changed" + - locale_basic not in post_check_output_absent_idempotent.stdout + - output_absent_idempotent is not changed # Cleanup - name: Reinstall the locale we tested against if it was initially installed locale_gen: - name: pt_BR + name: "{{ locale_basic }}" state: present - when: initial_state.rc == 0 + when: locale_basic in initial_state.stdout diff --git a/tests/integration/targets/locale_gen/tasks/main.yml b/tests/integration/targets/locale_gen/tasks/main.yml index de3e673beb0..deb2eb35e39 100644 --- a/tests/integration/targets/locale_gen/tasks/main.yml +++ b/tests/integration/targets/locale_gen/tasks/main.yml @@ -8,5 +8,5 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -- include_tasks: 'locale_gen.yml' +- include_tasks: 'basic.yml' when: ansible_distribution in ('Ubuntu', 'Debian') diff --git a/tests/integration/targets/locale_gen/vars/main.yml b/tests/integration/targets/locale_gen/vars/main.yml new file mode 100644 index 00000000000..f85fbf87a93 --- /dev/null +++ b/tests/integration/targets/locale_gen/vars/main.yml @@ -0,0 +1,6 @@ +--- +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +locale_basic: pt_BR From 4b70d3f81b3598e9bbb4a57692093498af3b7212 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Sat, 24 Jun 2023 10:33:01 +1200 Subject: [PATCH 2/8] test working with C.UTF-8 --- plugins/modules/locale_gen.py | 20 +--- tests/integration/targets/locale_gen/aliases | 2 + .../targets/locale_gen/tasks/basic.yml | 109 +++++++++--------- .../targets/locale_gen/tasks/main.yml | 10 +- .../targets/locale_gen/vars/main.yml | 10 +- 5 files changed, 78 insertions(+), 73 deletions(-) diff --git a/plugins/modules/locale_gen.py b/plugins/modules/locale_gen.py index fccdf977a48..45befafd211 100644 --- a/plugins/modules/locale_gen.py +++ b/plugins/modules/locale_gen.py @@ -75,10 +75,10 @@ def is_available(name, ubuntuMode): * if the locale is present in /etc/locales.gen * or if the locale is present in /usr/share/i18n/SUPPORTED""" if ubuntuMode: - __regexp = r'^(?P\S+_\S+) (?P\S+)\s*$' + __regexp = r'^(?P\S+[\._]\S+) (?P\S+)\s*$' __locales_available = '/usr/share/i18n/SUPPORTED' else: - __regexp = r'^#{0,1}\s*(?P\S+_\S+) (?P\S+)\s*$' + __regexp = r'^#?\s*(?P\S+[\._]\S+) (?P\S+)\s*$' __locales_available = '/etc/locale.gen' re_compiled = re.compile(__regexp) @@ -106,20 +106,6 @@ def fix_case(name): return name -def replace_line(existing_line, new_line): - """Replaces lines in /etc/locale.gen""" - try: - f = open("/etc/locale.gen", "r") - lines = [line.replace(existing_line, new_line) for line in f] - finally: - f.close() - try: - f = open("/etc/locale.gen", "w") - f.write("".join(lines)) - finally: - f.close() - - def set_locale(name, enabled=True): """ Sets the state of the locale. Defaults to enabled. """ search_string = r'#{0,1}\s*%s (?P.+)' % name @@ -209,7 +195,7 @@ def main(): # We found the common way to manage locales. ubuntuMode = False else: - module.fail_json(msg="/etc/locale.gen and /var/lib/locales/supported.d/local are missing. Is the package \"locales\" installed?") + module.fail_json(msg="/etc/locale.gen and /var/lib/locales/supported.d/local are missing. Is the package 'locales' installed?") else: # Ubuntu created its own system to manage locales. ubuntuMode = True diff --git a/tests/integration/targets/locale_gen/aliases b/tests/integration/targets/locale_gen/aliases index f7f4063f6cb..a5d3e27f9ee 100644 --- a/tests/integration/targets/locale_gen/aliases +++ b/tests/integration/targets/locale_gen/aliases @@ -6,3 +6,5 @@ azp/posix/3 destructive needs/root skip/aix +skip/freebsd +skip/macos diff --git a/tests/integration/targets/locale_gen/tasks/basic.yml b/tests/integration/targets/locale_gen/tasks/basic.yml index 8c96d2cec4e..8f4258c1559 100644 --- a/tests/integration/targets/locale_gen/tasks/basic.yml +++ b/tests/integration/targets/locale_gen/tasks/basic.yml @@ -3,97 +3,100 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -- name: Is the locale we're going to test against installed? +- name: Is the locale we're going to test against installed? {{ locale_basic.localegen }} command: locale -a register: initial_state ignore_errors: true -- name: Make sure the locale is not installed +- name: Make sure the locale is not installed {{ locale_basic.localegen }} locale_gen: - name: "{{ locale_basic }}" + name: "{{ locale_basic.localegen }}" state: absent -- name: Is the locale present? +- name: Is the locale present? {{ locale_basic.localegen }} command: locale -a register: cleaned ignore_errors: true -- name: Make sure the locale is not present +- name: Make sure the locale is not present {{ locale_basic.localegen }} assert: that: - - locale_basic not in cleaned.stdout + - locale_basic.skip_removal or locale_basic.locale not in cleaned.stdout -- name: Install the locale +- name: Install the locale {{ locale_basic.localegen }} locale_gen: - name: "{{ locale_basic }}" + name: "{{ locale_basic.localegen }}" state: present register: output_present -- name: Is the locale present? +- name: Is the locale present? {{ locale_basic.localegen }} command: locale -a register: post_check_output_present ignore_errors: true -- name: Make sure the locale is present and we say we installed it +- name: Make sure the locale is present and we say we installed it {{ locale_basic.localegen }} assert: that: - - locale_basic in post_check_output_present.stdout - - output_present is changed + - locale_basic.locale in post_check_output_present.stdout + - locale_basic.skip_removal or output_present is changed -- name: Install the locale a second time +- name: Install the locale a second time {{ locale_basic.localegen }} locale_gen: - name: "{{ locale_basic }}" + name: "{{ locale_basic.localegen }}" state: present register: output_present_idempotent -- name: Is the locale present? +- name: Is the locale present? {{ locale_basic.localegen }} command: locale -a register: post_check_output_present_idempotent ignore_errors: true -- name: Make sure the locale is present and we reported no change +- name: Make sure the locale is present and we reported no change {{ locale_basic.localegen }} assert: that: - - locale_basic in post_check_output_present_idempotent.stdout + - locale_basic.locale in post_check_output_present_idempotent.stdout - output_present_idempotent is not changed -- name: Remove the locale - locale_gen: - name: "{{ locale_basic }}" - state: absent - register: output_absent - -- name: Is the locale present? - command: locale -a - register: post_check_output_absent - ignore_errors: true - -- name: Make sure the locale is absent and we reported a change - assert: - that: - - locale_basic not in post_check_output_absent.stdout - - output_absent is changed - -- name: Remove the locale a second time - locale_gen: - name: "{{ locale_basic }}" - state: absent - register: output_absent_idempotent - -- name: Is the locale present? - command: locale -a - register: post_check_output_absent_idempotent - ignore_errors: true - -- name: Make sure the locale is absent and we reported no change - assert: - that: - - locale_basic not in post_check_output_absent_idempotent.stdout - - output_absent_idempotent is not changed +- name: Removals + when: locale_basic.skip_removal is false + block: + - name: Remove the locale {{ locale_basic.localegen }} + locale_gen: + name: "{{ locale_basic.localegen }}" + state: absent + register: output_absent + + - name: Is the locale present? {{ locale_basic.localegen }} + command: locale -a + register: post_check_output_absent + ignore_errors: true + + - name: Make sure the locale is absent and we reported a change {{ locale_basic.localegen }} + assert: + that: + - locale_basic.locale not in post_check_output_absent.stdout + - output_absent is changed + + - name: Remove the locale a second time {{ locale_basic.localegen }} + locale_gen: + name: "{{ locale_basic.localegen }}" + state: absent + register: output_absent_idempotent + + - name: Is the locale present? {{ locale_basic.localegen }} + command: locale -a + register: post_check_output_absent_idempotent + ignore_errors: true + + - name: Make sure the locale is absent and we reported no change {{ locale_basic.localegen }} + assert: + that: + - locale_basic.locale not in post_check_output_absent_idempotent.stdout + - output_absent_idempotent is not changed # Cleanup -- name: Reinstall the locale we tested against if it was initially installed +- name: Reinstall the locale we tested against if it was initially installed {{ locale_basic.localegen }} locale_gen: - name: "{{ locale_basic }}" + name: "{{ locale_basic.localegen }}" state: present - when: locale_basic in initial_state.stdout + when: locale_basic.locale in initial_state.stdout diff --git a/tests/integration/targets/locale_gen/tasks/main.yml b/tests/integration/targets/locale_gen/tasks/main.yml index deb2eb35e39..3202ca4e508 100644 --- a/tests/integration/targets/locale_gen/tasks/main.yml +++ b/tests/integration/targets/locale_gen/tasks/main.yml @@ -8,5 +8,11 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -- include_tasks: 'basic.yml' - when: ansible_distribution in ('Ubuntu', 'Debian') +- name: Bail out if not supported + ansible.builtin.meta: end_play + when: ansible_distribution not in ('Ubuntu', 'Debian', 'Gentoo') + +- include_tasks: basic.yml + loop: "{{ locale_list_basic }}" + loop_control: + loop_var: locale_basic diff --git a/tests/integration/targets/locale_gen/vars/main.yml b/tests/integration/targets/locale_gen/vars/main.yml index f85fbf87a93..6fb87e0338f 100644 --- a/tests/integration/targets/locale_gen/vars/main.yml +++ b/tests/integration/targets/locale_gen/vars/main.yml @@ -3,4 +3,12 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -locale_basic: pt_BR +# locale_basic: pt_BR + +locale_list_basic: + - localegen: pt_BR + locale: pt_BR + skip_removal: false + - localegen: C.UTF-8 + locale: C.utf8 + skip_removal: true From c5caa625e62a8e984674cf15b2230a2a5275ba29 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Sat, 24 Jun 2023 18:16:00 +1200 Subject: [PATCH 3/8] working with locale eo --- plugins/modules/locale_gen.py | 3 +-- tests/integration/targets/locale_gen/tasks/main.yml | 2 +- tests/integration/targets/locale_gen/vars/main.yml | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/modules/locale_gen.py b/plugins/modules/locale_gen.py index 45befafd211..6a7d756009e 100644 --- a/plugins/modules/locale_gen.py +++ b/plugins/modules/locale_gen.py @@ -74,11 +74,10 @@ def is_available(name, ubuntuMode): checking either : * if the locale is present in /etc/locales.gen * or if the locale is present in /usr/share/i18n/SUPPORTED""" + __regexp = r'^#?\s*(?P\S+[\._\S]*) (?P\S+)\s*$' if ubuntuMode: - __regexp = r'^(?P\S+[\._]\S+) (?P\S+)\s*$' __locales_available = '/usr/share/i18n/SUPPORTED' else: - __regexp = r'^#?\s*(?P\S+[\._]\S+) (?P\S+)\s*$' __locales_available = '/etc/locale.gen' re_compiled = re.compile(__regexp) diff --git a/tests/integration/targets/locale_gen/tasks/main.yml b/tests/integration/targets/locale_gen/tasks/main.yml index 3202ca4e508..2d9dfcee04d 100644 --- a/tests/integration/targets/locale_gen/tasks/main.yml +++ b/tests/integration/targets/locale_gen/tasks/main.yml @@ -10,7 +10,7 @@ - name: Bail out if not supported ansible.builtin.meta: end_play - when: ansible_distribution not in ('Ubuntu', 'Debian', 'Gentoo') + when: ansible_distribution not in ('Ubuntu', 'Debian') - include_tasks: basic.yml loop: "{{ locale_list_basic }}" diff --git a/tests/integration/targets/locale_gen/vars/main.yml b/tests/integration/targets/locale_gen/vars/main.yml index 6fb87e0338f..fc5b1ece1e7 100644 --- a/tests/integration/targets/locale_gen/vars/main.yml +++ b/tests/integration/targets/locale_gen/vars/main.yml @@ -12,3 +12,6 @@ locale_list_basic: - localegen: C.UTF-8 locale: C.utf8 skip_removal: true + - localegen: eo + locale: eo + skip_removal: false From 88f48245883ecf7e56d8f2ff860701901d71d588 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Sun, 25 Jun 2023 08:27:17 +1200 Subject: [PATCH 4/8] handle C.UTF-8 edge cases --- plugins/modules/locale_gen.py | 3 ++- tests/integration/targets/locale_gen/tasks/basic.yml | 12 ++++++------ tests/integration/targets/locale_gen/vars/main.yml | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/modules/locale_gen.py b/plugins/modules/locale_gen.py index 6a7d756009e..3295279601f 100644 --- a/plugins/modules/locale_gen.py +++ b/plugins/modules/locale_gen.py @@ -87,7 +87,8 @@ def is_available(name, ubuntuMode): if result and result.group('locale') == name: return True fd.close() - return False + # locale may be installed but not listed in the file, for example C.UTF-8 in some systems + return is_present(name) def is_present(name): diff --git a/tests/integration/targets/locale_gen/tasks/basic.yml b/tests/integration/targets/locale_gen/tasks/basic.yml index 8f4258c1559..2cde2f2376b 100644 --- a/tests/integration/targets/locale_gen/tasks/basic.yml +++ b/tests/integration/targets/locale_gen/tasks/basic.yml @@ -21,7 +21,7 @@ - name: Make sure the locale is not present {{ locale_basic.localegen }} assert: that: - - locale_basic.skip_removal or locale_basic.locale not in cleaned.stdout + - locale_basic.skip_removal or locale_basic.locale | intersect(cleaned.stdout_lines) == [] - name: Install the locale {{ locale_basic.localegen }} locale_gen: @@ -37,7 +37,7 @@ - name: Make sure the locale is present and we say we installed it {{ locale_basic.localegen }} assert: that: - - locale_basic.locale in post_check_output_present.stdout + - locale_basic.locale | intersect(post_check_output_present.stdout_lines) != [] - locale_basic.skip_removal or output_present is changed - name: Install the locale a second time {{ locale_basic.localegen }} @@ -54,7 +54,7 @@ - name: Make sure the locale is present and we reported no change {{ locale_basic.localegen }} assert: that: - - locale_basic.locale in post_check_output_present_idempotent.stdout + - locale_basic.locale | intersect(post_check_output_present_idempotent.stdout_lines) != [] - output_present_idempotent is not changed - name: Removals @@ -74,7 +74,7 @@ - name: Make sure the locale is absent and we reported a change {{ locale_basic.localegen }} assert: that: - - locale_basic.locale not in post_check_output_absent.stdout + - locale_basic.locale | intersect(post_check_output_absent.stdout_lines) == [] - output_absent is changed - name: Remove the locale a second time {{ locale_basic.localegen }} @@ -91,7 +91,7 @@ - name: Make sure the locale is absent and we reported no change {{ locale_basic.localegen }} assert: that: - - locale_basic.locale not in post_check_output_absent_idempotent.stdout + - locale_basic.locale | intersect(post_check_output_absent_idempotent.stdout_lines) == [] - output_absent_idempotent is not changed # Cleanup @@ -99,4 +99,4 @@ locale_gen: name: "{{ locale_basic.localegen }}" state: present - when: locale_basic.locale in initial_state.stdout + when: locale_basic.locale | intersect(initial_state.stdout_lines) != [] diff --git a/tests/integration/targets/locale_gen/vars/main.yml b/tests/integration/targets/locale_gen/vars/main.yml index fc5b1ece1e7..ac8084296a4 100644 --- a/tests/integration/targets/locale_gen/vars/main.yml +++ b/tests/integration/targets/locale_gen/vars/main.yml @@ -7,11 +7,11 @@ locale_list_basic: - localegen: pt_BR - locale: pt_BR + locale: [pt_BR] skip_removal: false - localegen: C.UTF-8 - locale: C.utf8 + locale: [C.utf8, C.UTF-8] skip_removal: true - localegen: eo - locale: eo + locale: [eo] skip_removal: false From 7f886769ece6936d9aaf61b9ab51bf3f6f948bab Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Sun, 25 Jun 2023 08:47:24 +1200 Subject: [PATCH 5/8] grammatic pedantism --- tests/integration/targets/locale_gen/tasks/basic.yml | 12 ++++++------ tests/integration/targets/locale_gen/vars/main.yml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/integration/targets/locale_gen/tasks/basic.yml b/tests/integration/targets/locale_gen/tasks/basic.yml index 2cde2f2376b..8718e0be8b6 100644 --- a/tests/integration/targets/locale_gen/tasks/basic.yml +++ b/tests/integration/targets/locale_gen/tasks/basic.yml @@ -21,7 +21,7 @@ - name: Make sure the locale is not present {{ locale_basic.localegen }} assert: that: - - locale_basic.skip_removal or locale_basic.locale | intersect(cleaned.stdout_lines) == [] + - locale_basic.skip_removal or locale_basic.locales | intersect(cleaned.stdout_lines) == [] - name: Install the locale {{ locale_basic.localegen }} locale_gen: @@ -37,7 +37,7 @@ - name: Make sure the locale is present and we say we installed it {{ locale_basic.localegen }} assert: that: - - locale_basic.locale | intersect(post_check_output_present.stdout_lines) != [] + - locale_basic.locales | intersect(post_check_output_present.stdout_lines) != [] - locale_basic.skip_removal or output_present is changed - name: Install the locale a second time {{ locale_basic.localegen }} @@ -54,7 +54,7 @@ - name: Make sure the locale is present and we reported no change {{ locale_basic.localegen }} assert: that: - - locale_basic.locale | intersect(post_check_output_present_idempotent.stdout_lines) != [] + - locale_basic.locales | intersect(post_check_output_present_idempotent.stdout_lines) != [] - output_present_idempotent is not changed - name: Removals @@ -74,7 +74,7 @@ - name: Make sure the locale is absent and we reported a change {{ locale_basic.localegen }} assert: that: - - locale_basic.locale | intersect(post_check_output_absent.stdout_lines) == [] + - locale_basic.locales | intersect(post_check_output_absent.stdout_lines) == [] - output_absent is changed - name: Remove the locale a second time {{ locale_basic.localegen }} @@ -91,7 +91,7 @@ - name: Make sure the locale is absent and we reported no change {{ locale_basic.localegen }} assert: that: - - locale_basic.locale | intersect(post_check_output_absent_idempotent.stdout_lines) == [] + - locale_basic.locales | intersect(post_check_output_absent_idempotent.stdout_lines) == [] - output_absent_idempotent is not changed # Cleanup @@ -99,4 +99,4 @@ locale_gen: name: "{{ locale_basic.localegen }}" state: present - when: locale_basic.locale | intersect(initial_state.stdout_lines) != [] + when: locale_basic.locales | intersect(initial_state.stdout_lines) != [] diff --git a/tests/integration/targets/locale_gen/vars/main.yml b/tests/integration/targets/locale_gen/vars/main.yml index ac8084296a4..44327ddd31e 100644 --- a/tests/integration/targets/locale_gen/vars/main.yml +++ b/tests/integration/targets/locale_gen/vars/main.yml @@ -7,11 +7,11 @@ locale_list_basic: - localegen: pt_BR - locale: [pt_BR] + locales: [pt_BR] skip_removal: false - localegen: C.UTF-8 - locale: [C.utf8, C.UTF-8] + locales: [C.utf8, C.UTF-8] skip_removal: true - localegen: eo - locale: [eo] + locales: [eo] skip_removal: false From 5d8562476923ad100197501890eaea8c6054af48 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Sun, 25 Jun 2023 08:50:44 +1200 Subject: [PATCH 6/8] add changelog frag --- changelogs/fragments/6774-locale-gen-fix.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/6774-locale-gen-fix.yml diff --git a/changelogs/fragments/6774-locale-gen-fix.yml b/changelogs/fragments/6774-locale-gen-fix.yml new file mode 100644 index 00000000000..c7f0b60415d --- /dev/null +++ b/changelogs/fragments/6774-locale-gen-fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - locale_gen - now works for locales without the underscore character such as ``C.UTF-8`` (https://github.com/ansible-collections/community.general/pull/6774, https://github.com/ansible-collections/community.general/issues/5142). From a320c609879b8354992ce76e9eb5a2e9f948068e Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Sun, 25 Jun 2023 13:32:49 +1200 Subject: [PATCH 7/8] add doc about specific OS support --- plugins/modules/locale_gen.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/modules/locale_gen.py b/plugins/modules/locale_gen.py index 3295279601f..36c304ea694 100644 --- a/plugins/modules/locale_gen.py +++ b/plugins/modules/locale_gen.py @@ -35,6 +35,8 @@ - Whether the locale shall be present. choices: [ absent, present ] default: present +notes: + - This module does not support RHEL-based systems. ''' EXAMPLES = ''' From 91707bc43446e9fc1bea6d2eb974083299abd0a6 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky Date: Sun, 25 Jun 2023 13:44:52 +1200 Subject: [PATCH 8/8] update changelog frag --- changelogs/fragments/6774-locale-gen-fix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/6774-locale-gen-fix.yml b/changelogs/fragments/6774-locale-gen-fix.yml index c7f0b60415d..fc71022f067 100644 --- a/changelogs/fragments/6774-locale-gen-fix.yml +++ b/changelogs/fragments/6774-locale-gen-fix.yml @@ -1,2 +1,2 @@ bugfixes: - - locale_gen - now works for locales without the underscore character such as ``C.UTF-8`` (https://github.com/ansible-collections/community.general/pull/6774, https://github.com/ansible-collections/community.general/issues/5142). + - locale_gen - now works for locales without the underscore character such as ``C.UTF-8`` (https://github.com/ansible-collections/community.general/pull/6774, https://github.com/ansible-collections/community.general/issues/5142, https://github.com/ansible-collections/community.general/issues/4305).