Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"service: enable=yes/no" with spanish CentOS6 servers is broken #29818

Closed
ansibot opened this issue Sep 12, 2017 · 2 comments
Closed

"service: enable=yes/no" with spanish CentOS6 servers is broken #29818

ansibot opened this issue Sep 12, 2017 · 2 comments
Labels
affects_2.0 This issue/PR affects Ansible v2.0 docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@ansibot
Copy link
Contributor

ansibot commented Sep 12, 2017

From @vicendominguez on 2016-04-14T16:46:43Z

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

service core module

ANSIBLE VERSION
ansible 2.0.1.0 
(but I wouldn't discard other versions)

OS / ENVIRONMENT

CentOS 6.7
(at least)

SUMMARY

On CentOS6 at least, a spanish translator did a bad translating in some error messages returned to the command line by the chkconfig tool which break the "service enable=yes / no" option in Ansible.
It 's not a direct Ansible issue but Ansible is affected.

STEPS TO REPRODUCE
- name: Start myservice and enable it
  service: name=myservice state=started enabled=yes
EXPECTED RESULTS
TASK [role : Start myservice and enable it ] ***********************************************
ok: [myservice]
ACTUAL RESULTS
TASK [role : Start myservice and enable it ] ***********************************************
fatal: [myservice]: FAILED! => {"changed": false, "failed": true, "msg": "service myservice does not support chkconfig"}
WHY

Line https://github.com/ansible/ansible-modules-core/blob/devel/system/service.py#L702 waits a concrete answer to do the regexp but, in Spanish, that line is bad translated changing the "--add" statement to "--añada" (doesn't make sense), so you see something like:

"El servicio myservice soporta chkconfig, pero no está registrado (ejecute \n'chkconfig -- añada myservice')\n"

the sentence "chkconfig --add" doesn't appear there and that breaks the "if". So the "enable" feature is broken.

WORKAROUND

export LANG="en"

in the terminal, before starting to work with any sofware which uses Ansible inside.

Copied from original issue: ansible/ansible-modules-core#3438

@ansibot
Copy link
Contributor Author

ansibot commented Sep 12, 2017

From @ansibot on 2016-04-14T16:46:43Z

@grossws ping, this issue is waiting for your response.
click here for bot help

@ansibot ansibot added the affects_2.0 This issue/PR affects Ansible v2.0 label Sep 12, 2017
@ansibot ansibot added docs_report module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 12, 2017
@ansible ansible deleted a comment from biomassives Sep 12, 2017
@ansible ansible deleted a comment from biomassives Sep 12, 2017
@ansibot ansibot added docs This issue/PR relates to or includes documentation. and removed docs_report labels Mar 1, 2018
@adrianlzt
Copy link
Contributor

service.py should force the locale before checking the stdout/err of the chkconfig command as suggested by the deprecation message in DEFAULT_MODULE_LANG: Modules are coded to set their own locale if needed for screenscraping

adrianlzt pushed a commit to adrianlzt/ansible that referenced this issue Apr 18, 2018
In the particular case of executin "chkconfig --list NAME", ansible
checks the stderr looking for a particular english message.
This message is different in other languages, Spanish for example
(although it have been corrected in the latests versions)

Fixes ansible#29818
bcoca added a commit to bcoca/ansible that referenced this issue Apr 20, 2018
@bcoca bcoca closed this as completed in e7db3c0 Apr 23, 2018
bcoca pushed a commit to bcoca/ansible that referenced this issue Apr 27, 2018
In the particular case of executin "chkconfig --list NAME", ansible
checks the stderr looking for a particular english message.
This message is different in other languages, Spanish for example
(although it have been corrected in the latests versions)

Fixes ansible#29818

(cherry picked from commit e7db3c0)
bcoca pushed a commit that referenced this issue Apr 27, 2018
In the particular case of executin "chkconfig --list NAME", ansible
checks the stderr looking for a particular english message.
This message is different in other languages, Spanish for example
(although it have been corrected in the latests versions)

Fixes #29818

(cherry picked from commit e7db3c0)
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this issue May 14, 2018
In the particular case of executin "chkconfig --list NAME", ansible
checks the stderr looking for a particular english message.
This message is different in other languages, Spanish for example
(although it have been corrected in the latests versions)

Fixes ansible#29818
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this issue May 15, 2018
In the particular case of executin "chkconfig --list NAME", ansible
checks the stderr looking for a particular english message.
This message is different in other languages, Spanish for example
(although it have been corrected in the latests versions)

Fixes ansible#29818
adrianlzt added a commit to adrianlzt/ansible that referenced this issue May 18, 2018
…mmand()

In the last commit I modified the code to run commands when they are
daemonized. But the execution of "chkconfig" is not daemonized so it
uses "self.module.run_command(cmd)".

This commit set the default localize to allow proper screen scraping of
chkconfig command.
bcoca pushed a commit that referenced this issue May 21, 2018
In the last commit I modified the code to run commands when they are
daemonized. But the execution of "chkconfig" is not daemonized so it
uses "self.module.run_command(cmd)".

This commit set the default localize to allow proper screen scraping of
chkconfig command.
achinthagunasekara pushed a commit to achinthagunasekara/ansible that referenced this issue May 23, 2018
…mmand()

In the last commit I modified the code to run commands when they are
daemonized. But the execution of "chkconfig" is not daemonized so it
uses "self.module.run_command(cmd)".

This commit set the default localize to allow proper screen scraping of
chkconfig command.
jacum pushed a commit to jacum/ansible that referenced this issue Jun 26, 2018
…mmand()

In the last commit I modified the code to run commands when they are
daemonized. But the execution of "chkconfig" is not daemonized so it
uses "self.module.run_command(cmd)".

This commit set the default localize to allow proper screen scraping of
chkconfig command.
ilicmilan pushed a commit to ilicmilan/ansible that referenced this issue Nov 7, 2018
In the particular case of executin "chkconfig --list NAME", ansible
checks the stderr looking for a particular english message.
This message is different in other languages, Spanish for example
(although it have been corrected in the latests versions)

Fixes ansible#29818
ilicmilan pushed a commit to ilicmilan/ansible that referenced this issue Nov 7, 2018
…mmand()

In the last commit I modified the code to run commands when they are
daemonized. But the execution of "chkconfig" is not daemonized so it
uses "self.module.run_command(cmd)".

This commit set the default localize to allow proper screen scraping of
chkconfig command.
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.0 This issue/PR affects Ansible v2.0 docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants