Hello, all
I'm looking for help, another pair of eyes on this. I have a feeling this is my misunderstanding of the way a 'root' playbook vars file is used to declare additional vars within it. :-)
What I am trying to do is have a single var line that can be edited for whatever RPM version is desired to install vs. using a text substitution method in VIM or similar.
Code in the vars/main.yml
Code:
phpver: php73
php_rpms:
- '{{ vars["phpver"] }}' # this works fine if left alone as-is, being a single line in the list.
- '{{ vars["phpver"] }}'-php-cli # if I add this, it blows up due to the '-' after the declared var.
... # multiple lines like the second one above for other RPMs following the same format.
I can make this work like so...
Code:
#phpver: php73 # not using this guy, of course. just a fly on the wall.
php_rpms:
- php73
- php73-php-cli
- php73-php-fpm
...
... but then I have to use VIM and the usual
:%s/php73/php74/g stuff. Figured if there was a way to have just the one variable
phpver: whatever_you_want is easier/quicker to maintain after creation.