Support multiple artifacts under individual inventory directory

This commit is contained in:
Wong Hoi Sing Edison
2018-02-16 20:53:35 +08:00
parent 955f833120
commit a086686e9f
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

@@ -152,9 +152,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)