cancel
Showing results for 
Search instead for 
Did you mean: 
ArunRaja
Cadet
Cadet
  • 1,234 Views

Ipaddr filter options

Hi All,

I need a playbook to read the context in a file.

If the file has an  valid IP address it should redirect as output in another file with the valid IP address.

Pls suggest how to use ipaddr filter options to create a playbook

 

 

Labels (1)
0 Kudos
1 Reply
_Komal_
Mission Specialist
Mission Specialist
  • 1,121 Views

Hey,

You can try the Jinga template module for coping and filterring the same.

Facts to get the IP

ip_address = "{{ ansible_default_ipv4.address }}/{{ ansible_default_ipv4.netmask }}" 

 

0 Kudos
Join the discussion
You must log in to join this conversation.