diff options
author | Konrad Bańka <k.banka@samsung.com> | 2019-06-21 11:26:15 +0200 |
---|---|---|
committer | Konrad Bańka <k.banka@samsung.com> | 2019-07-16 10:34:55 +0200 |
commit | 949f8a79fb2dd4481aece85bc652ac7d61cfd0bb (patch) | |
tree | b5d22433efd2747739f9510f144b5e36e9de923c /kud | |
parent | ba4a7991e10172a31cec65ae5c9ad11cbb1b806b (diff) |
Provide idempotent multus plugin configuration
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 <k.banka@samsung.com>
Change-Id: If1c98414be4fb3a5b6c1c63fada0bd934448f040
Diffstat (limited to 'kud')
-rw-r--r-- | kud/deployment_infra/playbooks/configure-multus.yml | 38 |
1 files changed, 18 insertions, 20 deletions
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: |