Lint fixes

Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
Derek Nola 2023-11-07 14:37:27 -08:00
parent 8484c015d6
commit 83de43125b
3 changed files with 8 additions and 7 deletions

View File

@ -12,10 +12,10 @@
hosts: server
become: true
roles:
- role: k3s/server
- role: k3s/server # noqa: role-name[path]
- name: Setup K3S agent
hosts: agent
become: true
roles:
- role: k3s/agent
- role: k3s/agent # noqa: role-name[path]

View File

@ -1,12 +1,13 @@
---
- name: Init first server node
when: ansible_hostname == groups['server'][0]
block:
- name: Start temporary service for HA cluster
ansible.builtin.command:
cmd: >
systemd-run -p RestartSec=2 -p Restart=on-failure --unit=k3s-init k3s server
--cluster-init --tls-san {{ api_endpoint }} --data-dir {{ k3s_server_location }}
{{ extra_server_args}}
--cluster-init --tls-san {{ api_endpoint }} --data-dir {{ k3s_server_location }} {{ extra_server_args}}
# noqa: jinja[spacing]
creates: "{{ k3s_server_location }}/server/node-token"
when: groups['server'] | length > 1
@ -73,7 +74,6 @@
src: ~{{ ansible_user }}/.kube/config
dest: ~/.kube/config
flat: true
when: ansible_hostname == groups['server'][0]
- name: Start other server if any and verify status
block:
@ -88,7 +88,8 @@
- name: Verify that all server nodes joined
ansible.builtin.command:
cmd: k3s kubectl get nodes -l "node-role.kubernetes.io/control-plane=true" -o=jsonpath="{.items[*].metadata.name}"
cmd: >
k3s kubectl get nodes -l "node-role.kubernetes.io/control-plane=true" -o=jsonpath="{.items[*].metadata.name}"
register: nodes
until: nodes.rc == 0 and (nodes.stdout.split() | length) == (groups['server'] | length)
retries: 20

View File

@ -1,7 +1,7 @@
---
- name: Clean previous failed runs of k3s-init
# systemd builtin does not support reset-failed
ansible.builtin.command: systemctl reset-failed k3s-init
ansible.builtin.command: systemctl reset-failed k3s-init # noqa: command-instead-of-module
failed_when: false
changed_when: false