Follow up from this specific comment : https://phabricator.wikimedia.org/T346428#9418800
Which came back on the table with : https://phabricator.wikimedia.org/T354893#9551121
We need automation (cookbook, Netbox script or both) to add extra IPs (and their dns_name) to a given host.
I only see benefits :
- Simplify the already complex provisioning process for DCops by asking one less question
- Give autonomy to service owners to add IPs at any time when absolutely required
- Simplify the provisioning automation code by separating this specific function from the core ones
A possible and simple implementation for the v1 could be a Netbox script with a single field Device name.
Once ran, it would take the next available IP on the primary's interface's subnet, and assign it to the same interface with a dns_name set to $device_name-$index.$suffix, where index can be a letter (or even easier, a digit), computed based on number of IPs on the interface.
The user would then need to run the dns cookbook after running the script as many times as they need.
I think that would solve any immediate usecase.
Future evolution could be to :
- add a matching IPv6 address automatically with the option do not add IPv6
- add a field to directly set how many new IPs to configured
If writing a cookbook, it could run the dns cookbook automatically. And either edit Netbox directly or run the cookbook.
Note that the need for such usecase might go away in the medium/long term future : https://phabricator.wikimedia.org/T269328#9437891
Any other "non standard" provisioning should probably have their dedicated automation to not clutter the generic one.