Skip to content

Commit

Permalink
fix delivery logic for manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleiner authored Mar 22, 2024
1 parent 8cf5b3d commit f92e46f
Showing 1 changed file with 38 additions and 2 deletions.
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

0 comments on commit f92e46f

Please sign in to comment.