Open Ardun21 opened 7 years ago
This is a cool idea - please submit a pull request. Thanks.
Hello, It seems that the search_mapping_rule role is not working anymore with ansible 2.8 version. I always get [WARNING]: "register" is not templatable, but we found: {{ search_mapping_rule_register }}, it will not be templated and will be used "as is". When I try to use the variable that I had set for search_mapping_rule_register, it is not defined. This works fine in version 2.6 for example.
I don't find any documentation that register has changed. I suspect there maybe a bug in ansible in the latest release. We are not invoking template in this role - I don't have a way to test with v2.8 yet.
The search_mapping_rule role currently registers the resulting mapping rule ID in a variable which is always called "search_mapping_rule". This causes issues if you need to lookup multiple mapping rule IDs for a single task (i.e. if you are creating a module chain which uses more than one mapping rule, as we frequently do). I have shown in my local environment that by making the name of the registered variable configurable, it is possible to lookup multiple mapping rules within a single task.
Example of the modification to the search_mapping_rule role:
Example task from playbook:
If this is acceptable, I will submit a pull request for this update.