I'm not sure if it can be used from command line but seeing as you are using 2.2 perhaps try https://docs.ansible.com/ansible/win_shell_module.html
On Tuesday, November 29, 2016 at 9:49:58 AM UTC+1, J Hawkesworth wrote: > > What error messages do you see? > > Try running your playbook with -v or -vvvvvv to see variables being set > and command being run. > > On Tuesday, November 29, 2016 at 12:05:36 AM UTC, [email protected] > wrote: >> >> Hi everyone, >> >> My ansible version is : 2.2.0.0 >> >> I make a powershell script to deploy a new VM on vcenter. >> >> Ansible correctly work with windows system but i have some trouble. >> >> I would like ansible take my arguments for the script for each new host >> by the definition hots file in host_vars >> >> But I don't know how to do that. >> >> command line for ansible : >> ansible -i /etc/ansible/windows_prod INTERNAL65 -m script -a >> /etc/ansible/roles/powershell/files/deploy.ps1 >> >> >> /etc/ansible/roles/powershell/files/deploy.ps1 : >> C:\AutoDeploy\final_test.ps1 -VMName TEST-AUTO -Cluster Test -Template >> Windows2012-TMPL -User franck -Password garrot -HostName TEST-AUTO -IPeth0 >> xx.xx.xx.xx -SNMeth0 xx.xx.xx.xx -DNSPeth0 xx.xx.xx.xx -DNSSeth0 xx.xx.xx.xx >> >> I try to change my argument by this method : >> >> in /etc/ansible/roles/powershell/files/deploy.ps1 : >> C:\AutoDeploy\final_test.ps1 -VMName {{ VMName }} -Cluster Test >> -Template Windows2012-TMPL -User franck -Password garrot -HostName {{ >> HostName }} -IPeth0 {{ IPeth0 }} -SNMeth0 {{ SNMeth0 }} -DNSPeth0 {{ >> DNSPeth0 }} -DNSSeth0 {{ DNSSeth0 }} >> >> and in the definition host file i add arguments, for example : >> VMName: TEST-AUTO >> HostName: TEST-AUTO >> ..... >> >> Finally that isn't working. >> >> If someone can help me .... >> >> Best regards. >> > -- 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/0c240117-690e-4c59-970b-0b9053126b26%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
