damhau / infoblox

0 stars 2 forks source link

Create host next_available IP address #1

Open Tomelin opened 5 years ago

Tomelin commented 5 years ago

Hi dear,

How create host with next_available IP address ? But code is need information ip address.

Tomelin commented 5 years ago

Hi replace your template create_host.json.j2, with content:

`{ "name":"{{infoblox_name}}", {% if infoblox_view is defined %}"view":"{{infoblox_view}}",{% endif %} {% if infoblox_comment is defined %}"comment":"{{infoblox_comment}}",{% endif %} "ipv4addrs":[ { {% if infoblox_ipv4addr is defined %} "ipv4addr":"{{infoblox_ipv4addr}}" {% if infoblox_mac is defined %} , "mac":"{{infoblox_mac}}" {% endif %}

     **{% elif infoblox_network is defined %}
        "ipv4addr":"func:nextavailableip:{{infoblox_network}}"**
     {% endif %}
  }
]

} `