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

allowing templates to be applied AFTER the cluster is fully up #181

Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions roles/cluster_manifest/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
kubernetes_api_server_host: "{{ hostvars[groups['rke2_servers'][0]].inventory_hostname }}"

Check warning on line 2 in roles/cluster_manifest/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Lint for push

var-naming[no-role-prefix]

Variables names from within roles should use cluster_manifest_ as a prefix. (vars: kubernetes_api_server_host)

Check warning on line 2 in roles/cluster_manifest/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Lint for PR

var-naming[no-role-prefix]

Variables names from within roles should use cluster_manifest_ as a prefix. (vars: kubernetes_api_server_host)

Check warning on line 2 in roles/cluster_manifest/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Lint for PR

var-naming[no-role-prefix]

Variables names from within roles should use cluster_manifest_ as a prefix. (vars: kubernetes_api_server_host)
aleiner marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 13 additions & 0 deletions roles/cluster_manifest/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---

- name: Add cluster manifest addons files
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
1 change: 1 addition & 0 deletions roles/cluster_manifest/vars/main.yml
aleiner marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
7 changes: 7 additions & 0 deletions site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@
roles:
- role: rke2_agent
serial: 3

- name: Cluster manifest play
hosts: rke2_servers
any_errors_fatal: true
become: true
roles:
- role: cluster_manifest
Loading