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 delivery logic for manifests #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
40 changes: 38 additions & 2 deletions roles/cluster_manifest/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,48 @@
---

#- name: Add cluster manifest addons files

Check warning on line 3 in roles/cluster_manifest/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint for push

3:2 [comments] missing starting space in comment

Check warning on line 3 in roles/cluster_manifest/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint for PR

3:2 [comments] missing starting space in comment

Check warning on line 3 in roles/cluster_manifest/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint for PR

3:2 [comments] missing starting space in comment
# ansible.builtin.copy:
# src: "{{ cluster_manifest_config_file_path }}"
# dest: "/var/lib/rancher/rke2/server/manifests/"
# mode: '0640'
# owner: root
# group: root
# when:
# - inventory_hostname in groups['rke2_servers'][0]
# - cluster_manifest_config_file_path is defined
# - cluster_manifest_config_file_path | length > 0

- name: Find yaml files
ansible.builtin.find:
paths: "{{ cluster_manifest_config_file_path }}"
file_type: file
recurse: No

Check warning on line 19 in roles/cluster_manifest/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint for push

19:14 [truthy] truthy value should be one of [false, no, true, yes]

Check warning on line 19 in roles/cluster_manifest/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint for PR

19:14 [truthy] truthy value should be one of [false, no, true, yes]

Check warning on line 19 in roles/cluster_manifest/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint for PR

19:14 [truthy] truthy value should be one of [false, no, true, yes]
patterns: "*yaml"
register: files_matched
delegate_to: localhost
when:
- inventory_hostname in groups['rke2_servers'][0]
- cluster_manifest_config_file_path is defined
- cluster_manifest_config_file_path | length > 0


- name: Set manifest_file_list for other hosts
ansible.builtin.set_fact:
manifest_file_list: "{{files_matched}}"
delegate_to: localhost

- name: Print manifest_file_list
ansible.builtin.debug:
msg: "{{ manifest_file_list }}"

Check failure on line 36 in roles/cluster_manifest/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint for push

36:10 [colons] too many spaces after colon

Check failure on line 36 in roles/cluster_manifest/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint for PR

36:10 [colons] too many spaces after colon

Check failure on line 36 in roles/cluster_manifest/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint for PR

36:10 [colons] too many spaces after colon

- name: Add cluster manifest addons files
ansible.builtin.copy:
src: "{{ cluster_manifest_config_file_path }}"
dest: "/var/lib/rancher/rke2/server/manifests/"
src: "{{ item.path }}"
dest: "/var/lib/rancher/rke2/server/manifests/cluster_manifests/"
mode: '0640'
owner: root
group: root
with_items: "{{manifest_file_list.files}}"
when:
- inventory_hostname in groups['rke2_servers'][0]
- cluster_manifest_config_file_path is defined
Expand Down
Loading