Use traditional grains management

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2023-01-15 17:06:29 +01:00
parent eb1731e7a1
commit fe2a1a21b9
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57
4 changed files with 8 additions and 14 deletions

View File

@ -1,11 +1,5 @@
{%- set myconfig = pillar['netbox']['config_context'] -%}
salt: salt:
minion_remove_config: True minion_remove_config: True
minion: minion:
master_type: str master_type: str
master: {{ myconfig['salt_master'] }} master: {{ myconfig['salt_master'] }}
{%- if 'roles' in myconfig and myconfig['roles'] | length > 0 %}
grains:
roles: {{ myconfig['roles'] }}
{%- endif %}

View File

@ -6,10 +6,7 @@ salt_grains_file:
- names: - names:
- /etc/salt/grains: - /etc/salt/grains:
- source: salt:///{{ slspath }}/files/etc/salt/grains.j2 - source: salt:///{{ slspath }}/files/etc/salt/grains.j2
- require_in:
salt_restart_minion: - service: salt-minion
cmd.run: - watch_in:
- name: 'salt-call service.restart salt-minion' - service: salt-minion
- bg: True
- onchanges:
- file: salt_grains_file

View File

@ -0,0 +1,3 @@
include:
- salt.minion
- .grains

View File

@ -1,2 +1,2 @@
include: include:
- salt.minion - profile.salt.minion