Let's say you have a variable file on your localhost. We can call it values.txt, and its contents are:
isjwidywiudywdiuwqoq10.110.195.108xxsxww/ed/swqqwfdfwef8.8.8.8
You want to extract only the IP address values from all of this junk. I have made multiple attempts at this using the file lookup and the ipaddr filter. What I'm doing looks like this:
- name: extract IPs only
debug:
msg: "{{ query('file', 'values.txt') | ipaddr }}"
However, this does not work! How can I go about doing this to where I get only the IP's?