-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: enable locale_gen not only for Debian
Signed-off-by: Konstantin Shalygin <k0ste@k0ste.ru>
- Loading branch information
Showing
6 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
changelogs/fragments/9735-locale_gen-use_glibc_ubuntu_mode_only_if_file_exists.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
bugfixes: | ||
- "locale_gen - use ``glibc_ubuntu`` mode only if files for that exists (https://github.com/ansible-collections/community.general/pull/9735)." | ||
- "locale_gen - use ``glibc`` mode only if files for that exists. In other case us ``other_glibc`` mode (https://github.com/ansible-collections/community.general/pull/9735)." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
# 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 | ||
|
||
- name: "Non dnf RedHat systemd are not supported" | ||
ansible.builtin.meta: "end_play" | ||
when: | ||
- "ansible_pkg_mgr == 'yum'" | ||
|
||
- name: "Prepare locale packages" | ||
block: | ||
- name: "Install locale packages for RedHat" | ||
ansible.builtin.dnf: | ||
name: | ||
- "glibc-langpack-pl" | ||
- "glibc-langpack-en" | ||
state: "present" | ||
update_cache: "yes" | ||
when: | ||
- "ansible_os_family == 'RedHat'" | ||
- name: "Install locale packages for Archlinux" | ||
ansible.builtin.dnf: | ||
name: "glibc-locales" | ||
state: "present" | ||
update_cache: "yes" | ||
when: | ||
- "ansible_os_family == 'Archlinux'" | ||
|
||
- name: "Prepare locale.gen file for RedHat or Archlinux" | ||
ansible.builtin.template: | ||
src: "locale_gen.j2" | ||
dest: "/etc/locale.gen" | ||
owner: "root" | ||
group: "root" | ||
mode: "0644" | ||
force: "yes" | ||
|
||
- name: "Check for locale that pack are not installed" | ||
locale_gen: | ||
name: "ansible.UTF-8" | ||
state: "present" | ||
register: "locale_gen_locale_missed_result" | ||
ignore_errors: true | ||
|
||
- name: "Deploy locales" | ||
locale_gen: | ||
name: "{{ item['locale'] + '.' + item['charset'] }}" | ||
state: "present" | ||
loop: "{{ vars['locale_list_simple'] | flatten(levels=1) }}" | ||
loop_control: | ||
label: "{{ 'Deploy locale: ' + item['locale'] }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{# | ||
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 | ||
#} | ||
|
||
{% for l in vars['locale_list_simple'] %} | ||
{{ l['locale'] + '.' + l['charset'] + ' ' + l['charset'] }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters