From 04f28303ec6c5c1767994ef66824edfd522c4ad2 Mon Sep 17 00:00:00 2001 From: Astro Date: Mon, 28 Nov 2016 23:49:37 +0100 Subject: [PATCH] ospf: mkdir /var/run/quagga fixes --- salt/ospf/init.sls | 12 +++--------- salt/ospf/ospfd.conf | 2 ++ salt/ospf/zebra.conf | 2 ++ salt/ospf/zebra.service | 2 ++ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/salt/ospf/init.sls b/salt/ospf/init.sls index 3220d34..f98235e 100644 --- a/salt/ospf/init.sls +++ b/salt/ospf/init.sls @@ -10,14 +10,15 @@ quagga: file.managed: - source: salt://ospf/{{ daemon }}.conf - template: 'jinja' + - require: + - pkg: quagga autostart-{{ daemon }}: service.enabled: - name: {{ daemon }} - require_in: + require: - file: /etc/systemd/system/{{ daemon }}.service - file: /etc/quagga/{{ daemon }}.conf - - file: /var/run/quagga start-{{ daemon }}: service.running: @@ -28,10 +29,3 @@ start-{{ daemon }}: - file: /etc/quagga/{{ daemon }}.conf {%- endfor %} - -/var/run/quagga: - file.directory: - - user: quagga - group: quagga - - diff --git a/salt/ospf/ospfd.conf b/salt/ospf/ospfd.conf index d53a76d..dd5cae3 100644 --- a/salt/ospf/ospfd.conf +++ b/salt/ospf/ospfd.conf @@ -1,3 +1,5 @@ +log file /var/log/quagga/ospfd.log + {%- set id = salt['grains.get']('id') %} {%- set core_ifaces = ['br-core', 'core'] %} diff --git a/salt/ospf/zebra.conf b/salt/ospf/zebra.conf index e69de29..95d8a69 100644 --- a/salt/ospf/zebra.conf +++ b/salt/ospf/zebra.conf @@ -0,0 +1,2 @@ +hostname {{ salt['grains.get']('id') }} +log file /var/log/quagga/zebra.log diff --git a/salt/ospf/zebra.service b/salt/ospf/zebra.service index bc4983a..150055d 100644 --- a/salt/ospf/zebra.service +++ b/salt/ospf/zebra.service @@ -2,6 +2,8 @@ After = network.target [Service] +ExecStartPre=-/usr/bin/mkdir /var/run/quagga +ExecStartPre=/usr/bin/chown -R quagga:quagga /var/run/quagga/ ExecStart = /usr/lib/quagga/zebra [Install]