summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pillar/role/salt/minion.sls6
-rw-r--r--salt/profile/salt/grains.sls11
-rw-r--r--salt/profile/salt/minion.sls3
-rw-r--r--salt/role/salt/minion.sls2
4 files changed, 8 insertions, 14 deletions
diff --git a/pillar/role/salt/minion.sls b/pillar/role/salt/minion.sls
index 9b1c850..0e0fb8a 100644
--- a/pillar/role/salt/minion.sls
+++ b/pillar/role/salt/minion.sls
@@ -1,11 +1,5 @@
-{%- set myconfig = pillar['netbox']['config_context'] -%}
-
salt:
minion_remove_config: True
minion:
master_type: str
master: {{ myconfig['salt_master'] }}
- {%- if 'roles' in myconfig and myconfig['roles'] | length > 0 %}
- grains:
- roles: {{ myconfig['roles'] }}
- {%- endif %}
diff --git a/salt/profile/salt/grains.sls b/salt/profile/salt/grains.sls
index 1926250..632a8bc 100644
--- a/salt/profile/salt/grains.sls
+++ b/salt/profile/salt/grains.sls
@@ -6,10 +6,7 @@ salt_grains_file:
- names:
- /etc/salt/grains:
- source: salt:///{{ slspath }}/files/etc/salt/grains.j2
-
-salt_restart_minion:
- cmd.run:
- - name: 'salt-call service.restart salt-minion'
- - bg: True
- - onchanges:
- - file: salt_grains_file
+ - require_in:
+ - service: salt-minion
+ - watch_in:
+ - service: salt-minion
diff --git a/salt/profile/salt/minion.sls b/salt/profile/salt/minion.sls
new file mode 100644
index 0000000..6978eaf
--- /dev/null
+++ b/salt/profile/salt/minion.sls
@@ -0,0 +1,3 @@
+include:
+ - salt.minion
+ - .grains
diff --git a/salt/role/salt/minion.sls b/salt/role/salt/minion.sls
index f65fa18..25d7dd6 100644
--- a/salt/role/salt/minion.sls
+++ b/salt/role/salt/minion.sls
@@ -1,2 +1,2 @@
include:
- - salt.minion
+ - profile.salt.minion