I have a playbook that is running some roles supplied by a vendor that I don't want to modify. There is a variable being defined in the 'role defaults' (roles/jira_config/default/main.yml) that I want to keep the value of and add onto from my 'play vars'. Normal variable precedence means that my 'play vars' definition overwrites the 'role defaults'. How can I combine the two?
jira.yml
vars:
atl_catalina_opts: >-
-myAdditionA
-myAdditionB
roles:
- role: jira_config
roles/jira_config/default/main.yml
atl_catalina_opts_extra: >-
-something1
-something2
As it stands, the value for atl_catalina_opts ends up
"atl_catalina_opts": "myAdditionA myAdditionB"
Whereas I want a combination of the two (order doesn't matter)
"atl_catalina_opts": "something1 something2 myAdditionA myAdditionB"
I've tried something like
vars:
atl_catalina_opts: >-
-{{ atl_catalina_opts }}
-myAdditionA
-myAdditionB
but that throws an unhandled exception.
Again, I don't want to modify anything in the jira_config role because that is being supplied by the vendor. Also, that role is the one using the variable so I can't do any tricks like creating another variable that combines the 'play vars' and 'role defaults'. Also, I don't want to search the vendor role for the atl_catalina_opts and add them into my 'play vars'. At some point in the future the vendor may update the role and I don't want to search for changes the vendor has made each time there is an update.