# Two issue when configuring ansible

**URL:** <https://forum.ansible.com/t/two-issue-when-configuring-ansible/13200>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [July 26, 2013, 6:53am UTC](https://forum.ansible.com/t/two-issue-when-configuring-ansible/13200 "2013-07-26T06:53:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan\_Zhan](https://avatars.discourse-cdn.com/v4/letter/e/3da27b/32.png) [@Ethan\_Zhan](https://forum.ansible.com/u/Ethan_Zhan)\
**Post date:** [July 26, 2013, 6:53am UTC](https://forum.ansible.com/t/two-issue-when-configuring-ansible/13200/1 "2013-07-26T06:53:31Z")

</div>

Hi,

I met two issues when I’m trying to configure my system, could you help take a look ?

1. When I try to get system info by using “-m setup” on some legacy boxes which running RHEL 4 OS on them, the following error occurred.  
I also tried on RHEL 5/6 system are fine by using ansible\_python\_interpreter variable ( ansible version: 1.1/1.2 )

$ ansible -m setup all -i test.list -u root -c ssh  
10.10.10.17 | FAILED =\> failed to parse: Traceback (most recent call last):  
File “/root/.ansible/tmp/ansible-1374817839.87-128978320837516/setup”, line 2419, in   
main()  
File “/root/.ansible/tmp/ansible-1374817839.87-128978320837516/setup”, line 1581, in main  
data = run\_setup(module)  
File “/root/.ansible/tmp/ansible-1374817839.87-128978320837516/setup”, line 1526, in run\_setup  
facts = ansible\_facts()  
File “/root/.ansible/tmp/ansible-1374817839.87-128978320837516/setup”, line 1516, in ansible\_facts  
facts.update(Hardware().populate())  
File “/root/.ansible/tmp/ansible-1374817839.87-128978320837516/setup”, line 421, in populate  
self.get\_device\_facts()  
File “/root/.ansible/tmp/ansible-1374817839.87-128978320837516/setup”, line 548, in get\_device\_facts  
m = re.match(“._?([(._)])”, scheduler)  
File “/usr/local/lib/python2.7/re.py”, line 137, in match  
return \_compile(pattern, flags).match(string)  
TypeError: expected string or buffer

test.list file like below:  
10.10.10.17 ansible\_python\_interpreter=/usr/local/bin/python (python 2.7)

1. When I running ansible-playbook check , service restart handler failed to centos 6 boxes.

$ ansible-playbook -i inventory playbooks/groups/debug.yml --check -vvv

failed: [10.10.10.14] =\> {“failed”: true, “item”: “”, “parsed”: false}  
invalid output was: Traceback (most recent call last):  
File “/root/.ansible/tmp/ansible-1374818751.46-85400547652429/service”, line 1913, in   
main()  
File “/root/.ansible/tmp/ansible-1374818751.46-85400547652429/service”, line 975, in main  
service.get\_service\_status()  
File “/root/.ansible/tmp/ansible-1374818751.46-85400547652429/service”, line 419, in get\_service\_status  
rc, status\_stdout, status\_stderr = self.service\_control()  
File “/root/.ansible/tmp/ansible-1374818751.46-85400547652429/service”, line 550, in service\_control  
rc\_state, stdout, stderr = self.execute\_command(“%s %s %s” % (svc\_cmd, self.action, arguments), daemonize=True)  
File “/root/.ansible/tmp/ansible-1374818751.46-85400547652429/service”, line 220, in execute\_command  
return json.loads(data)  
File “/usr/lib64/python2.6/json/ **init**.py”, line 307, in loads  
return \_default\_decoder.decode(s)  
File “/usr/lib64/python2.6/json/decoder.py”, line 319, in decode  
obj, end = self.raw\_decode(s, idx=\_w(s, 0).end())  
File “/usr/lib64/python2.6/json/decoder.py”, line 338, in raw\_decode  
raise ValueError(“No JSON object could be decoded”)  
ValueError: No JSON object could be decoded

The handler part getting errors when check step to handler “service someapp restart” ,but RHEL 5 OS system return the normal output.

# iptables

- name: restart iptables  
action: service name=iptables state=restarted

Thanks  
Ethan Zhan

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [July 26, 2013, 1:48pm UTC](https://forum.ansible.com/t/two-issue-when-configuring-ansible/13200/2 "2013-07-26T13:48:06Z")

</div>

(A)

Can you please file a github issue for this? I think it should be easy enough to ignore the error condition and keep generating the rest of the facts.

(B)

Haven’t seen this before, the remote OS is CentOS 6?

Can you run the service module locally on the remote machine with ./hacking/test-module -m -a “arguments” to see what output it is producing?

---

<div class="post-metadata">

**Author:** ![Ethan\_Zhan](https://avatars.discourse-cdn.com/v4/letter/e/3da27b/32.png) [@Ethan\_Zhan](https://forum.ansible.com/u/Ethan_Zhan)\
**Post date:** [July 31, 2013, 1:57am UTC](https://forum.ansible.com/t/two-issue-when-configuring-ansible/13200/3 "2013-07-31T01:57:23Z")

</div>

(A) Github issue #3680 for tracking.

(B) Never mind, the culprit was $LANG, it’s fixed, thanks for you help.

Thanks  
Ethan
