Skip to content

Commit 08a04f1

Browse files
author
Joshua Hemmings
committed
Fix indenting
1 parent 7ad3a4f commit 08a04f1

File tree

2 files changed

+57
-59
lines changed

2 files changed

+57
-59
lines changed

tasks/first_server.yml

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
- name: Create the RKE2 config dir
43
ansible.builtin.file:
54
state: directory
@@ -118,15 +117,15 @@
118117
changed_when: false
119118
register: node_status
120119
until:
121-
- '"kubelet has sufficient memory available" in node_status.stdout_lines'
122-
- '"kubelet has no disk pressure" in node_status.stdout_lines'
123-
- '"kubelet has sufficient PID available" in node_status.stdout_lines'
124-
- ('"cni plugin not initialized" in node_status.stdout' or '"kubelet is posting ready status." in node_status.stdout')
120+
- '"kubelet has sufficient memory available" in node_status.stdout_lines'
121+
- '"kubelet has no disk pressure" in node_status.stdout_lines'
122+
- '"kubelet has sufficient PID available" in node_status.stdout_lines'
123+
- ('"cni plugin not initialized" in node_status.stdout' or '"kubelet is posting ready status." in node_status.stdout')
125124
retries: 100
126125
delay: 15
127126
when:
128-
- not ansible_check_mode
129-
- rke2_cni == 'none'
127+
- not ansible_check_mode
128+
- rke2_cni == 'none'
130129

131130
- name: Wait for the first server be ready - with CNI
132131
ansible.builtin.shell: |
@@ -136,13 +135,12 @@
136135
executable: /bin/bash
137136
changed_when: false
138137
register: first_server
139-
until:
140-
'" Ready " in first_server.stdout'
138+
until: '" Ready " in first_server.stdout'
141139
retries: 40
142140
delay: 15
143141
when:
144-
- not ansible_check_mode
145-
- rke2_cni != 'none'
142+
- not ansible_check_mode
143+
- rke2_cni != 'none'
146144

147145
- name: Restore etcd
148146
when: do_etcd_restore is defined or do_etcd_restore_from_s3 is defined
@@ -162,7 +160,7 @@
162160
run_once: true
163161
register: node_names
164162

165-
- name: remove old <node>.node-password.rke2 secrets
163+
- name: Remove old <node>.node-password.rke2 secrets
166164
ansible.builtin.shell: |
167165
{{ rke2_data_path }}/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml \
168166
delete secret {{ item }}.node-password.rke2 -n kube-system 2>&1 || true
@@ -171,7 +169,7 @@
171169
with_items: "{{ registered_node_names.stdout_lines | difference(node_names) }}"
172170
changed_when: false
173171

174-
- name: remove old nodes
172+
- name: Remove old nodes
175173
ansible.builtin.shell: |
176174
{{ rke2_data_path }}/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml \
177175
delete node {{ item }} 2>&1 || true

tasks/rke2.yml

+46-46
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
checksum: "sha256:{{ rke2_artifact_url }}/{{ rke2_version }}/sha256sum-{{ rke2_architecture }}.txt"
4646
timeout: 30
4747
with_items: "{{ rke2_artifact | reject('search', 'sha256sum') | list }}"
48-
rescue:
48+
rescue:
4949
- name: "Remote downloading failed: Downloading locally and pushing to remote hosts"
5050
ansible.builtin.pause: # Slight delay to make sure you know it's gonna happen and have time to cancel
5151
seconds: 7
@@ -122,7 +122,7 @@
122122
- name: Register artifacts
123123
ansible.builtin.stat:
124124
path: "{{ rke2_artifact_path }}/{{ item }}"
125-
with_items: "{{ rke2_artifact }}"
125+
with_items: "{{ rke2_artifact }}"
126126
register: artifacts
127127
- name: Register install script
128128
ansible.builtin.stat:
@@ -211,25 +211,25 @@
211211
- name: Run RKE2 install script
212212
when: rke2_version != installed_version
213213
block:
214-
- name: Run the script with airgap variables
215-
ansible.builtin.command:
216-
cmd: "{{ rke2_install_script_dir }}/rke2.sh"
217-
environment:
218-
INSTALL_RKE2_ARTIFACT_PATH: "{{ rke2_artifact_path }}"
219-
INSTALL_RKE2_AGENT_IMAGES_DIR: "{{ rke2_data_path }}/agent/images"
220-
INSTALL_RKE2_METHOD: "{{ rke2_method }}"
221-
changed_when: false
222-
when: rke2_airgap_mode
223-
- name: Run RKE2 script without airgap variables
224-
ansible.builtin.command:
225-
cmd: "{{ rke2_install_script_dir }}/rke2.sh"
226-
environment:
227-
INSTALL_RKE2_VERSION: "{{ rke2_version }}"
228-
INSTALL_RKE2_CHANNEL_URL: "{{ rke2_channel_url }}"
229-
INSTALL_RKE2_CHANNEL: "{{ rke2_channel }}"
230-
INSTALL_RKE2_METHOD: "{{ rke2_method }}"
231-
changed_when: false
232-
when: not ansible_check_mode and not rke2_airgap_mode
214+
- name: Run the script with airgap variables
215+
ansible.builtin.command:
216+
cmd: "{{ rke2_install_script_dir }}/rke2.sh"
217+
environment:
218+
INSTALL_RKE2_ARTIFACT_PATH: "{{ rke2_artifact_path }}"
219+
INSTALL_RKE2_AGENT_IMAGES_DIR: "{{ rke2_data_path }}/agent/images"
220+
INSTALL_RKE2_METHOD: "{{ rke2_method }}"
221+
changed_when: false
222+
when: rke2_airgap_mode
223+
- name: Run RKE2 script without airgap variables
224+
ansible.builtin.command:
225+
cmd: "{{ rke2_install_script_dir }}/rke2.sh"
226+
environment:
227+
INSTALL_RKE2_VERSION: "{{ rke2_version }}"
228+
INSTALL_RKE2_CHANNEL_URL: "{{ rke2_channel_url }}"
229+
INSTALL_RKE2_CHANNEL: "{{ rke2_channel }}"
230+
INSTALL_RKE2_METHOD: "{{ rke2_method }}"
231+
changed_when: false
232+
when: not ansible_check_mode and not rke2_airgap_mode
233233

234234
- name: Copy Custom Manifests
235235
ansible.builtin.template:
@@ -244,31 +244,31 @@
244244
- name: Create /server/manifests directory
245245
when: rke2_custom_manifests or rke2_static_pods
246246
block:
247-
- name: Create directory
248-
ansible.builtin.file:
249-
path: "{{ rke2_data_path }}/server/manifests"
250-
state: directory
251-
mode: 0755
252-
- name: Copy Custom Manifests
253-
ansible.builtin.template:
254-
src: "{{ item }}"
255-
dest: "{{ rke2_data_path }}/server/manifests/{{ item | basename | regex_replace('\\.j2$', '') }}"
256-
owner: root
257-
group: root
258-
mode: 0644
259-
with_fileglob: "{{ rke2_custom_manifests }}/*"
260-
when:
261-
- rke2_custom_manifests
262-
- inventory_hostname == groups[rke2_servers_group_name].0
263-
- name: Copy Static Pods
264-
ansible.builtin.copy:
265-
src: "{{ item }}"
266-
dest: "{{ rke2_data_path }}/agent/pod-manifests/{{ item | basename | regex_replace('\\.j2$', '') }}"
267-
owner: root
268-
group: root
269-
mode: 0644
270-
with_fileglob: "{{ rke2_static_pods }}/*"
271-
when: rke2_static_pods
247+
- name: Create directory
248+
ansible.builtin.file:
249+
path: "{{ rke2_data_path }}/server/manifests"
250+
state: directory
251+
mode: 0755
252+
- name: Copy Custom Manifests
253+
ansible.builtin.template:
254+
src: "{{ item }}"
255+
dest: "{{ rke2_data_path }}/server/manifests/{{ item | basename | regex_replace('\\.j2$', '') }}"
256+
owner: root
257+
group: root
258+
mode: 0644
259+
with_fileglob: "{{ rke2_custom_manifests }}/*"
260+
when:
261+
- rke2_custom_manifests
262+
- inventory_hostname == groups[rke2_servers_group_name].0
263+
- name: Copy Static Pods
264+
ansible.builtin.copy:
265+
src: "{{ item }}"
266+
dest: "{{ rke2_data_path }}/agent/pod-manifests/{{ item | basename | regex_replace('\\.j2$', '') }}"
267+
owner: root
268+
group: root
269+
mode: 0644
270+
with_fileglob: "{{ rke2_static_pods }}/*"
271+
when: rke2_static_pods
272272

273273
- name: Copy RKE2 environment file
274274
ansible.builtin.template:

0 commit comments

Comments
 (0)