Saltclass variable expansion does not work if the variable is in a list, such as if you have a list of dictionaries in the pillar. This functionality worked in reclass.
Make a pillar with a list of dictionaries and put a variable that you want expanded in the list
pillars:
substitute:
key: value
list_of_dicts:
- id: dict1
a: ${substitute:key}
- id: dict2
b: ${substitute:key}
Run a pillar.get on list_of_dicts and the variable ${substitute:key} will not be expanded.
# salt 'minion' pillar.get list_of_dicts
minion:
|_
----------
a:
${substitute:key}
id:
dict1
|_
----------
b:
${substitute:key}
id:
dict2
# salt-call --versions-report
Salt Version:
Salt: 2018.3.0
Dependency Versions:
cffi: 1.5.2
cherrypy: 3.6.0
dateutil: 2.4.2
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
libgit2: 0.24.0
libnacl: Not Installed
M2Crypto: 0.21.1
Mako: 1.0.1
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: 1.2.5
pycparser: 2.10
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: 0.24.0
Python: 2.7.13 (default, Jan 03 2017, 17:41:54) [GCC]
python-gnupg: 0.3.7
PyYAML: 3.12
PyZMQ: 15.2.0
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.2.2
System Versions:
dist: SuSE 42.3 x86_64
locale: UTF-8
machine: x86_64
release: 4.4.114-42-default
system: Linux
version: openSUSE 42.3 x86_64
Saltclass variable expansion does not work if the variable is in a list, such as if you have a list of dictionaries in the pillar. This functionality worked in reclass.
Make a pillar with a list of dictionaries and put a variable that you want expanded in the list
pillars: substitute: key: value list_of_dicts: - id: dict1 a: ${substitute:key} - id: dict2 b: ${substitute:key}Run a pillar.get on list_of_dicts and the variable ${substitute:key} will not be expanded.
# salt 'minion' pillar.get list_of_dicts minion: |_ ---------- a: ${substitute:key} id: dict1 |_ ---------- b: ${substitute:key} id: dict2# salt-call --versions-report Salt Version: Salt: 2018.3.0 Dependency Versions: cffi: 1.5.2 cherrypy: 3.6.0 dateutil: 2.4.2 docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed Jinja2: 2.8 libgit2: 0.24.0 libnacl: Not Installed M2Crypto: 0.21.1 Mako: 1.0.1 msgpack-pure: Not Installed msgpack-python: 0.4.8 mysql-python: 1.2.5 pycparser: 2.10 pycrypto: 2.6.1 pycryptodome: Not Installed pygit2: 0.24.0 Python: 2.7.13 (default, Jan 03 2017, 17:41:54) [GCC] python-gnupg: 0.3.7 PyYAML: 3.12 PyZMQ: 15.2.0 RAET: Not Installed smmap: 0.9.0 timelib: Not Installed Tornado: 4.2.1 ZMQ: 4.2.2 System Versions: dist: SuSE 42.3 x86_64 locale: UTF-8 machine: x86_64 release: 4.4.114-42-default system: Linux version: openSUSE 42.3 x86_64