Skip to content

Commit

Permalink
fixing some linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Leiner committed Jun 21, 2024
1 parent 00943bc commit cadd44b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
11 changes: 5 additions & 6 deletions roles/rke2/tasks/cluster_state.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---

- name: Check for existing cluster
when:
- rke2_running is defined
- rke2_running
block:
- name: Check for node-token (existing cluster)
ansible.builtin.stat:
Expand All @@ -18,7 +21,8 @@
ansible.builtin.set_fact:
rke2_config_token: "{{ rke2_config_token_tmp.content | b64decode | regex_replace('\n', '') }}"
when:
- rke2_config_token_tmp.stat.exists
- "rke2_config_token_tmp.content is defined"
- rke2_config_token_tmp.content | length != 0

- name: Set node-token fact on all hosts (existing cluster)
ansible.builtin.set_fact:
Expand All @@ -27,8 +31,6 @@
run_once: true
loop: "{{ groups['all'] }}"
when: "hostvars[item]['rke2_config_token'] is defined"
vars:
rke2_config_token: "{{ rke2_config_token | default('') }}"

- name: Debug found token
ansible.builtin.debug:
Expand All @@ -52,9 +54,6 @@
- hostvars[item]['rke2_kubernetes_api_server_host'] == ""
vars:
rke2_kubernetes_api_server_host: "{{ existing_join_host | default('') }}"
when:
- rke2_running is defined
- rke2_running

- name: No existing cluster found and api server not set
ansible.builtin.set_fact:
Expand Down
2 changes: 0 additions & 2 deletions roles/rke2/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@
when:
- inventory_hostname in groups['rke2_servers'][1:] or
inventory_hostname in groups.get('rke2_agents', [])
when:
- "rke2_config_token is not defined"

- name: Confirm configuration on cluster
when:
Expand Down
1 change: 0 additions & 1 deletion roles/rke2/tasks/pre_reqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@
allow perm=any all : dir=/run/k3s/
allow perm=any all : dir=/var/lib/kubelet/
notify: Restart fapolicyd

0 comments on commit cadd44b

Please sign in to comment.