Oh, meant to say ansible_hostname and inventory_hostname are documented
here: http://docs.ansible.com/ansible/latest/playbooks_variables.html
On Friday, October 13, 2017 at 8:46:28 AM UTC+1, J Hawkesworth wrote:
>
> For win_find, you can probably use a paths like
>
>paths:
For win_find, you can probably use a paths like
paths: "C:\\Temp\\*{{ansible_hostname}}*"
or if you need to use the hostname as defined in your inventory
paths: "C:\\Temp\\*{{inventory_hostname}}*"
One of the nice things about win_find is it will give you a better
structured set of
Jordan,
The solutions you've provided worked out fine. I ended up using *win_shell*
module simply because I was not able to pass *%computername%* variable in
win_find patterns. I'm a beginner and ready to tackle regex :-)
I really appreciate your help. Also, by any chance the values in
Jordan,
Thanks a million. I was able to get the output I'm looking for. Now that
have the list of files in my C:\Temp, how do I fetch those files to my
ansible controller host? Here's an example I have so far but failing at
one section.
*- hosts: all gather_facts: yes
Hi
The win_shell module actually executes a command in the PowerShell where
dir is an alias for Get-ChildItem. Get-ChildItem (and other PS cmdlets) do
not have parameters or switches in the form of /* which is why you are
getting this error. You can either change your task to use the