ansible-collections / hetzner.hcloud

A collection to manage resources on Hetzner Cloud
https://galaxy.ansible.com/ui/repo/published/hetzner/hcloud
GNU General Public License v3.0
100 stars 35 forks source link

feat(inventory): allow templating instances hostname #455

Closed jooola closed 5 months ago

jooola commented 5 months ago
SUMMARY

Adds a hostname option that allow the user to pass a template to add a prefix or use the hostvars to build the hostname.

For example:

plugin: hetzner.hcloud.hcloud

hostname: "hcloud-{{ location }}-{{ name }}"

OR with a hostvars_prefix:

plugin: hetzner.hcloud.hcloud

hostvars_prefix: hcloud_
hostname: "hcloud-{{ hcloud_location }}-{{ hcloud_name }}"

Fixes #115

ISSUE TYPE
COMPONENT NAME

inventory