I need to read VARIABLE from some pre-defined file, not from the console.
I have a file named "all" under group_vars with predefined variable, the
value of which can be changed, let say, from "C" to "D' depends on what I
need:
VARIABLE: C
Also, I have a task under my playbook:
- hosts: "POD_'+VARIABLE+'_master_sn" # or - hosts: "{{ 'POD_' +
source_pod_name_capital_letter + '_master_sn' }}"
tasks:
- include_role:
name: sn_static_hosts
tasks_from: remove
As you can see, I want to perform concatenation, but getting this:
[WARNING]: Could not match supplied host pattern, ignoring: POD_
'+source_pod_name_capital_letter+'_master_sn
or this:
ERROR! The field 'hosts' has an invalid value, which includes an undefined
variable. The error was: 'source_pod_name_capital_letter' is undefined
I have tried to play with brackets, removed/added "+" etc, but got only
warnings or errors.
Is that possible to have this kind of concatenation?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/56f86314-aedc-4986-9700-0a53cab5e1bd%40googlegroups.com.