Skip to content

Commit

Permalink
Use FQCN for builtin actions
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Brookman <[email protected]>
  • Loading branch information
bcbrookman authored and dereknola committed Nov 7, 2023
1 parent 19ff7b5 commit 7ec3049
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions roles/k3s/master/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
- name: Clean previous runs of k3s-init
systemd:
ansible.builtin.systemd:
name: k3s-init
state: stopped
failed_when: false

- name: Clean previous runs of k3s-init

Check warning on line 8 in roles/k3s/master/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

args[module]

Unsupported parameters for (basic.py) module: warn. Supported parameters include: _raw_params, _uses_shell, argv, chdir, creates, executable, removes, stdin, stdin_add_newline, strip_empty_ends.
command: systemctl reset-failed k3s-init
ansible.builtin.command: systemctl reset-failed k3s-init
failed_when: false
changed_when: false
args:
warn: false # The ansible systemd module does not support reset-failed

- name: Init cluster inside the transient k3s-init service

Check warning on line 15 in roles/k3s/master/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

args[module]

Unsupported parameters for (basic.py) module: warn. Supported parameters include: _raw_params, _uses_shell, argv, chdir, creates, executable, removes, stdin, stdin_add_newline, strip_empty_ends.
command:
ansible.builtin.command:
cmd: "systemd-run -p RestartSec=2 \
-p Restart=on-failure \
--unit=k3s-init \
Expand All @@ -25,7 +25,7 @@
- name: Verification
block:
- name: Verify that all nodes actually joined (check k3s-init.service if this fails)
command:
ansible.builtin.command:
cmd: k3s kubectl get nodes -l "node-role.kubernetes.io/master=true" -o=jsonpath="{.items[*].metadata.name}"
register: nodes
until: nodes.rc == 0 and (nodes.stdout.split() | length) == (groups['master'] | length)
Expand All @@ -34,7 +34,7 @@
changed_when: false
always:
- name: Kill the temporary service used for initialization
systemd:
ansible.builtin.systemd:
name: k3s-init
state: stopped
failed_when: false
Expand All @@ -61,17 +61,17 @@

- name: Register node-token file access mode
ansible.builtin.stat:
path: "{{ k3s_server_location }}/server/node-token"
path: "{{ k3s_server_location }}/server"
register: p

- name: Change file access node-token
ansible.builtin.file:
path: "{{ k3s_server_location }}/server/node-token"
path: "{{ k3s_server_location }}/server"
mode: "g+rx,o+rx"

- name: Read node-token from master
ansible.builtin.slurp:
path: "{{ k3s_server_location }}/server/node-token"
src: "{{ k3s_server_location }}/server/node-token"
register: node_token

- name: Store Master node-token
Expand All @@ -80,7 +80,7 @@

- name: Restore node-token file access
ansible.builtin.file:
path: "{{ k3s_server_location }}/server/node-token"
path: "{{ k3s_server_location }}/server"
mode: "{{ p.stat.mode }}"

- name: Create directory .kube
Expand Down

0 comments on commit 7ec3049

Please sign in to comment.