From 215515e7886911f4742cc7072221d4dc953983c6 Mon Sep 17 00:00:00 2001 From: Jiri Stransky Date: Thu, 19 Oct 2017 18:13:55 +0200 Subject: [PATCH] Generate Kubespray artifacts on undercloud Write kubectl binary and admin.conf file on undercloud. Change-Id: I5dd6ad0f69a12c984b1c5b7c2735bc301f8cb763 --- extraconfig/services/kubernetes-master.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/extraconfig/services/kubernetes-master.yaml b/extraconfig/services/kubernetes-master.yaml index 1c7dedcd3d..0f61c2d83a 100644 --- a/extraconfig/services/kubernetes-master.yaml +++ b/extraconfig/services/kubernetes-master.yaml @@ -61,10 +61,13 @@ outputs: - name: kubernetes_master step 2 when: step == '2' block: - - name: create kubespray temp dir + - name: create kubespray temp dirs file: - path: "{{playbook_dir}}/kubespray" + path: "{{item}}" state: directory + with_items: + - "{{playbook_dir}}/kubespray" + - "{{playbook_dir}}/kubespray/artifacts" - name: generate kubespray inventory copy: dest: "{{playbook_dir}}/kubespray/inventory" @@ -87,10 +90,18 @@ outputs: etcd: children: kube-master: {} + k8s-cluster: children: kube-master: {} kube-node: {} + - name: generate kubespray global vars + copy: + dest: "{{playbook_dir}}/kubespray/global_vars.yml" + content: | + kubeconfig_localhost: true + kubectl_localhost: true + artifacts_dir: '{{playbook_dir}}/kubespray/artifacts' - name: generate kubespray playbook copy: dest: "{{playbook_dir}}/kubespray/playbook.yml" @@ -127,6 +138,7 @@ outputs: -b -i '{{playbook_dir}}/kubespray/inventory' --skip-tags docker,bastion-ssh-config + --extra-vars '@{{playbook_dir}}/kubespray/global_vars.yml' '{{playbook_dir}}/kubespray/playbook.yml' {%- endif -%} - name: print kubespray command