Zuweisung von Software Paketen über Pillars

Legen Sie beispielsweise eine Datei /srv/salt/linux/my-software.sls mit folgendem Inhalt an:

{% if pillar['software'] is defined %}
{% for key, value in pillar['software'].iteritems() %}
{{ key }}:
  pkg.installed: []
{% endfor %}
{% else %}
notice:
  test.succeed_without_changes:
    - name: "Nothing todo"
{% endif %}

Alternativ

{% if pillar['software'] is defined %}
{% for key in pillar['software'] %}
{{ key }}:
  pkg.installed: []
{% endfor %}
{% else %}
notice:
  test.succeed_without_changes:
    - name: "Nothing todo"
{% endif %}

Nun können Sie einem Minion durch einfaches Anlegen einer Datei zuweisen, welche Software auf einem Minion installiert wird. Beispiel:

cd /srv/host-pillars/hosts/minion-ubuntu/
mkdir software
echo "true">software/rsync

results matching ""

    No results matching ""