Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: static pods should be deployed to all control nodes #207

Merged
merged 1 commit into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: static pods should be deployed to all control nodes
Signed-off-by: Devin Buhl <devin@buhl.casa>
  • Loading branch information
onedr0p committed Jun 1, 2023
commit 3f1d2da21b2a46898a837356156e556d58be9478
18 changes: 13 additions & 5 deletions tasks/ensure_k3s_auto_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
path: "{{ k3s_server_manifests_dir }}"
mode: 0755
when: >-
k3s_server_manifests_templates | length > 0
or k3s_server_manifests_urls | length > 0
k3s_primary_control_node and
(k3s_server_manifests_templates | length > 0
or k3s_server_manifests_urls | length > 0)
become: "{{ k3s_become }}"

- name: Ensure that the pod-manifests directory exists
Expand All @@ -16,8 +17,9 @@
path: "{{ k3s_server_pod_manifests_dir }}"
mode: 0755
when: >-
k3s_server_pod_manifests_templates | length > 0
or k3s_server_pod_manifests_urls | length > 0
k3s_control_node and
(k3s_server_pod_manifests_templates | length > 0
or k3s_server_pod_manifests_urls | length > 0)
become: "{{ k3s_become }}"

# https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests
Expand All @@ -29,6 +31,7 @@
loop: "{{ k3s_server_manifests_templates }}"
become: "{{ k3s_become }}"
when:
- k3s_primary_control_node
- k3s_server_manifests_templates | length > 0

- name: Ensure auto-deploying manifests are downloaded to the primary controller
Expand All @@ -39,6 +42,7 @@
loop: "{{ k3s_server_manifests_urls }}"
become: "{{ k3s_become }}"
when:
- k3s_primary_control_node
- not ansible_check_mode
- k3s_server_manifests_urls | length > 0

Expand All @@ -50,6 +54,8 @@
mode: 0644
loop: "{{ k3s_server_pod_manifests_templates }}"
become: "{{ k3s_become }}"
when:
- k3s_control_node

# https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests
- name: Ensure auto-deploying manifests are downloaded to the primary controller
Expand All @@ -59,4 +65,6 @@
mode: 0644
loop: "{{ k3s_server_pod_manifests_urls }}"
become: "{{ k3s_become }}"
when: not ansible_check_mode
when:
- k3s_control_node
- not ansible_check_mode
2 changes: 0 additions & 2 deletions tasks/state_installed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

- name: Run auto-deploy manifests and pod manifests tasks
ansible.builtin.import_tasks: ensure_k3s_auto_deploy.yml
when:
- k3s_primary_control_node

- name: Ensure k3s configuration files are copied to controllers and agents
ansible.builtin.import_tasks: ensure_k3s_config_files.yml
Expand Down
Loading