-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inventory: supporting annotation_variable
#141
Comments
Hi! I think you should be able to do this with a composed host variable using a filter like See |
How would you do that ?
Or am I mistaken ? (I'll try to test that asap) |
See this example:
|
Yeah but my point is that |
Playbook
Inventory configuration
gives me following output
With this I am able to access the parsed vars with Does that work for you? |
Yes, this works, but I could go around that with |
I see, but does it really hurt to have this level grouping? Instead of maintaining special code for this feature, we use the constructed inventory already provided by Ansible. With regards to that I think it is an acceptable "downside". |
It does not hurt that much but it would certainly be convenient. Looking at the code, I think I can see a way to add it without much more code.
Would you consider a PR implementing this ?
|
Do other inventories apart from the old community.kubevirt inventory have such a feature? I'd like to stick to Ansible conventions if possible. |
Checking for gcp or aws, they don't.
What they do, however, is controlling the prefix of variables:
- https://docs.ansible.com/ansible/latest/collections/google/cloud/gcp_compute_inventory.html#parameter-vars_prefix
- https://docs.ansible.com/ansible/latest/collections/amazon/aws/aws_ec2_inventory.html#parameter-hostvars_prefix
Maybe an alternative to achieve the same purpose would be to have the option to flatten the `vm_annotations` host_var and control the prefix ?
|
Annotations can be added from VMs and VMIs, that's a distinction in KubeVirt. I'm all for customizations and such but I don't think this adds a lot of value. In the end some name has to be chosen anyway. Why make it more complicated than it needs to be? |
SUMMARY
Hi.
The no-longer maintained community.kubevirt.kubevirt supported an
annotation_variable
which contained json to be put in the host_vars of the particular hosts.Is that something you would support ?
I've seen in the code that annotations are translated to the
{prefix}_annotations
host var, but that require post processing to set the actual vars for the host.ISSUE TYPE
The text was updated successfully, but these errors were encountered: