# Hostgruppen - Node Groups

Die sogenannten Node Groups werden in der Master-Konfiguration gepflegt, z.B. in der Datei `/etc/salt/master.d/node_groups.conf`

### Beispiel

{% code title="/etc/salt/master.d/node\_groups.conf" %}

```yaml
nodegroups:
  group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com or bl*.domain.com'
  group2: 'G@os:Debian and foo.domain.com'
  group3: 'G@os:Debian and N@group1'
  group4:
    - 'G@foo:bar'
    - 'or'
    - 'G@foo:baz'
  webservers:
    - server1
    - server2
    - salt-master
```

{% endcode %}

Mit `-L` werden Minions über die Minion-ID identifiziert. \
Mit `-G` werden Minions über Grains identifiziert.\
Mit `-N` wird eine andere Node-Gruppe referenziert.\
Eine Liste mit Minion-IDs kann entweder in einer Zeile angegeben werden (siehe Zeile 2) oder über mehrere Zeilen verteilt werden (siehe Zeilen 9-12).

### Node Groups verwenden

```bash
salt -N <GRUPPE> test.ping
```

{% hint style="warning" %}
Wenn Nodegroups für die Minion-Adresseirung innerhalt des Salt-Kommandos verwendet werden, z. B. `salt -N <GROUP>`, dann erfordern Änderungen an der Node Group Datei erfordern **keinen Neu-Start** des Masters.

Wenn Sie Nodegruppen in der top.sls verwenden, **müssen Sie den Salt-Master neustarten**, damit Änderungen an der Node Group Datei wirksam werden.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thorstenkramm.gitbook.io/saltstack/minions-adressieren/hostgruppen-node-groups.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
