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

Versioncheck fix, CIS Fix, add handlers #240

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Increased retries/delay, fixed handlers
  • Loading branch information
Eric-Domeier committed May 28, 2024
commit 299f973a4f6ef1ba71297327712d7d3f66cc94b4
16 changes: 14 additions & 2 deletions roles/rke2_server/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
---
- name: Ensure the RKE2 Service is started
block:
- name: Start RKE2
- name: Attempt to start RKE2
ansible.builtin.systemd:
name: rke2-server
enabled: yes
state: started
register: rke2_service_start
retries: 20
delay: 10
until: rke2_service_start is succeeded
listen: Start RKE2


- name: Wait to ensure the service started correctly
ansible.builtin.pause:
seconds: 20
listen: Start RKE2

- name: Verify rke2-server started
ansible.builtin.systemd:
name: rke2-server
state: started
failed_when: rke2_service_start is failed
listen: Start RKE2
6 changes: 3 additions & 3 deletions roles/rke2_server/tasks/other_servers.yml
Original file line number Diff line number Diff line change
@@ -50,15 +50,15 @@
host: "{{ kubernetes_api_server_host }}"
port: "6443"
state: present
timeout: 300
timeout: 600

- name: Wait for kubelet process to be present on host
ansible.builtin.command: >-
ps -C kubelet -F -ww --no-headers
register: kubelet_check
until: kubelet_check.rc == 0
retries: 20
delay: 10
delay: 30
changed_when: false

- name: Extract the hostname-override parameter from the kubelet process
@@ -75,5 +75,5 @@
register: status_result
until: status_result.stdout.find("True") != -1
retries: 20
delay: 10
delay: 30
changed_when: false