Browse Source
fix a few tasks falsely reporting "changed" (#6269)
Co-authored-by: Hans Feldt <hafe@users.noreply.github.com>
pull/6157/head
Hans Feldt
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
14 additions and
6 deletions
-
roles/kubernetes/kubeadm/tasks/main.yml
-
roles/kubernetes/master/tasks/kubeadm-setup.yml
-
roles/kubernetes/master/tasks/kubeadm-version.yml
-
roles/kubernetes/node/tasks/kubelet.yml
-
roles/kubernetes/preinstall/tasks/0040-set_facts.yml
|
|
@ -30,23 +30,26 @@ |
|
|
|
- kubeadm_ca_stat.stat.exists |
|
|
|
delegate_to: "{{ groups['kube-master'][0] }}" |
|
|
|
run_once: true |
|
|
|
changed_when: false |
|
|
|
|
|
|
|
- name: Create kubeadm token for joining nodes with 24h expiration (default) |
|
|
|
command: "{{ bin_dir }}/kubeadm token create" |
|
|
|
register: temp_token |
|
|
|
delegate_to: "{{ groups['kube-master'][0] }}" |
|
|
|
when: kubeadm_token is not defined |
|
|
|
changed_when: false |
|
|
|
|
|
|
|
- name: Set kubeadm_token to generated token |
|
|
|
set_fact: |
|
|
|
kubeadm_token: "{{ temp_token.stdout }}" |
|
|
|
when: kubeadm_token is not defined |
|
|
|
|
|
|
|
- name: gets the kubeadm version |
|
|
|
- name: Get the kubeadm version |
|
|
|
command: "{{ bin_dir }}/kubeadm version -o short" |
|
|
|
register: kubeadm_output |
|
|
|
changed_when: false |
|
|
|
|
|
|
|
- name: sets kubeadm api version to v1beta2 |
|
|
|
- name: Set kubeadm api version to v1beta2 |
|
|
|
set_fact: |
|
|
|
kubeadmConfig_api_version: v1beta2 |
|
|
|
|
|
|
|
|
|
@ -164,6 +164,7 @@ |
|
|
|
shell: >- |
|
|
|
{{ bin_dir }}/kubeadm --kubeconfig /etc/kubernetes/admin.conf token delete {{ kubeadm_token }} || :; |
|
|
|
{{ bin_dir }}/kubeadm --kubeconfig /etc/kubernetes/admin.conf token create {{ kubeadm_token }} |
|
|
|
changed_when: false |
|
|
|
when: |
|
|
|
- inventory_hostname == groups['kube-master']|first |
|
|
|
- kubeadm_token is defined |
|
|
@ -173,6 +174,7 @@ |
|
|
|
|
|
|
|
- name: Create kubeadm token for joining nodes with 24h expiration (default) |
|
|
|
command: "{{ bin_dir }}/kubeadm --kubeconfig /etc/kubernetes/admin.conf token create" |
|
|
|
changed_when: false |
|
|
|
register: temp_token |
|
|
|
retries: 5 |
|
|
|
delay: 5 |
|
|
|
|
|
@ -1,9 +1,10 @@ |
|
|
|
--- |
|
|
|
- name: gets the kubeadm version |
|
|
|
- name: Get the kubeadm version |
|
|
|
command: "{{ bin_dir }}/kubeadm version -o short" |
|
|
|
register: kubeadm_output |
|
|
|
changed_when: false |
|
|
|
|
|
|
|
- name: sets kubeadm api version to v1beta2 |
|
|
|
- name: Set kubeadm api version to v1beta2 |
|
|
|
set_fact: |
|
|
|
kubeadmConfig_api_version: v1beta2 |
|
|
|
|
|
|
|
|
|
@ -6,11 +6,12 @@ |
|
|
|
state: directory |
|
|
|
when: dynamic_kubelet_configuration |
|
|
|
|
|
|
|
- name: gets the kubeadm version |
|
|
|
- name: Get the kubeadm version |
|
|
|
command: "{{ bin_dir }}/kubeadm version -o short" |
|
|
|
register: kubeadm_output |
|
|
|
changed_when: false |
|
|
|
|
|
|
|
- name: sets kubelet api version to v1beta1 |
|
|
|
- name: Set kubelet api version to v1beta1 |
|
|
|
set_fact: |
|
|
|
kubeletConfig_api_version: v1beta1 |
|
|
|
tags: |
|
|
|
|
|
@ -18,6 +18,7 @@ |
|
|
|
state: present |
|
|
|
check_mode: yes |
|
|
|
register: os_variant_coreos |
|
|
|
changed_when: false |
|
|
|
|
|
|
|
- name: set is_fedora_coreos |
|
|
|
set_fact: |
|
|
|