From dba20260027fbda6c3f7cb7e95118f8fcc5525ef Mon Sep 17 00:00:00 2001 From: ant31 <2t.antoine@gmail.com> Date: Fri, 2 Dec 2016 12:37:22 +0100 Subject: [PATCH] Fail all nodes on error --- cluster.yml | 8 ++++++++ roles/kubernetes/preinstall/tasks/gitinfos.yml | 5 +++++ roles/kubernetes/preinstall/tasks/main.yml | 12 ++++++------ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/cluster.yml b/cluster.yml index 12c090169..5fb0cf982 100644 --- a/cluster.yml +++ b/cluster.yml @@ -1,5 +1,6 @@ --- - hosts: all + any_errors_fatal: true gather_facts: false roles: - bootstrap-os @@ -8,33 +9,40 @@ - hosts: all + any_errors_fatal: true gather_facts: true - hosts: all + any_errors_fatal: true roles: - { role: kubernetes/preinstall, tags: preinstall } - hosts: etcd:!k8s-cluster + any_errors_fatal: true roles: - { role: etcd, tags: etcd } - hosts: k8s-cluster + any_errors_fatal: true roles: - { role: etcd, tags: etcd } - { role: kubernetes/node, tags: node } - { role: network_plugin, tags: network } - hosts: kube-master + any_errors_fatal: true roles: - { role: kubernetes/master, tags: master } - { role: kubernetes-apps/lib, tags: apps } - { role: kubernetes-apps/network_plugin, tags: network } - hosts: k8s-cluster + any_errors_fatal: true roles: - { role: dnsmasq, tags: dnsmasq } - hosts: kube-master[0] + any_errors_fatal: true roles: - { role: kubernetes-apps/lib, tags: apps } - { role: kubernetes-apps, tags: apps } diff --git a/roles/kubernetes/preinstall/tasks/gitinfos.yml b/roles/kubernetes/preinstall/tasks/gitinfos.yml index 60a12f8fa..f5da4763e 100644 --- a/roles/kubernetes/preinstall/tasks/gitinfos.yml +++ b/roles/kubernetes/preinstall/tasks/gitinfos.yml @@ -1,6 +1,11 @@ --- # Deploy git infos # ---------------- +- name: 'GIT | Install script for collecting git info' + template: + src: "{{ role_path }}/gen-gitinfos.sh" + dest: "{{ bin_dir }}/gen-gitinfos.sh" + mode: a+rwx - name: 'GIT | generate git informations' local_action: command {{ role_path }}/gen-gitinfos.sh global diff --git a/roles/kubernetes/preinstall/tasks/main.yml b/roles/kubernetes/preinstall/tasks/main.yml index 7e4c2ac48..346a894e6 100644 --- a/roles/kubernetes/preinstall/tasks/main.yml +++ b/roles/kubernetes/preinstall/tasks/main.yml @@ -4,12 +4,12 @@ bin_dir: "/opt/bin" when: ansible_os_family == "CoreOS" - -- name: 'GIT | Install script for collecting git info' - template: - src: "{{ role_path }}/gen-gitinfos.sh" - dest: "{{ bin_dir }}/gen-gitinfos.sh" - mode: a+rwx +- name: check bin dir exists + file: + path: "{{bin_dir}}" + state: directory + owner: root + become: true - include: gitinfos.yml when: run_gitinfos