Restart dnsmasq instead of container
diff --git a/xos/observers/vcpe/files/vcpe.dnsmasq b/xos/observers/vcpe/files/vcpe.dnsmasq
new file mode 100644
index 0000000..2b2687b
--- /dev/null
+++ b/xos/observers/vcpe/files/vcpe.dnsmasq
@@ -0,0 +1,2 @@
+listen-address=192.168.0.1
+dhcp-range=192.168.0.2,192.168.0.254,6
diff --git a/xos/observers/vcpe/steps/sync_vcpetenant.yaml b/xos/observers/vcpe/steps/sync_vcpetenant.yaml
index 1d748d7..e350f61 100644
--- a/xos/observers/vcpe/steps/sync_vcpetenant.yaml
+++ b/xos/observers/vcpe/steps/sync_vcpetenant.yaml
@@ -73,10 +73,17 @@
notify:
- restart vcpe
+ - name: vCPE basic dnsmasq config
+ copy: src=/opt/xos/observers/vcpe/files/vcpe.dnsmasq dest=/etc/dnsmasq.d/vcpe.conf owner=root group=root
+ notify:
+ - stop dnsmasq
+ - start dnsmasq
+
- name: dnsmasq config
template: src=/opt/xos/observers/vcpe/templates/dnsmasq_servers.j2 dest=/etc/dnsmasq.d/servers.conf owner=root group=root
notify:
- - restart vcpe
+ - stop dnsmasq
+ - start dnsmasq
# These are samples, not necessary for correct function of demo
@@ -90,8 +97,11 @@
service: name=vcpe state=started
handlers:
- - name: reload dnsmasq config
- shell: docker exec -t -i vcpe killall -HUP /usr/sbin/dnsmasq
+ - name: stop dnsmasq
+ shell: docker exec vcpe /usr/bin/killall dnsmasq
+
+ - name: start dnsmasq
+ shell: docker exec vcpe /usr/sbin/service dnsmasq start
- name: restart vcpe
shell: service vcpe stop; sleep 1; service vcpe start
diff --git a/xos/observers/vcpe/templates/start-vcpe.sh.j2 b/xos/observers/vcpe/templates/start-vcpe.sh.j2
index c199bb3..8ae66ee 100755
--- a/xos/observers/vcpe/templates/start-vcpe.sh.j2
+++ b/xos/observers/vcpe/templates/start-vcpe.sh.j2
@@ -7,7 +7,7 @@
if [ "$?" == 1 ]
then
docker pull andybavier/docker-vcpe
- docker run -d --name=vcpe --privileged=true --net=none -v /etc/dnsmasq.d/servers.conf:/etc/dnsmasq.d/servers.conf andybavier/docker-vcpe
+ docker run -d --name=vcpe --privileged=true --net=none -v /etc/dnsmasq.d:/etc/dnsmasq.d andybavier/docker-vcpe
else
docker start vcpe
fi