From e020457d1d618b4f07d488d6af1231fd4948d1b5 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Wed, 22 Mar 2017 13:02:39 +0300 Subject: [PATCH] Use checksum of dnsmasq config to trigger updates of dnsmasq Allows config changes made by Ansible to restart dnsmasq deployment --- roles/dnsmasq/tasks/main.yml | 7 ++++++- roles/dnsmasq/templates/dnsmasq-deploy.yml | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/dnsmasq/tasks/main.yml b/roles/dnsmasq/tasks/main.yml index d6112fd6e..7d11a1af0 100644 --- a/roles/dnsmasq/tasks/main.yml +++ b/roles/dnsmasq/tasks/main.yml @@ -35,7 +35,12 @@ backup: yes register: dnsmasq_config -- name: Stat dnsmasq configuration +- name: Stat dnsmasq link + stat: + path: /etc/dnsmasq.d-available/01-kube-dns.conf + register: dnsmasq_stat + +- name: Stat dnsmasq link stat: path: /etc/dnsmasq.d/01-kube-dns.conf register: sym diff --git a/roles/dnsmasq/templates/dnsmasq-deploy.yml b/roles/dnsmasq/templates/dnsmasq-deploy.yml index c1bb614ec..ed74c3e06 100644 --- a/roles/dnsmasq/templates/dnsmasq-deploy.yml +++ b/roles/dnsmasq/templates/dnsmasq-deploy.yml @@ -12,11 +12,14 @@ spec: selector: matchLabels: k8s-app: dnsmasq + strategy: + type: "Recreate" template: metadata: labels: k8s-app: dnsmasq kubernetes.io/cluster-service: "true" + kargo/dnsmasq-checksum: "{{ dnsmasq_stat.stat.checksum }}" spec: containers: - name: dnsmasq