From 57cf0cc97d1e5c78f8407df9ae2ac6cd0a3d842b Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Fri, 26 May 2017 17:47:25 -0400 Subject: [PATCH] inventory hostname for cordoning/uncordoning --- roles/upgrade/post-upgrade/tasks/main.yml | 2 +- roles/upgrade/pre-upgrade/tasks/main.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/upgrade/post-upgrade/tasks/main.yml b/roles/upgrade/post-upgrade/tasks/main.yml index bff9983ff..c32f42491 100644 --- a/roles/upgrade/post-upgrade/tasks/main.yml +++ b/roles/upgrade/post-upgrade/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Uncordon node - command: "{{ bin_dir }}/kubectl uncordon {{ ansible_hostname }}" + command: "{{ bin_dir }}/kubectl uncordon {{ inventory_hostname }}" delegate_to: "{{ groups['kube-master'][0] }}" when: needs_cordoning|default(false) diff --git a/roles/upgrade/pre-upgrade/tasks/main.yml b/roles/upgrade/pre-upgrade/tasks/main.yml index f2251375b..a2b34927f 100644 --- a/roles/upgrade/pre-upgrade/tasks/main.yml +++ b/roles/upgrade/pre-upgrade/tasks/main.yml @@ -14,7 +14,7 @@ {% endif %} - name: Cordon node - command: "{{ bin_dir }}/kubectl cordon {{ ansible_hostname }}" + command: "{{ bin_dir }}/kubectl cordon {{ inventory_hostname }}" delegate_to: "{{ groups['kube-master'][0] }}" when: needs_cordoning @@ -25,6 +25,6 @@ --ignore-daemonsets --grace-period {{ drain_grace_period }} --timeout {{ drain_timeout }} - --delete-local-data {{ ansible_hostname }} + --delete-local-data {{ inventory_hostname }} delegate_to: "{{ groups['kube-master'][0] }}" when: needs_cordoning