-
Notifications
You must be signed in to change notification settings - Fork 30
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
[Question] How to define multiple assign statements? #226
Comments
I have locally defined this assign_filter:
This results in:
Can you try this? |
Well, that is kinda confusing what the Director does here... Having multiple conditions does work like this
but not with URL-encoding
while with a single condition it doesn't care about the URL encoding
Will try this now with Ansible and the module. If that works without problems as well (which I expect), I'll close the issue. |
Interesting... Though the director-api often has these little quirks.. |
As expected it works via the Ansible module as well, when using the above mentioned first format of the condition. |
Good idea! do you want to create a PR to add an example here? You can check the Contributing Guidelines if you need help. |
Done :) Also added a section to the general read-me. |
fixed in #227 |
Question
Hello :)
First of all, thanks for the great module!
I'd like to ask how to define multiple assign statements so that I end up with something like this:

assign where host.vars.hostgroup == "msd" || host.vars.tags.customer == "msd"
I have tried the following:
assign_filter: "host.vars.hostgroup=%22{{ var_pb_customer_token }}%22%7Chost.vars.tags.customer=%22{{ var_pb_customer_token }}%22"
(also tried with a literal|
,or
and||
)which leads to
/** Failed to render this object **/ /* Got invalid JSON in filter string: host.vars.hostgroup="q1au2"|host.vars.tags.customer="q1au2" */
I have also tried the part from the config preview
host.vars.hostgroup == "msd" || host.vars.tags.customer == "msd"
this also leads to
/** Failed to render this object **/ /* Got invalid JSON in filter string:
A single condition like
assign_filter: "host.vars.hostgroup=%22{{ var_pb_customer_token }}%22"
works without problems.If it makes a difference I'm trying to create a host group.
🙋♂️
The text was updated successfully, but these errors were encountered: