[ansible-devel] Re: How to pass ansible variables to powershell cmdlet using win_shell module

2019-06-20 Thread Stefano Leandro
Yes Sir, many thanks. Now, it seems work proprerly: - set_fact: target_ip: '{{ lookup("dig", inventory_hostname) }}' - win_shell: | Get-DHCPServerV4Lease -IPAddress {{ target_ip }} | Add-DhcpServerv4Reservation Il giorno giovedì 20 giugno 2019 13:33:41 UTC-6, Jordan

[ansible-devel] Re: How to pass ansible variables to powershell cmdlet using win_shell module

2019-06-20 Thread Jordan Borean
Your set_fact task is setting 'lookup('dig', inventory_hostname)' as a literal string, you will to use braces so it actually interprets the lookup, e.g. - set_fact: target_ip: '{{ lookup("dig", inventory_hostname) }}' In the future you are better off posting in the Ansible Project mailing