[ HELP ] Ansible Module Error [ Parameter format not correct - >nul\r\n ]

3,635 views
Skip to first unread message

Richard Rittu

unread,
Feb 27, 2021, 4:22:25 AM2/27/21
to Ansible Project
Error Part1.pngError Part2.pngHi Team,

Good day,

I am trying to deploy the app to the Windows server from redhat. Actually, it was successfully running for several weeks but Since Yesterday morning I am facing this strange issue after running the playbook.So tried with only win_ping module that also not successful

Error:

ansible-playbook 2.9.17 config file = /root/myteam/stephen/Ansible/DeployApp/ansible.cfg configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible-playbook python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] Using /root/Ansible/DeployAppToServer/ansible.cfg as config file SSH password: host_list declined parsing /root/myteam/stephen/Ansible/DeployApp/ehosts as it did not pass its verify_file() method script declined parsing /root/myteam/stephen/Ansible/DeployApp/ehosts as it did not pass its verify_file() method auto declined parsing /root/myteam/stephen/Ansible/DeployApp/ehosts as it did not pass its verify_file() method Parsed /root/myteam/stephen/Ansible/DeployApp/ehosts inventory source with ini plugin Skipping callback 'actionable', as we already have a stdout callback. Skipping callback 'counter_enabled', as we already have a stdout callback. Skipping callback 'debug', as we already have a stdout callback. Skipping callback 'dense', as we already have a stdout callback. Skipping callback 'dense', as we already have a stdout callback. Skipping callback 'full_skip', as we already have a stdout callback. Skipping callback 'json', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'null', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. Skipping callback 'selective', as we already have a stdout callback. Skipping callback 'skippy', as we already have a stdout callback. Skipping callback 'stderr', as we already have a stdout callback. Skipping callback 'unixy', as we already have a stdout callback. Skipping callback 'yaml', as we already have a stdout callback. PLAYBOOK: test.yml ***************************************************************************************************************************************************** 1 plays in test.yml PLAY [Push App to webserver] ************************************************************************************************************************************** META: ran handlers TASK [Ping Server] ***************************************************************************************************************************************************** task path: /root/myteam/stephen/Ansible/DeployApp/test.yml:7 Using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win_ping.ps1 Pipelining is enabled. <192.168.1.45> ESTABLISH SSH CONNECTION FOR USER: Richard <192.168.1.45> SSH: EXEC sshpass -d10 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="Richard"' -o ConnectTimeout=25 -o ControlPath=/root/.ansible/cp/16376c84cb 192.168.1.45 'chcp.com 65001 >nul 2>&1 && PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARQBuAGMAbwBkAGUAZABDAG8AbQBtAGEAbgBkACAASgBnAEIAagBBAEcAZwBBAFkAdwBCAHcAQQBDADQAQQBZAHcAQgB2AEEARwAwAEEASQBBAEEAMgBBAEQAVQBBAE0AQQBBAHcAQQBEAEUAQQBJAEEAQQArAEEAQwBBAEEASgBBAEIAdQBBAEgAVQBBAGIAQQBCAHMAQQBBAG8AQQBKAEEAQgBsAEEASABnAEEAWgBRAEIAagBBAEYAOABBAGQAdwBCAHkAQQBHAEUAQQBjAEEAQgB3AEEARwBVAEEAYwBnAEIAZgBBAEgATQBBAGQAQQBCAHkAQQBDAEEAQQBQAFEAQQBnAEEAQwBRAEEAYQBRAEIAdQBBAEgAQQBBAGQAUQBCADAAQQBDAEEAQQBmAEEAQQBnAEEARQA4AEEAZABRAEIAMABBAEMAMABBAFUAdwBCADAAQQBIAEkAQQBhAFEAQgB1AEEARwBjAEEAQwBnAEEAawBBAEgATQBBAGMAQQBCAHMAQQBHAGsAQQBkAEEAQgBmAEEASABBAEEAWQBRAEIAe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BAEEAZgBRAEEASwBBAEYATQBBAFoAUQBCADAAQQBDADAAQQBWAGcAQgBoAEEASABJAEEAYQBRAEIAaABBAEcASQBBAGIAQQBCAGwAQQBDAEEAQQBMAFEAQgBPAEEARwBFAEEAYgBRAEIAbABBAEMAQQBBAGEAZwBCAHoAQQBHADgAQQBiAGcAQgBmAEEASABJAEEAWQBRAEIAMwBBAEMAQQBBAEwAUQBCAFcAQQBHAEUAQQBiAEEAQgAxAEEARwBVAEEASQBBAEEAawBBAEgATQBBAGMAQQBCAHMAQQBHAGsAQQBkAEEAQgBmAEEASABBAEEAWQBRAEIAeQBBAEgAUQBBAGMAdwBCAGIAQQBEAEUAQQBYAFEAQQBLAEEAQwBRAEEAWgBRAEIANABBAEcAVQBBAFkAdwBCAGYAQQBIAGMAQQBjAGcAQgBoAEEASABBAEEAYwBBAEIAbABBAEgASQBBAEkAQQBBADkAQQBDAEEAQQBXAHcAQgBUAEEARwBNAEEAYwBnAEIAcABBAEgAQQBBAGQAQQBCAEMAQQBHAHcAQQBiAHcAQgBqAEEARwBzAEEAWABRAEEANgBBAEQAbwBBAFEAdwBCAHkAQQBHAFUAQQBZAFEAQgAwAEEARwBVAEEASwBBAEEAawBBAEgATQBBAGMAQQBCAHMAQQBHAGsAQQBkAEEAQgBmAEEASABBAEEAWQBRAEIAeQBBAEgAUQBBAGMAdwBCAGIAQQBEAEEAQQBYAFEAQQBwAEEAQQBvAEEASgBnAEEAawBBAEcAVQBBAGUAQQBCAGwAQQBHAE0AQQBYAHcAQgAzAEEASABJAEEAWQBRAEIAdwBBAEgAQQBBAFoAUQBCAHkAQQBBAD0APQA=' <192.168.1.45> (1, '', 'Parameter format not correct - >nul\r\n') <192.168.1.45> Failed to connect to the host via ssh: Parameter format not correct - >nul fatal: [192.168.1.45]: FAILED! => { "changed": false, "module_stderr": "Parameter format not correct - >nul\r\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } PLAY RECAP ************************************************************************************************************************************************************* 192.168.1.45 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

What I have checked?

Trying the same playbook with other windows hosts - Successful | Enabled gather facts to true but failed with same error | changed ansible shell type to cmd/PowerShell due to same similar que in internet but unsuccessful.

Specifications:

redhat - ansible 2.9.17 - python 2.7.5 - windows 10

Here is the playbook

- name: Push App to webserver
 hosts: webserver 
 gather_facts: false 

 tasks: 
 - name : Ping Server 
   win_ping: 
    register: ping_out 
     tags: 
           - ping 

     - debug: 
           msg: "{{ ping_out }}"

Attached error log as an attachment due to incorrect formatting. I can't find any information on this error on the internet.

Can you please help folks?

Dick Visser

unread,
Feb 27, 2021, 9:18:36 AM2/27/21
to ansible...@googlegroups.com
What happens when you deploy this to another server? Or an entirely fresh one?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/69aa5f86-86fe-4593-9284-e1585c704952n%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

jbor...@gmail.com

unread,
Feb 28, 2021, 3:54:19 PM2/28/21
to Ansible Project
The error is literally trying to run a syntax that works for cmd.exe but in PowerShell hence the error 'Parameter format not correct - >nul'. The fix for this is to either set ansible_shell_type=powershell or change the default shell back to CMD on your Win32 OpenSSH config. If you've already tried setting the shell type then it may be because the parameter was set in the wrong place. A simple test is to do `ansible ... -e ansible_shell_type=powershell' in the command line.

Richard Rittu

unread,
Feb 28, 2021, 11:46:33 PM2/28/21
to Ansible Project
Hi,

Thanks to both of you for the reply.

Yes, I can deploy to other win hosts.

I have changed ansible_shell_type=powershell and changed Default shell in win server too. Now i am facing this error:

<192.168.1.45> (1, b'', b'Parameter format not correct - >\r\n')
<192.168.1.45> Failed to connect to the host via ssh: Parameter format not correct - >
fatal: [192.168.1.45]: FAILED! => {
    "changed": false,
    "module_stderr": "Parameter format not correct - >\r\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

Any Help would be much appreciated, 
Thanks
Message has been deleted

Richard Rittu

unread,
Mar 1, 2021, 10:44:04 PM3/1/21
to Ansible Project
Hi Team,

According to the logs it was working on 22 of Feb not working on  23.When i checked the win hosts there was this update [KB4593226] was installed on that day will that effect on ansible ??

Updated to latest

ansible : 3.0.0
ansible-base:  2.10.6
python - 3.6.8

Here this group is my last ray of HOPE.
Thanks

Regards,
Richard Rittu

jbor...@gmail.com

unread,
Mar 2, 2021, 2:27:51 PM3/2/21
to Ansible Project
There's not much else we can say, the error you have indicates the shell being used in OpenSSH is cmd so trying to run ansible_shell_type=powershell will cause that failure. Either set it to cmd or work out how to change the DefaultShell for your installation on the Windows host. Ansible needs to know the correct shell so it can format the commands it sends to the host properly.
Message has been deleted

Richard Rittu

unread,
Mar 17, 2021, 2:04:25 AM3/17/21
to Ansible Project
Hi Team,

Tried Installing PowerShell and made it as default shell in win 2016. Still, the error remains the same?

looks like somebody raised a bug in ansible but  they redirected to check in this group 


Any help would be much appreciated.
rr.png

Richard Rittu

unread,
Mar 20, 2021, 7:35:10 AM3/20/21
to ansible...@googlegroups.com
Hi team,

Thanks for your support it seems the openssh7.6 version in windows caused the issue then i updated to latest one, now its working fine.

Hope it helps somebody

Regards,
Richard Rittu

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/quRiK_2WKtE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a7e573f1-b509-4c9d-83d9-90fd8cc6440dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages