Переглянути джерело

fastd: move secret into fastd.conf

there is no need for separate secret.conf
Karsten Böddeker 7 роки тому
батько
коміт
a4c7ad3ecb
3 змінених файлів з 3 додано та 13 видалено
  1. 1 1
      fastd/fastd.conf
  2. 2 11
      fastd/init.sls
  3. 0 1
      fastd/secret.conf.tmpl

+ 1 - 1
fastd/fastd.conf

@@ -35,7 +35,7 @@ bind [::]:{{ port }} interface "vrf_external";
 # Specifying the interface and setsockopt() isn't enough for fastd.
 packet mark 0x1023;
 
-include "secret.conf";
+secret "{{ secret }}";
 mtu 1406;
 
 status socket "/var/run/fastd.{{ site }}_{{ network }}.sock";

+ 2 - 11
fastd/init.sls

@@ -67,6 +67,7 @@ fastd:
     - template: jinja
       network: {{ network }}
       network_type: {{ network_type }}
+      secret: {{ node_config.get('fastd', {}).get(network_type ~ '_privkey') }}
       site: {{ site }}
       site_no: {{ site_no }}
       mac_address: {{ mac_address }}
@@ -81,15 +82,7 @@ fastd:
     - watch_in:
   
 /etc/fastd/{{ instance_name }}/secret.conf:
-  file.managed:
-    - source: salt://fastd/secret.conf.tmpl
-    - template: jinja
-      secret: {{ node_config.get('fastd', {}).get(network_type ~ '_privkey') }}
-    - mode: 600
-    - user: root
-    - group: root
-    - require:
-      - file: /etc/fastd/{{ instance_name }}
+  file.absent
 
 
 # Create systemd start link
@@ -100,11 +93,9 @@ fastd@{{ instance_name }}:
     - require:
       - file: /etc/systemd/system/fastd@.service
       - file: /etc/fastd/{{ instance_name }}/fastd.conf
-      - file: /etc/fastd/{{ instance_name }}/secret.conf
       - service: fastd
     - watch:
       - file: /etc/fastd/{{ instance_name }}/fastd.conf
-      - file: /etc/fastd/{{ instance_name }}/secret.conf
     {% if network in ['nodes4', 'nodes6'] %}
       - git: peers-git
     {% else %}

+ 0 - 1
fastd/secret.conf.tmpl

@@ -1 +0,0 @@
-secret "{{ secret }}";