shell: ssh {{ ansible_user }}@{{ ansible_host }}  "D:" && cd 
D:\\AMG\\SRM\\{{ kit_name.stdout }}\\ && perl srm_upgrade.pl 
–dw-instance={{dw_instance_1}}

Why do you do the ssh? ansible does that by default. Does your Windows machine 
support ssh? perl?

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Jan 20, 2023, at 8:49 AM, Josmi Jose <jjosmi...@gmail.com> wrote:

Hi,

I am trying to run a run a perl script in the windows server using ansible 
playbook located in linux and getting the below error.Can some one help me.


    "changed": false,
    "module_stderr": "Exception calling \"Create\" with \"1\" argument(s): \"At 
line:4 char:21\r\n+ def _ansiballz_main():\r\n+                     ~\r\nAn 
expression was expected after '('.\r\nAt line:13 char:27\r\n+     except 
(AttributeError, OSError):\r\n+                           ~\r\nMissing argument 
in parameter list.\r\nAt line:15 char:7\r\n+     if scriptdir is not None:\r\n+ 
      ~\r\nMissing '(' after 'if' in if statement.\r\nAt line:22 char:7\r\n+    
 if sys.version_info < (3,):\r\n+       ~\r\nMissing '(' after 'if' in if 
statement.\r\nAt line:22 char:30\r\n+     if sys.version_info < (3,):\r\n+      
                        ~\r\nMissing expression after ','.\r\nAt line:22 
char:25\r\n+     if sys.version_info < (3,):\r\n+                         
~\r\nThe '<' operator is reserved for future use.\r\nAt line:27 char:34\r\n+    
 def invoke_module(modlib_path, temp_path, json_params):\r\n+                   
               ~\r\nMissing argument in parameter list.\r\nAt line:28 
char:40\r\n+         z = zipfile.ZipFile(modlib_path, mode='a')\r\n+            
                            ~\r\nMissing argument in parameter list.\r\nAt 
line:31 char:33\r\n+         zinfo = zipfile.ZipInfo()\r\n+                     
            ~\r\nAn expression was expected after '('.\r\nAt line:34 
char:25\r\n+         z.writestr(zinfo, sitecustomize)\r\n+                      
   ~\r\nMissing argument in parameter list.\r\nNot all parse errors were 
reported.  Correct the reported errors and try again.\"\r\nAt line:6 
char:1\r\n+ $exec_wrapper = [ScriptBlock]::Create($split_parts[0])\r\n+ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo    
      : NotSpecified: (:) [], MethodInvocationException\r\n    + 
FullyQualifiedErrorId : ParseException\r\n \r\nThe expression after '&' in a 
pipeline element produced an object that was not valid. It must result in a 
command name,\r\n a script block, or a CommandInfo object.\r\nAt line:7 
char:2\r\n+ &$exec_wrapper\r\n+  ~~~~~~~~~~~~~\r\n    + CategoryInfo          : 
InvalidOperation: (:) [], RuntimeException\r\n    + FullyQualifiedErrorId : 
BadExpression\r\n ",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

Playbook:

- hosts: SRM

  vars:
      ansible_become_user: '{{ ansible_user }}'
      release_version: "Latest"

  tasks:
   - name: "upgrade DW for {{dw_instance_1}}"
    become: yes
    become_user: Administrator
    shell: ssh {{ ansible_user }}@{{ ansible_host }}  "D:" && cd 
D:\\AMG\\SRM\\{{ kit_name.stdout }}\\ && perl srm_upgrade.pl 
–dw-instance={{dw_instance_1}}

--
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-project+unsubscr...@googlegroups.com<mailto:ansible-project+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5942d897-a7c3-45e9-a8b3-89cb5054c054n%40googlegroups.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F5942d897-a7c3-45e9-a8b3-89cb5054c054n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7Cb1e7755df2144cb86c0308dafaed3c60%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638098194066226908%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OudLdIfoXRxjBZoGlit2qJ54kYwhdKpT5tX9G%2BHiD4M%3D&reserved=0>.

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/904C7A47-029F-456B-B2AF-9798CA8D2234%40nist.gov.

Reply via email to