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