include variables from a distinct file

This commit is contained in:
Smana 2016-06-26 21:14:45 +02:00
parent 247a1a6e6e
commit c4beee38f6
7 changed files with 11 additions and 8 deletions

View file

@ -4,7 +4,6 @@ local_release_dir: /tmp
# if this is set to true will only download files once # if this is set to true will only download files once
download_run_once: False download_run_once: False
# Versions # Versions
include_vars: kube_versions.yml include_vars: kube_versions.yml
@ -76,7 +75,7 @@ downloads:
kubernetes_kubelet: kubernetes_kubelet:
version: "{{kube_version}}" version: "{{kube_version}}"
dest: kubernetes/bin/kubelet dest: kubernetes/bin/kubelet
sha256: "{{kube_checksum.kubelet}}" sha256: "{{vars['kube_checksum'][kube_version]['kubelet']}}"
source_url: "{{ kubelet_download_url }}" source_url: "{{ kubelet_download_url }}"
url: "{{ kubelet_download_url }}" url: "{{ kubelet_download_url }}"
owner: "kube" owner: "kube"
@ -84,7 +83,7 @@ downloads:
kubernetes_kubectl: kubernetes_kubectl:
dest: kubernetes/bin/kubectl dest: kubernetes/bin/kubectl
version: "{{kube_version}}" version: "{{kube_version}}"
sha256: "{{kube_checksum.kubectl}}" sha256: "{{vars['kube_checksum'][kube_version]['kubectl']}}"
source_url: "{{ kubectl_download_url }}" source_url: "{{ kubectl_download_url }}"
url: "{{ kubectl_download_url }}" url: "{{ kubectl_download_url }}"
owner: "kube" owner: "kube"
@ -92,7 +91,7 @@ downloads:
kubernetes_apiserver: kubernetes_apiserver:
dest: kubernetes/bin/kube-apiserver dest: kubernetes/bin/kube-apiserver
version: "{{kube_version}}" version: "{{kube_version}}"
sha256: "{{kube_checksum.kube_apiserver}}" sha256: "{{vars['kube_checksum'][kube_version]['kube_apiserver']}}"
source_url: "{{ apiserver_download_url }}" source_url: "{{ apiserver_download_url }}"
url: "{{ apiserver_download_url }}" url: "{{ apiserver_download_url }}"
owner: "kube" owner: "kube"

View file

@ -1,4 +1,6 @@
--- ---
- include_vars: kube_versions.yml
- name: downloading... - name: downloading...
debug: debug:
msg: "{{ download.url }}" msg: "{{ download.url }}"

View file

@ -74,7 +74,7 @@ downloads:
- name: kubernetes-kubelet - name: kubernetes-kubelet
version: "{{kube_version}}" version: "{{kube_version}}"
dest: kubernetes/bin/kubelet dest: kubernetes/bin/kubelet
sha256: "{{kube_checksum.kubelet}}" sha256: "{{vars['kube_checksum'][kube_version]['kubelet']}}"
source_url: "{{ kube_download_url }}/kubelet" source_url: "{{ kube_download_url }}/kubelet"
url: "{{ kube_download_url }}/kubelet" url: "{{ kube_download_url }}/kubelet"
owner: "kube" owner: "kube"
@ -83,7 +83,7 @@ downloads:
- name: kubernetes-kubectl - name: kubernetes-kubectl
dest: kubernetes/bin/kubectl dest: kubernetes/bin/kubectl
version: "{{kube_version}}" version: "{{kube_version}}"
sha256: "{{kube_checksum.kubectl}}" sha256: "{{vars['kube_checksum'][kube_version]['kubectl']}}"
source_url: "{{ kube_download_url }}/kubectl" source_url: "{{ kube_download_url }}/kubectl"
url: "{{ kube_download_url }}/kubectl" url: "{{ kube_download_url }}/kubectl"
owner: "kube" owner: "kube"
@ -92,7 +92,7 @@ downloads:
- name: kubernetes-apiserver - name: kubernetes-apiserver
dest: kubernetes/bin/kube-apiserver dest: kubernetes/bin/kube-apiserver
version: "{{kube_version}}" version: "{{kube_version}}"
sha256: "{{kube_checksum.kube_apiserver}}" sha256: "{{vars['kube_checksum'][kube_version]['kube_apiserver']}}"
source_url: "{{ kube_download_url }}/kube-apiserver" source_url: "{{ kube_download_url }}/kube-apiserver"
url: "{{ kube_download_url }}/kube-apiserver" url: "{{ kube_download_url }}/kube-apiserver"
owner: "kube" owner: "kube"

View file

@ -1,4 +1,6 @@
--- ---
- include_vars: "kube_versions.yml"
- name: Create the checksum file - name: Create the checksum file
lineinfile: lineinfile:
create: yes create: yes

View file

@ -94,7 +94,7 @@ if __name__ == '__main__':
file_sub('../roles/kubernetes/node/defaults/main.yml', r'.*hyperkube_image_tag.*', 'hyperkube_image_tag: "%s"' % args.kube_version) file_sub('../roles/kubernetes/node/defaults/main.yml', r'.*hyperkube_image_tag.*', 'hyperkube_image_tag: "%s"' % args.kube_version)
kube_binaries = ['kubelet', 'kubectl', 'kube-apiserver'] kube_binaries = ['kubelet', 'kubectl', 'kube-apiserver']
var_files = ['../roles/uploads/defaults/kube_versions.yml', '../roles/download/defaults/kube_versions.yml'] var_files = ['../roles/uploads/vars/kube_versions.yml', '../roles/download/vars/kube_versions.yml']
kube_download_url = "https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/amd64" % args.kube_version kube_download_url = "https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/amd64" % args.kube_version
new = get_kube_sha256(args.kube_version, kube_download_url, kube_binaries) new = get_kube_sha256(args.kube_version, kube_download_url, kube_binaries)