Browse Source

Fix sysctl state syntax and remove old files.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Maximilian Wilhelm 8 years ago
parent
commit
b082b0f939
1 changed files with 10 additions and 3 deletions
  1. 10 3
      sysctl/init.sls

+ 10 - 3
sysctl/init.sls

@@ -1,7 +1,7 @@
 #
 #
 # sysctl
 # sysctl
 #
 #
-{%- set roles = salt['pillar.get']('roles', []) %}
+{%- set roles = salt['pillar.get']('nodes:' ~ grains['id'] ~ ':roles', []) %}
 
 
 # Define command to reload sysctl settings here without dependencies
 # Define command to reload sysctl settings here without dependencies
 # and define inverse dependencies where useful (see sysctl.conf)
 # and define inverse dependencies where useful (see sysctl.conf)
@@ -25,10 +25,17 @@ reload-sysctl:
       - cmd: reload-sysctl
       - cmd: reload-sysctl
 
 
 
 
-{%- if router in roles %}
-/etc/sysctl.d/global.conf:
+{%- if 'router' in roles %}
+/etc/sysctl.d/router.conf:
   file.managed:
   file.managed:
     - source: salt://sysctl/router.conf
     - source: salt://sysctl/router.conf
     - watch_in:
     - watch_in:
       - cmd: reload-sysctl
       - cmd: reload-sysctl
 {%- endif %}
 {%- endif %}
+
+
+{# Remove old files #}
+{% for file in ['20-arp_caches.conf', '21-ip_forward.conf', '22-kernel.conf', 'NAT.conf', 'nf-ignore-bridge.conf'] %}
+/etc/sysctl.d/{{ file }}:
+  file.absent
+{% endfor %}