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
parent
commit
a8740c6e13
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 6 deletions
  1. 7
      roles/kubernetes/kubeadm/tasks/main.yml
  2. 2
      roles/kubernetes/master/tasks/kubeadm-setup.yml
  3. 5
      roles/kubernetes/master/tasks/kubeadm-version.yml
  4. 5
      roles/kubernetes/node/tasks/kubelet.yml
  5. 1
      roles/kubernetes/preinstall/tasks/0040-set_facts.yml

7
roles/kubernetes/kubeadm/tasks/main.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

2
roles/kubernetes/master/tasks/kubeadm-setup.yml

@ -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

5
roles/kubernetes/master/tasks/kubeadm-version.yml

@ -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

5
roles/kubernetes/node/tasks/kubelet.yml

@ -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:

1
roles/kubernetes/preinstall/tasks/0040-set_facts.yml

@ -18,6 +18,7 @@
state: present
check_mode: yes
register: os_variant_coreos
changed_when: false
- name: set is_fedora_coreos
set_fact:

Loading…
Cancel
Save