- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Lookup for Next Available Network
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2021 01:12 PM
I need to create a lookup for the next available network from a group of four possible aggregate blocks. For example I have four different /24 subnets that I want to lookup and find the next available /28 I can then create. The /28 can be from any of the 4 networks.
vars:
networks:
- 10.0.0.0/24
- 10.0.1.0/24
- 10.0.2.0/24
- 10.0.3.0/24
Solved! Go to Solution.
Re: Lookup for Next Available Network
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2021 01:24 PM - edited 05-13-2021 01:24 PM
Without looking at anything else, trying looping through the 0-255?
0 - 255
10.0.x.0/24
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: Lookup for Next Available Network
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2021 01:27 PM
Get Outlook for iOS
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
Re: Lookup for Next Available Network
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2021 01:45 PM - edited 05-17-2021 01:46 PM
This is what I tried and I'm getting three networks from each subnet but I'm getting an error.
task path: /automation/ansible/gitlab/infoblox_ip_clt_rem/infoblox_rem_client.yml:98
ok: [10.x.x.22] => (item=70) => {
"ansible_facts": {
"trans_lan0": [
"206.201.70.0/28"
]
},
"ansible_loop_var": "item",
"changed": false,
"item": 70
}
ok: [10.x.x.22] => (item=71) => {
"ansible_facts": {
"trans_lan0": [
"206.201.71.64/28"
]
},
"ansible_loop_var": "item",
"changed": false,
"item": 71
}
ok: [10.x.x.22] => (item=72) => {
"ansible_facts": {
"trans_lan0": [
"206.201.72.32/28"
]
},
"ansible_loop_var": "item",
"changed": false,
"item": 72
}
fatal: [10.x.x.22]: FAILED! => {
"msg": "An unhandled exception occurred while running the lookup plugin 'nios_next_network'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Can not find requested number of networks"
Re: Lookup for Next Available Network
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2021 09:38 PM
Hi,
Is this because the last network in the loop has no free /28 blocks to give out?
You could probably try adding the ignore_errors
flag as part of your play.
You can find more information about it here. This is not recommended in production though. You might miss out on actuall error scenarios.
Regards,
Krishna
Re: Lookup for Next Available Network
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2021 05:26 AM
Re: Lookup for Next Available Network
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2021 06:29 AM