Merge pull request #2347 from hswong3i/multiple_artifacts_dir

Support multiple artifacts under individual inventory directory
This commit is contained in:
Andreas Krüger
2018-03-19 12:45:55 +01:00
committed by GitHub
6 changed files with 56 additions and 42 deletions

View File

@@ -1,7 +1,7 @@
---
kubeconfig_localhost: false
kubectl_localhost: false
artifacts_dir: "./artifacts"
artifacts_dir: "{{ inventory_dir }}/artifacts"
kube_config_dir: "/etc/kubernetes"
kube_apiserver_port: "6443"

View File

@@ -55,9 +55,23 @@
- name: Copy kubectl binary to ansible host
fetch:
src: "{{ bin_dir }}/kubectl"
dest: "{{ artifacts_dir }}/kubectl"
dest: "{{ bin_dir }}/kubectl"
flat: yes
validate_checksum: no
become: no
run_once: yes
when: kubectl_localhost|default(false)
- name: create helper script kubectl.sh on ansible host
copy:
content: |
#!/bin/bash
kubectl --kubeconfig=admin.conf $@
dest: "{{ artifacts_dir }}/kubectl.sh"
owner: root
group: root
mode: 0755
become: no
run_once: yes
delegate_to: localhost
when: kubectl_localhost|default(false) and kubeconfig_localhost|default(false)

View File

@@ -153,9 +153,9 @@ helm_deployment_type: host
# Enable kubeadm deployment (experimental)
kubeadm_enabled: false
# Make a copy of kubeconfig on the host that runs Ansible in GITDIR/artifacts
# Make a copy of kubeconfig on the host that runs Ansible in {{ inventory_dir }}/artifacts
kubeconfig_localhost: false
# Download kubectl onto the host that runs Ansible in GITDIR/artifacts
# Download kubectl onto the host that runs Ansible in {{ bin_dir }}
kubectl_localhost: false
# K8s image pull policy (imagePullPolicy)