From 949f8a79fb2dd4481aece85bc652ac7d61cfd0bb Mon Sep 17 00:00:00 2001 From: Konrad Bańka Date: Fri, 21 Jun 2019 11:26:15 +0200 Subject: Provide idempotent multus plugin configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blockinfile task overrides marker section in order to provide valid json content in file. Because of this, generated block is added each time this playbook is run. This makes CNI config file contain malformed content when launched more than once. Issue-ID: MULTICLOUD-676 Signed-off-by: Konrad Bańka Change-Id: If1c98414be4fb3a5b6c1c63fada0bd934448f040 --- .../playbooks/configure-multus.yml | 38 ++++++++++------------ 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'kud/deployment_infra/playbooks') diff --git a/kud/deployment_infra/playbooks/configure-multus.yml b/kud/deployment_infra/playbooks/configure-multus.yml index 9cca54d1..47109162 100644 --- a/kud/deployment_infra/playbooks/configure-multus.yml +++ b/kud/deployment_infra/playbooks/configure-multus.yml @@ -62,27 +62,25 @@ mode: 0755 when: multus_source_type == "tarball" - name: create multus configuration file - blockinfile: - marker: "" - path: /etc/cni/net.d/00-multus.conf - create: yes - block: | - { - "type": "multus", - "name": "multus-cni", - "cniVersion": "0.3.1", - "kubeconfig": "/etc/kubernetes/admin.conf", - "delegates": [ - { - "type": "flannel", + copy: + dest: /etc/cni/net.d/00-multus.conf + content: | + { + "type": "multus", + "name": "multus-cni", "cniVersion": "0.3.1", - "masterplugin": true, - "delegate": { - "isDefaultGateway": true - } - } - ] - } + "kubeconfig": "/etc/kubernetes/admin.conf", + "delegates": [ + { + "type": "flannel", + "cniVersion": "0.3.1", + "masterplugin": true, + "delegate": { + "isDefaultGateway": true + } + } + ] + } - hosts: localhost pre_tasks: -- cgit 1.2.3-korg