I ran this script multiple times on my windows machine but no use
if i change in my vars to http, it is giving very big error
[nchitturi@sjc04d1shdwb51 ansible-windows]$ ansible-playbook
windows_ping.yaml -i inventory.txt
PLAY [ping test]
**********************************************************************************************************************************************
TASK [Gathering Facts]
****************************************************************************************************************************************
ok: [servername]
TASK [ping test]
**********************************************************************************************************************************************
[WARNING]: FATAL ERROR DURING FILE TRANSFER:
fatal: [SJC04D1SHDWB01.SDLC.TESLAMOTORS.COM]: FAILED! => {"msg": "winrm
send_input failed; \nstdout: Unable 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, 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:1\r\n+ ANSIBALLZ_WRAPPER =
True # For test-module script to tell this is a A ...\r\n+
~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound:
(ANSIBALLZ_WRAPPER: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:1\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:1\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:1\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:1\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:1\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:1\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:50\r\n+ scriptdir =
os.path.dirname(os.path.realpath(__main__.__file__))\r\n+
~~~~~~~~~~~~~~~~~\r\n + CategoryInfo
: ObjectNotFound: (__main__.__file__:String) [],
CommandNotFoundException\r\n + FullyQualifiedErrorId :
CommandNotFoundException\r\n \r\nAt line:1 char:23\r\n+ except
(AttributeError, OSError):\r\n+ ~\r\nMissing argument
in parameter list.\r\n + CategoryInfo : ParserError: (:) [],
ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId :
MissingArgument\r\n \r\npass : The term 'pass' 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+ pass\r\n+ ~~~~\r\n
+ CategoryInfo : ObjectNotFound: (pass:String) [],
CommandNotFoundException\r\n + FullyQualifiedErrorId :
CommandNotFoundException\r\n \r\nAt line:1 char:3\r\n+ if scriptdir is not
None:\r\n+ ~\r\nMissing '(' after 'if' in if statement.\r\n +
CategoryInfo : ParserError: (:) [],
ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId :
MissingOpenParenthesisInIfStatement\r\n \r\nsys.path : Th
On Tue, Nov 13, 2018 at 3:36 PM lucas.adam.jackson <
[email protected]> wrote:
> It's up to you, depends on the use case. Preferably using https over 5986.
>
> Good script to use for configuring winrm for ansible
>
>
> https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1
>
> You can configure the listener manually if you prefer but script works well
>
>
>
> Sent from my Samsung Galaxy smartphone.
>
> -------- Original message --------
> From: Nk Chitturi <[email protected]>
> Date: 2018-11-13 6:21 PM (GMT-05:00)
> To: [email protected]
> Subject: Re: [ansible-project] Re: Working with Ansible on Windows Hosts
>
> Thanks Lucas, is there any way i can make it listen on port 5986, or can
> we use 5985 to connect.
> but here is from my windows host
> PS H:\> winrm enumerate winrm/config/listener
> Listener [Source="GPO"]
> Address = *
> Transport = HTTP
> Port = 5985
> Hostname
> Enabled = true
> URLPrefix = wsman
> CertificateThumbprint
> ListeningOn = 0.00.000.000, , 127.0.0.1, ::1,
> Listener [Source="Compatibility"]
> Address = *
> Transport = HTTP
> Port = 80
> Hostname
> Enabled = true
> URLPrefix = wsman
> CertificateThumbprint
> ListeningOn = 0.00.000.000, 127.0.0.1, ::1,
> Listener [Source="Compatibility"]
> Address = *
> Transport = HTTPS
> Port = 443
> Hostname = <Servername.domain.com <http://servername.domain.com/>>
> Enabled = true
> URLPrefix = wsman
> CertificateThumbprint
> ListeningOn = 0.00.000.000, 127.0.0.1, ::1,
>
>
> On Tue, Nov 13, 2018 at 2:27 PM lucas.adam.jackson <
> [email protected]> wrote:
>
>> Your problem is you're not listening on port 5986
>>
>>
>>
>> Sent from my Samsung Galaxy smartphone.
>>
>> -------- Original message --------
>> From: Nk Chitturi <[email protected]>
>> Date: 2018-11-13 5:24 PM (GMT-05:00)
>> To: [email protected]
>> Subject: Re: [ansible-project] Re: Working with Ansible on Windows Hosts
>>
>> PS H:\> winrm enumerate winrm/config/listener
>> Listener [Source="GPO"]
>> Address = *
>> Transport = HTTP
>> Port = 5985
>> Hostname
>> Enabled = true
>> URLPrefix = wsman
>> CertificateThumbprint
>> ListeningOn = 0.00.000.000, , 127.0.0.1, ::1,
>> fe80::5efe:10.33.138.118%5, fe80::7008:2200:c50:e8f4%3
>>
>> Listener [Source="Compatibility"]
>> Address = *
>> Transport = HTTP
>> Port = 80
>> Hostname
>> Enabled = true
>> URLPrefix = wsman
>> CertificateThumbprint
>> ListeningOn = 0.00.000.000, 127.0.0.1, ::1,
>> fe80::5efe:10.33.138.118%5, fe80::7008:2200:c50:e8f4%3
>>
>> Listener [Source="Compatibility"]
>> Address = *
>> Transport = HTTPS
>> Port = 443
>> Hostname = <Servername.domain.com>
>> Enabled = true
>> URLPrefix = wsman
>> CertificateThumbprint
>> ListeningOn = 0.00.000.000, 127.0.0.1, ::1,
>> fe80::5efe:10.33.138.118%5, fe80::7008:2200:c50:e8f4%3
>>
>> PS H:\>
>>
>> this is my inbound rules
>> [image: image.png]
>>
>>
>> On Tue, Nov 13, 2018 at 1:56 PM Jordan Borean <[email protected]>
>> wrote:
>>
>>> That either means the Firewall is blocking that port of you have no
>>> HTTPS WinRM listener. To verify what listeners are active you can run
>>> 'winrm enumerate winrm/config/listener' on your Windows host.
>>>
>>> --
>>> 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 post to this group, send email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/4ed3f233-1964-4315-acdb-8806b0e9cbd1%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/4ed3f233-1964-4315-acdb-8806b0e9cbd1%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>>
>>
>>
>> --
>> 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 post to this group, send email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CABdF8S3%2BUrrZFtV4KWd8VAh1oHRgdL0A9ZDVgH8YP%3D-gnBRhOQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CABdF8S3%2BUrrZFtV4KWd8VAh1oHRgdL0A9ZDVgH8YP%3D-gnBRhOQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> 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 post to this group, send email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/5beb4fe2.1c69fb81.d53e2.5d9b%40mx.google.com
>> <https://groups.google.com/d/msgid/ansible-project/5beb4fe2.1c69fb81.d53e2.5d9b%40mx.google.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
>
>
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CABdF8S1GhC8pqRzmetcqNt-ZjcLZOk9MdJZ5GDb_jsD%3D1gDA-Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CABdF8S1GhC8pqRzmetcqNt-ZjcLZOk9MdJZ5GDb_jsD%3D1gDA-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/5beb5fef.1c69fb81.7889c.719b%40mx.google.com
> <https://groups.google.com/d/msgid/ansible-project/5beb5fef.1c69fb81.7889c.719b%40mx.google.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CABdF8S1RFOdQvyktqXGWnNQQRFLRLrkoxD9FbDtGeYc2teFw1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.