Description of problem: Null coalescing fields do not work as input to Ansible Playbook method. Version-Release number of selected component (if applicable): 5.9.9.1 How reproducible: I have only encountered it in one test workflow but I believe it would be the same for all Ansible Playbook Methods Steps to Reproduce: 1. Create a playbook that outputs a method parameter, say `input_field` 2. Create a playbook method that uses `${/#input_field} || "default"` as a method parameter 3. Simulate method execution with input_field = "new value" 4. Observe the output is 'new value || "default"' Alternate Steps: 1. Import https://github.com/chrisruffalo/cfme-null-coalesce-issue.git as an Ansible repository with the EXACT name "CFME Null Coalesce Issue" 2. Import https://github.com/chrisruffalo/cfme-null-coalesce-issue.git as a Domain from the branch origin/master 3. Simulate the execution of `NullCoalesceAnsible` with the attribute/value pair { input_field => new value } 4. Observe the output of input_field is 'new value || "default"' 5. For comparison observe the output of input_field2 which is null coalesced in the instance Actual results: Null coalescing field has all non-null options Expected results: Null coalescing field should only have non-null options Additional info: https://github.com/chrisruffalo/cfme-null-coalesce-issue
Chris, Null Coalescing fields don't work as input Parameters for Ansible methods and inline methods currently. I opened a new BZ for this: https://bugzilla.redhat.com/show_bug.cgi?id=1698184 As a workaround, you can setup the null coalescing field in the instance and then use that in the input parameters. I am going to include a couple of screenshots. If you want, I have a domain export that I can include that has the workaround included for both inline method and ansible method. Thanks Billy
Created attachment 1554615 [details] null coalescing 1
Created attachment 1554616 [details] null coalescing workaround
Billy, Thanks for taking the time to respond. In the domain I linked in the GitHub repository the difference is demonstrated with the different variables/values. I have a null coalescing field in the instance and then use the same pattern to null coalesce in the method parameter. I'm using the workaround now but it diminishes the value of the shared code and being able to call it from anywhere because I've got to modify schemas where I have this issue. (I'm making drop-in replacements for existing automation from Embedded Ansible.) Also, thank you for taking the time to test it with a Ruby method which I hadn't done in my domain. Chris
Chris, Are you ok with me marking this BZ as a duplicate of mine and closing it ? I will track this issue for both cases with my BZ : https://bugzilla.redhat.com/show_bug.cgi?id=1698184 Please let me know
*** This bug has been marked as a duplicate of bug 1698184 ***
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days