Murat ÖZDEMİR f4b7f49968 chore: prepare prod ansible and db operations
Add the Ansible README and expand prod bootstrap coverage for StorageBox keys, DB labels, DB stack configuration, and act runner setup. Update MongoDB configuration for replica set support and refresh prod roadmap/setup documentation for Swarm labels, StorageBox-backed cert paths, and recovery guidance.
2026-05-15 20:39:57 +03:00

63 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: Prod Environment Bootstrap (Common Roles)
hosts: all
become: yes
roles:
- role: base
tags: [base]
- role: hardening
tags: [hardening]
- role: docker
tags: [docker]
- role: node_dirs
tags: [node_dirs]
- role: storagebox
tags: [storagebox]
- role: storagebox_ssh_key
tags: [storagebox_ssh_key]
- name: Swarm Infrastructure Setup (Prod HA)
hosts: iklim-app-*
become: yes
serial: 1
roles:
- role: swarm
tags: [swarm]
# Prod'da DB node'ları da worker olarak swarm'a katılır
- name: DB Nodes Swarm Join
hosts: iklim-db-*
become: yes
roles:
- role: swarm
tags: [swarm]
# db-index label'ları Patroni node koordinasyonu için gereklidir; Swarm join tamamlandıktan sonra çalışır
- name: Add db-index Labels for Patroni
hosts: iklim-app-01
become: yes
tags: [db_labels]
tasks:
- name: Label DB nodes with db-index
ansible.builtin.command: >
docker node update --label-add db-index={{ item.index }} {{ item.node }}
loop:
- { node: "iklim-db-01", index: "01" }
- { node: "iklim-db-02", index: "02" }
- { node: "iklim-db-03", index: "03" }
ignore_errors: true
- name: DB Node Configuration (MongoDB Config)
hosts: iklim-db-*
become: yes
roles:
- role: db_stack
tags: [db_stack]
- name: Act Runner Setup (App Nodes)
hosts: iklim-app-*
become: yes
roles:
- role: act_runner
tags: [act_runner]