mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 12:03:59 +00:00
- Moved files from 'prole/' subdirectory to root level or appropriate subdirectories (tests, authority, infrastructure) to flatten the project structure. - Updated 'install.py' and initialization scripts in 'etc/' to reflect the new directory layout. - Added 'etc/repair_pipeline.sh' for automated pipeline repairs. - Updated configuration files including 'conf/prole.cfg' and 'env.sh'. - Integrated ArgoCD manifests in 'k8s/argocd/'. - Updated 'prole-app' environment and properties. - Moved and updated test scripts for better organization and reliability. - Added 'tests/silent_install_test.sh' for automated installation testing.
60 lines
1.8 KiB
YAML
60 lines
1.8 KiB
YAML
---
|
|
- name: Validate k3s API endpoint reachability
|
|
hosts: k3s_hosts
|
|
gather_facts: false
|
|
become: false
|
|
vars:
|
|
k3s_default_port: 6443
|
|
tasks:
|
|
- name: Select k3s init host
|
|
ansible.builtin.set_fact:
|
|
k3s_init_host: "{{ item }}"
|
|
when: hostvars[item].k3s_cluster_init | default(false) | bool
|
|
loop: "{{ groups['k3s_hosts'] }}"
|
|
run_once: true
|
|
|
|
- name: Select k3s server URL (if provided)
|
|
ansible.builtin.set_fact:
|
|
k3s_api_url: "{{ hostvars[item].k3s_server_url }}"
|
|
when:
|
|
- hostvars[item].k3s_server_url is defined
|
|
- hostvars[item].k3s_server_url | length > 0
|
|
loop: "{{ groups['k3s_hosts'] }}"
|
|
run_once: true
|
|
|
|
- name: Fallback to init host URL
|
|
ansible.builtin.set_fact:
|
|
k3s_api_url: "https://{{ k3s_init_host | default(groups['k3s_hosts'][0]) }}:{{ k3s_default_port }}"
|
|
when: k3s_api_url is not defined or k3s_api_url | length == 0
|
|
run_once: true
|
|
|
|
- name: Extract k3s API host
|
|
ansible.builtin.set_fact:
|
|
k3s_api_host: "{{ k3s_api_url | regex_replace('^https?://', '') | regex_replace(':.*$', '') }}"
|
|
run_once: true
|
|
|
|
- name: Check TCP port 6443
|
|
ansible.builtin.wait_for:
|
|
host: "{{ k3s_api_host }}"
|
|
port: "{{ k3s_default_port }}"
|
|
timeout: 10
|
|
delegate_to: localhost
|
|
become: false
|
|
run_once: true
|
|
|
|
- name: Check /readyz endpoint
|
|
ansible.builtin.uri:
|
|
url: "{{ k3s_api_url }}/readyz"
|
|
method: GET
|
|
status_code: [200, 401, 403]
|
|
validate_certs: false
|
|
timeout: 5
|
|
delegate_to: localhost
|
|
become: false
|
|
run_once: true
|
|
|
|
- name: Report k3s API endpoint
|
|
ansible.builtin.debug:
|
|
msg: "k3s API reachable at {{ k3s_api_url }}"
|
|
run_once: true
|