mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Updated the formulas doc to show an example that reflects our normal map structure.
This commit is contained in:
parent
a1561ec7e3
commit
49bdaf7498
1 changed files with 29 additions and 0 deletions
|
@ -290,6 +290,35 @@ result to a variable that can be used throughout the formula.
|
|||
{% set mysql = salt['grains.filter_by'](mysql_lookup_table,
|
||||
merge=salt['pillar.get']('mysql:lookup')) %}
|
||||
|
||||
The above example is used to help explain how the mapping works. In most
|
||||
map files you will see the following structure:
|
||||
|
||||
.. code-block:: jinja
|
||||
|
||||
{% set mysql = salt['grains.filter_by']({
|
||||
'Debian': {
|
||||
'server': 'mysql-server',
|
||||
'client': 'mysql-client',
|
||||
'service': 'mysql',
|
||||
'config': '/etc/mysql/my.cnf',
|
||||
'python': 'python-mysqldb',
|
||||
},
|
||||
'RedHat': {
|
||||
'server': 'mysql-server',
|
||||
'client': 'mysql',
|
||||
'service': 'mysqld',
|
||||
'config': '/etc/my.cnf',
|
||||
'python': 'MySQL-python',
|
||||
},
|
||||
'Gentoo': {
|
||||
'server': 'dev-db/mysql',
|
||||
'mysql-client': 'dev-db/mysql',
|
||||
'service': 'mysql',
|
||||
'config': '/etc/mysql/my.cnf',
|
||||
'python': 'dev-python/mysql-python',
|
||||
},
|
||||
}, merge=salt['pillar.get']('mysql:lookup')) %}
|
||||
|
||||
The ``merge`` keyword specifies the location of a dictionary in Pillar that can
|
||||
be used to override values returned from the lookup table. If the value exists
|
||||
in Pillar it will take precedence, otherwise ``merge`` will be ignored. This is
|
||||
|
|
Loading…
Add table
Reference in a new issue