Given a file called package-list, I want to do something like:
salt state.sls install-packages list_to_install=package-list
...and then in the sls:
packages:
pkg.installed:
- names:
{% include list_to_install %}
You can do this using Pillar:
packages:
pkg:
- installed
- pkgs: {{ salt['pillar.get']('packages') }}
Then pass the pillar
argument containing valid YAML:
salt '*' state.sls package-list pillar='{packages: [foo, bar, baz]}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With