hcloud plugin - working with dynamic inventory

8 views
Skip to first unread message

Alexey Lesovsky

unread,
Aug 24, 2019, 6:36:06 AM8/24/19
to Ansible Project
Hi,

Trying to create a dynamic inventory using hcloud plugin and have some issues.
Hetzner servers might have user-defined labels and I'm trying to define servers into groups using labels. 

As I can see my test server has labels:
$ hcloud server list -o columns=name,status,labels
NAME STATUS LABELS
node1 running group=common

Next using the following yml.
plugin: hcloud
groups:
  common: "'common' in labels"

But  ansible-inventory doesn't place host into defined group:
$ ansible-inventory -i inventory_hcloud.yml --graph
@all:
 |--@hcloud:
 |  |--node1
 |--@ungrouped:


Even more, when I modify expression to 'labels is not defined', my host is placed into the group and I suspect that module loss labels.

Is it a bug, or wrong yml? Any help appreciated.



Reply all
Reply to author
Forward
0 new messages