Skip to content

Commit

Permalink
stashing first round of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Leiner committed May 24, 2024
1 parent 9560581 commit ecc60dd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions roles/rke2_common/tasks/add-manifest-addons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

- name: Add manifest addons files
ansible.builtin.copy:
src: "{{ manifest_config_file_path }}"
dest: "/var/lib/rancher/rke2/server/manifests/"
src: "{{ src }}"
dest: "/var/lib/rancher/rke2/server/manifests/ansible_managed_manifests/"
mode: '0640'
owner: root
group: root
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
vars:
file_contents: "{{ lookup('file', pod_security_admission_config_file_path) }}"
ansible.builtin.template:
src: ansible_header.j2
src: templates/ansible_header.j2
dest: "/etc/rancher/rke2/pod-security-admission-config.yaml"
mode: '0640'
owner: root
Expand Down
21 changes: 15 additions & 6 deletions roles/rke2_server/tasks/first_server.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---

- name: Start rke2-server
ansible.builtin.systemd:
name: rke2-server
state: started
enabled: yes

- name: Add manifest files
ansible.builtin.include_role:
name: rke2_common
tasks_from: add-manifest-addons.yml
vars:
src: "{{ manifest_config_file_path }}"
when:
- manifest_config_file_path is defined
- manifest_config_file_path | length > 0

- name: Start rke2-server
ansible.builtin.systemd:
name: rke2-server
state: started
enabled: yes

- name: Wait for k8s apiserver
ansible.builtin.wait_for:
host: localhost
Expand Down Expand Up @@ -47,6 +49,13 @@
delay: 10
changed_when: false

- name: Wait for k8s entrypoint 9345
ansible.builtin.wait_for:
host: "{{ kubernetes_api_server_host }}"
port: "9345"
state: present
timeout: 300

- name: Add generated Token if none provided
block:
- name: Wait for node-token
Expand Down
12 changes: 6 additions & 6 deletions roles/rke2_server/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---

- name: RKE2 agent and server tasks
vars:
rke2_common_caller_role_name: server
ansible.builtin.include_role:
name: rke2_common
tasks_from: main
# - name: RKE2 agent and server tasks
# vars:
# rke2_common_caller_role_name: server
# ansible.builtin.include_role:
# name: rke2_common
# tasks_from: main

- name: Include task file add-pod-security-admission-config.yml
ansible.builtin.include_tasks: add-pod-security-admission-config.yml
Expand Down
File renamed without changes.

0 comments on commit ecc60dd

Please sign in to comment.