mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* Fix UbuntuMode
* Fix indentation
* Create 5281-locale_gen.yaml
* Update and rename 5281-locale_gen.yaml to 5282-locale_gen.yaml
* apply suggested changes
* apply suggested change
(cherry picked from commit fb1cf91ebd
)
Co-authored-by: Bartosz-lab <73119351+Bartosz-lab@users.noreply.github.com>
This commit is contained in:
parent
b165337bbe
commit
f9fecf12e7
2 changed files with 8 additions and 6 deletions
2
changelogs/fragments/5282-locale_gen.yaml
Normal file
2
changelogs/fragments/5282-locale_gen.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "locale_gen - fix support for Ubuntu (https://github.com/ansible-collections/community.general/issues/5281)."
|
|
@ -197,15 +197,15 @@ def main():
|
||||||
name = module.params['name']
|
name = module.params['name']
|
||||||
state = module.params['state']
|
state = module.params['state']
|
||||||
|
|
||||||
if not os.path.exists("/etc/locale.gen"):
|
if not os.path.exists("/var/lib/locales/supported.d/"):
|
||||||
if os.path.exists("/var/lib/locales/supported.d/"):
|
if os.path.exists("/etc/locale.gen"):
|
||||||
# Ubuntu created its own system to manage locales.
|
# We found the common way to manage locales.
|
||||||
ubuntuMode = True
|
ubuntuMode = False
|
||||||
else:
|
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:
|
else:
|
||||||
# We found the common way to manage locales.
|
# Ubuntu created its own system to manage locales.
|
||||||
ubuntuMode = False
|
ubuntuMode = True
|
||||||
|
|
||||||
if not is_available(name, ubuntuMode):
|
if not is_available(name, ubuntuMode):
|
||||||
module.fail_json(msg="The locale you've entered is not available "
|
module.fail_json(msg="The locale you've entered is not available "
|
||||||
|
|
Loading…
Reference in a new issue