Hello,
My playbook is failing with a long error:
winrm send_input failed; \nstdout: Unable to initialize device PRN\r\nUnable to initialize device PRN\r\nUnable to initialize device PRN\r\nUnable to initialize device PRN\r\nUnable to initialize device PRN\r\n\nstderr _ANSIBALLZ_WRAPPER : The term ‘_ANSIBALLZ_WRAPPER’ is not recognized as the name of a cmdlet, function, script file, \r\nor operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and \r\ntry again.\r\nAt line:1 char:1\r\n+ _ANSIBALLZ_WRAPPER = True # For test-module script to tell this is a …\r\n+ ~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (ANSIBALLZ_WRAPPER:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nAt line:1 char:21\r\n+ def ansiballz_main():\r\n+ ~\r\nAn expression was expected after ‘(’.\r\n + CategoryInfo : ParserError: ( [], ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId : ExpectedExpression\r\n \r\nimport : The term ‘import’ is not recognized as the name of a cmdlet, function, script file, or operable program. \r\nCheck the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\nAt line:1 char:5\r\n+ import os\r\n+ ~~~~~~\r\n + CategoryInfo : ObjectNotFound: (import:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nimport : The term ‘import’ is not recognized as the name of a cmdlet, function, script file, or operable program. \r\nCheck the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\nAt line:1 char:5\r\n+ import os.path\r\n+ ~~~~~~\r\n + CategoryInfo : ObjectNotFound: (import:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nimport : The term ‘import’ is not recognized as the name of a cmdlet, function, script file, or operable program. \r\nCheck the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\nAt line:1 char:5\r\n+ import sys\r\n+ ~~~~~~\r\n + CategoryInfo : ObjectNotFound: (import:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nimport : The term ‘import’ is not recognized as the name of a cmdlet, function, script file, or operable program. \r\nCheck the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\nAt line:1 char:5\r\n+ import main\r\n+ ~~~~~~\r\n + CategoryInfo : ObjectNotFound: (import:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nscriptdir : The term ‘scriptdir’ is not recognized as the name of a cmdlet, function, script file, or operable \r\nprogram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\nAt line:1 char:5\r\n+ scriptdir = None\r\n+ ~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (scriptdir:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\ntry: : The term ‘try:’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check \r\nthe spelling of the name, or if a path was included, verify that the path is correct and try again.\r\nAt line:1 char:5\r\n+ try:\r\n+ ~~~~\r\n + CategoryInfo : ObjectNotFound: (try::String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\n__main.file : The term ‘main.file’ is not recognized as the name of a cmdlet, function, script file, or \r\noperable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try \r\nagain.\r\nAt line:1 char:54\r\n+ … scriptdir = os.path.dirname(os.path.realpath(main.file))\r\n+ ~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (main.file:String)
I understand from a previous post that this may have something to do with Ansible expecting a python script but getting a powershell script instead. I am executing a role which is as follows:-
-
name: Ensure that the temporary unpacking area is there
file:
path: “{{ package_install_home }}”
state: directory
recurse: yes -
name: Get the package from the artifactory and install it
include_tasks: Windows_Get_And_Install_MSI.yml
with_items: “{{ lookup(‘dict’, artifacts) }}” -
name: Copy the powershell script to the remote system
win_copy:
src: files/ModifyPath.ps1
dest: “{{ package_install_home }}” -
name: Modify the system path so that perl.exe is visible
win_command: “powershell.exe {{ package_install_home }}\ModifyPath.ps1”
Can anyone help?
Kind Regards
Chris.