rqlite functional

This commit is contained in:
Bartal Læarsson
2025-03-03 14:21:57 +00:00
parent 0312778ef4
commit 7b4bed7047
4 changed files with 37 additions and 19 deletions
+22 -12
View File
@@ -1,22 +1,17 @@
---
# ansible/playbooks/rqlite.yml
#- name: Common configuration for all rqlite nodes
# hosts: rqlite_cluster
# become: yes
# vars_files:
# - ../defaults/rqlite.yml
# tags:
# - common
# tasks:
# - include_tasks: ../tasks/rqlite/setup-hosts.yml
# - include_tasks: ../tasks/rqlite/update-dns.yml
# - include_tasks: ../tasks/rqlite/ssh.yml
- name: Setup all rqlite nodes
hosts: rqlite_cluster
become: yes
vars_files:
- ../defaults/rqlite.yml
vars:
# Explicitly define the node list and leader
rqlite_node_list:
- rqlite1
- rqlite2
- rqlite3
rqlite_leader_node: rqlite1
tags:
- rqlite-setup
tasks:
@@ -27,6 +22,13 @@
become: yes
vars_files:
- ../defaults/rqlite.yml
vars:
node_id: 1
rqlite_node_list:
- rqlite1
- rqlite2
- rqlite3
rqlite_leader_node: rqlite1
tags:
- leader
tasks:
@@ -37,6 +39,14 @@
become: yes
vars_files:
- ../defaults/rqlite.yml
vars:
# Dynamically calculate node ID for followers
node_id: "{{ rqlite_node_list.index(inventory_hostname) + 2 }}"
rqlite_node_list:
- rqlite1
- rqlite2
- rqlite3
rqlite_leader_node: rqlite1
tags:
- followers
tasks: