[ansible-project] Re: "/bin/sh: 1: powershell: not found\n"

2018-11-11 Thread Jordan Borean
There are a few things wrong with that inventory


   - Change the ansible_ssh_* variables to just ansible_*, e.g. 
   ansible_ssh_port becomes ansible_port and so on
   - You are defining ansible_connection=winrm on the group but then 
   override that with ansible_connection=local on the host var meaning this 
   will run on the Ansible controller
   - You have defined the Windows host as localhost, this is quite rare and 
   I've only really seen it for WSL installations

Try out the following

[win]
windows-hostname

[win:vars]
ansible_user=Administrator
ansible_password=...
ansible_port=5986
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore

This will connect to the host 'windows-hostname' but you can change that to 
an IP address if you wish.

Thanks

Jordan

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/989c589f-131a-4982-a1a7-92314a6afaa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: "/bin/sh: 1: powershell: not found\n"

2018-11-10 Thread Varun Chopra
You're defining localhost under the win hostgroup and setting its 
connection to local.

I think you should look up Ansible guides first. I dont mean any offense.

On Saturday, November 10, 2018 at 6:42:12 PM UTC+5:30, Akshay Kaushik wrote:
>
>
>
> On Saturday, October 27, 2018 at 6:14:04 PM UTC+5:30, Jordan Borean wrote:
>>
>> You are running the module over SSH with the wrong shell plugin. Ensure 
>> this is run with either ‘ansible_connection: winrm’ or ‘ansible_connection: 
>> psrp’ so the PowerShell modules work properly.
>
>
> Hi,
>
> Sorry for late response. Below is my host file:-
>
> [win]
>
> localhost ansible_connection=local
>
> [win:vars]
> ansible_connection=winrm
> ansible_ssh_port=5986
> ansible_ssh_user=Administrator
> ansible_ssh_pass={{  }}
> ansible_winrm_server_cert_validation=ignore
>
>
> Please see and tell what i am doing wrong.
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/78e8d5d3-2a89-4b64-96e2-315b973f700d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: "/bin/sh: 1: powershell: not found\n"

2018-11-10 Thread Akshay Kaushik


On Saturday, October 27, 2018 at 6:14:04 PM UTC+5:30, Jordan Borean wrote:
>
> You are running the module over SSH with the wrong shell plugin. Ensure 
> this is run with either ‘ansible_connection: winrm’ or ‘ansible_connection: 
> psrp’ so the PowerShell modules work properly.


Hi,

Sorry for late response. Below is my host file:-

[win]

localhost ansible_connection=local

[win:vars]
ansible_connection=winrm
ansible_ssh_port=5986
ansible_ssh_user=Administrator
ansible_ssh_pass={{  }}
ansible_winrm_server_cert_validation=ignore


Please see and tell what i am doing wrong.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/86e66106-a516-48be-ab21-b42d0d5c08c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: "/bin/sh: 1: powershell: not found\n"

2018-10-27 Thread Jordan Borean
You are running the module over SSH with the wrong shell plugin. Ensure this is 
run with either ‘ansible_connection: winrm’ or ‘ansible_connection: psrp’ so 
the PowerShell modules work properly.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1997c5a3-8c71-4ccb-8d7e-788f3c687e03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: "/bin/sh: 1: powershell: not found\n"

2018-10-26 Thread Akshay Kaushik


On Wednesday, April 25, 2018 at 4:31:05 PM UTC+5:30, ali.k...@aurea.com 
wrote:
>
> i have a simple ansible playbook that i am using to configure some windows 
> machines.  i am getting the following error.  i have installed powershell.  
> is it the bash shell that is complaining? winrm is configured fine and i 
> have tested it as well.  i'll really appreciate any help with this.
>
> $ ansible-playbook -i winhosts awsenvcfgtest.yml
>
> PLAY [infrastructure setup] 
> 
>
> TASK [ec2] 
> *
> ok: [localhost]
>
> TASK [add hosts to group] 
> **
> changed: [localhost]
>
> TASK [win_domain] 
> **
> fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": 
> "/bin/sh: 1: powershell: not found\n", "module_stdout": "", "msg": "MODULE 
> FAILURE", "rc": 127}
>
> PLAY RECAP 
> *
> localhost  : ok=2changed=1unreachable=0failed=1
>
>

Hi All,

Can anyone help to sort this.I am trying to achieve the installation of a 
software to a windows instance at provisiong time. Software is deploy but 
not installed.Below i got the error when running the playbook:-

 PLAY [localhost] 
> ***
>
> TASK [ensure instances are running] 
> 
> changed: [localhost]
>
> TASK [ensure Automation_Anywhere_Enterprise_Client is installed via 
> win_package] 
> ***
> fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": 
> "/bin/sh: powershell: command not found\n", "module_stdout": "", "msg": 
> "MODULE FAILURE", "rc": 127}
> to retry, use: --limit @/root/awswinins.retry
>
> PLAY RECAP 
> *
> localhost  : ok=1changed=1unreachable=0failed=1
>
>

- hosts: localhost
  gather_facts: no
  vars:
target_aws_region: "us-east-1"
  vars_files:
 - secret.yml

  tasks:
  - name: ensure instances are running
ec2:
  aws_access_key: " "
  aws_secret_key: " "
  key_name: " "
  region: " "
  image: "ami-050202fb72f001b47"
  instance_type: t2.micro
  group_id: "sg-00cfe7b7ee9a5aea8"
  wait: yes
  wait_timeout: 500
  exact_count: 1
  vpc_subnet_id: " "
  instance_profile_name: " "
  count_tag:
Name: win-ami
  instance_tags:
Name: win-ami
  user_data: "{{ lookup('template', 'userdata.txt.j2') }}"
register: ec2_result

  - name: ensure Automation_Anywhere_Enterprise_Client is installed via 
win_package
win_package:
  path: C:\Windows\Temp\Automation_Anywhere_Enterprise_Client_10.7.0.exe
  product_id: Autmation_Anywhere_Enterprise_Client
  state: present 


Thanks and Regards,
Akshay Kaushik

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/79f78ab5-5ac0-40f2-80f7-66c99e733782%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.