Some checks failed
CD - Deploy Infrastructure / Terraform Validation (push) Successful in 17s
CD - Deploy Infrastructure / Deploy on pve1 (push) Successful in 2m12s
CD - Deploy Infrastructure / Deploy on pve2 (push) Successful in 2m11s
CD - Deploy Infrastructure / Deploy on pve3 (push) Successful in 2m28s
CD - Deploy Infrastructure / Validate K3s Cluster (push) Successful in 5m3s
CD - Deploy Infrastructure / Deployment Notification (push) Failing after 1s
- Passage stockage local-nvme pour acemagician et elitedesk (40G) - Token K3S partagé via cloud-init pour cluster HA - Configuration FluxCD avec GitRepository Forgejo - Déploiement Hello World via FluxCD - Manifestes Kubernetes pour application demo
46 lines
1,007 B
YAML
46 lines
1,007 B
YAML
---
|
|
- name: Configure K3s Infrastructure
|
|
hosts: localhost
|
|
connection: local
|
|
become: true
|
|
|
|
vars:
|
|
node_role: >-
|
|
{{
|
|
lookup('file', '/etc/node-role', errors='ignore')
|
|
| default('undefined')
|
|
}}
|
|
|
|
pre_tasks:
|
|
- name: Display node information
|
|
debug:
|
|
msg: "Configuring node {{ ansible_hostname }} with role {{ node_role }}"
|
|
|
|
- name: Validate node role
|
|
assert:
|
|
that:
|
|
- node_role in ['server', 'witness']
|
|
fail_msg: >-
|
|
Invalid node role: {{ node_role }}.
|
|
Expected 'server' or 'witness'
|
|
|
|
- name: Update apt cache
|
|
apt:
|
|
update_cache: true
|
|
cache_valid_time: 3600
|
|
|
|
roles:
|
|
- role: common
|
|
|
|
- role: k3s-server
|
|
when: node_role == 'server'
|
|
|
|
- role: etcd-witness
|
|
when: node_role == 'witness'
|
|
|
|
post_tasks:
|
|
- name: Display completion message
|
|
debug:
|
|
msg: >-
|
|
Configuration complete for
|
|
{{ ansible_hostname }} ({{ node_role }})
|