expose host tags in manifests #152

Closed
opened 2021-11-20 15:20:18 +00:00 by ungleich-gitea · 7 comments

Created by: 4nd3r

something like $__target_tags, which contains all tags assigned to host in inventory.

tried to do it myself, but i really suck at python and ended up with awful hack.

pretty please?

*Created by: 4nd3r* something like `$__target_tags`, which contains all tags assigned to host in inventory. tried to do it myself, but i really suck at python and ended up with awful hack. pretty please?
ungleich-gitea added the
feature
label 2021-11-20 15:20:18 +00:00
Author
Owner

Created by: darko-poljak

@4nd3r Great! :) Then I am closing this issue. If you (or someone else) find some issue then open new one.

*Created by: darko-poljak* @4nd3r Great! :) Then I am closing this issue. If you (or someone else) find some issue then open new one.
Author
Owner

Created by: 4nd3r

ahaa, yes.
i'm already taking advantage of $__target_host_tags in some manifests and no issues so far.

*Created by: 4nd3r* ahaa, yes. i'm already taking advantage of `$__target_host_tags` in some manifests and no issues so far.
Author
Owner

Created by: darko-poljak

@4nd3r Any news on this?

*Created by: darko-poljak* @4nd3r Any news on this?
Author
Owner

Created by: darko-poljak

@4nd3r Since command for adding tags specifies list of tags to be comma separated list of values I exposed the same list in this env var.

OLD_IFS=$IFS
IFS=","
for a in $b
...
IFS=$OLD_IFS
*Created by: darko-poljak* @4nd3r Since command for adding tags specifies list of tags to be comma separated list of values I exposed the same list in this env var. <pre> OLD_IFS=$IFS IFS="," for a in $b ... IFS=$OLD_IFS </pre>
Author
Owner

Created by: 4nd3r

space separated tags would be better imho. for example to loop through them using for a in $b etc.

will test new week, but now wilderness is calling. thanks!

*Created by: 4nd3r* space separated tags would be better imho. for example to loop through them using `for a in $b` etc. will test new week, but now wilderness is calling. thanks!
Author
Owner

Created by: darko-poljak

@4nd3r beta now supports __target_host_tags env var.
It contains comma separated list of target host tags. If host is not present in inventory or has no tags then this var is empty. It is exposed to global explorers, type explorers, initial manifest, type manifest, gencode-*.

Please test it. Please test also configuring host that is not present in inventory and configuring host by its address where host is present in inventory but has no tag.

*Created by: darko-poljak* @4nd3r beta now supports __target_host_tags env var. It contains comma separated list of target host tags. If host is not present in inventory or has no tags then this var is empty. It is exposed to global explorers, type explorers, initial manifest, type manifest, gencode-*. Please test it. Please test also configuring host that is not present in inventory and configuring host by its address where host is present in inventory but has no tag.
Author
Owner

+1!

+1!
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#152
No description provided.