- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Ansible looking up if IP address used
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 06:39 AM - edited 04-05-2024 07:38 AM
Working on a playbook to find one free IP address with nios_next_ip and then use the same address with second octet different in a DR range.
What would be the way to do this? Dont see a similar lookup mentioned.
Re: Ansible looking up if IP address used
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 07:41 AM
Didn't work out well, the next ip only allows to return up to 20 addresses.
Went with a regular lookup of a network and then filter on UNUSED, that returns everything which isn't used.
Comparing the last octet of that list with a list of the other network and doing an intersect in Ansible gets me a list of usable IPs, well the 4th octect which i can use to create the actual IPs.