On this page
salt.pillar.csvpillar
Store key/value pairs in a CSV file
New in version 2016.11.0.
Example configuration:
ext_pillar:
- csv: /path/to/file.csv
# or
ext_pillar:
- csv:
path: /path/to/file.csv
namespace: 'subkey'
fieldnames:
- col1
- col2
- col2
The first column must be minion IDs and the first row must be dictionary keys. E.g.:
id |
role |
env |
---|---|---|
jerry |
web |
prod |
stuart |
web |
stage |
dave |
web |
qa |
phil |
db |
prod |
kevin |
db |
stage |
mike |
db |
qa |
Will produce the following Pillar values for a minion named "jerry":
{
'role': 'web',
'env': 'prod',
}
-
Read a CSV into Pillar
- Parameters
salt.pillar.csvpillar.ext_pillar(mid, pillar, path, idkey='id', namespace=None, fieldnames=None, restkey=None, restval=None, dialect='excel')
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/pillar/all/salt.pillar.csvpillar.html