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 https://github.com/ansible/ansible/issues/72961 Any help would be much appreciated. [image: rr.png] On Wednesday, March 3, 2021 at 12:57:51 AM UTC+5:30 [email protected] wrote: > 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. > > On Tuesday, March 2, 2021 at 1:44:04 PM UTC+10 Richard Rittu wrote: > >> 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 >> >> On Monday, March 1, 2021 at 10:16:33 AM UTC+5:30 Richard Rittu wrote: >> >>> 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 >>> >>> >>> >>> >>> On Monday, March 1, 2021 at 2:24:19 AM UTC+5:30 [email protected] wrote: >>> >>>> 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. >>>> >>>> On Sunday, February 28, 2021 at 12:18:36 AM UTC+10 [email protected] >>>> wrote: >>>> >>>>> What happens when you deploy this to another server? Or an entirely >>>>> fresh one? >>>>> >>>>> On Sat, 27 Feb 2021 at 10:22, Richard Rittu <[email protected]> >>>>> wrote: >>>>> >>>>>> [image: Error Part1.png][image: Error Part2.png]Hi 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 >>>>>> UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARQBuAG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EIAcABBAEgAQQBBAGQAQQBCAEMAQQBHAHcAQQBiAHcAQgBqAEEARwBzAEEAWABRAEEANgBBAEQAbwBBAFEAdwBCAHkAQQBHAFUAQQBZAFEAQgAwAEEARwBVAEEASwBBAEEAawBBAEgATQBBAGMAQQBCAHMAQQBHAGsAQQBkAEEAQgBmAEEASABBAEEAWQBRAEIAeQBBAEgAUQBBAGMAdwBCAGIAQQBEAEEAQQBYAFEAQQBwAEEAQQBvAEEASgBnAEEAawBBAEcAVQBBAGUAQQBCAGwAQQBHAE0AQQBYAHcAQgAzAEEASABJAEEAWQBRAEIAdwBBAEgAQQBBAFoAUQBCAHkAQQBBAD0APQA=' >>>>>> >>>>>> <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? >>>>>> >>>>>> -- >>>>>> 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 [email protected]. >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/ansible-project/69aa5f86-86fe-4593-9284-e1585c704952n%40googlegroups.com >>>>>> >>>>>> <https://groups.google.com/d/msgid/ansible-project/69aa5f86-86fe-4593-9284-e1585c704952n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> >>>>> -- >>>>> Sent from a mobile device - please excuse the brevity, spelling and >>>>> punctuation. >>>>> >>>> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a7e573f1-b509-4c9d-83d9-90fd8cc6440dn%40googlegroups.com.
