--- # brf-postgres.yml — BRF Stack uzerinde yonetilen PostgreSQL olusturur. # Gereksinim: ansible-galaxy collection install kubernetes.core && pip install kubernetes # Calistirma: export BRF_API_KEY=brf__ && ansible-playbook brf-postgres.yml - name: BRF Stack ile PostgreSQL hosts: localhost gather_facts: false vars: brf_api_key: "{{ lookup('env', 'BRF_API_KEY') }}" brf_realm: "{{ brf_api_key.split('_')[1] }}" tasks: - name: API anahtarini kisa omurlu erisim tokenina cevir ansible.builtin.uri: url: "https://{{ brf_realm }}.stack.brf.sh/api/token" method: POST headers: Authorization: "Bearer {{ brf_api_key }}" return_content: true register: brf_token - name: Yonetilen PostgreSQL olustur kubernetes.core.k8s: host: "{{ brf_token.json.api_server }}" api_key: "{{ brf_token.json.token }}" validate_certs: false state: present definition: apiVersion: apps.cozystack.io/v1alpha1 kind: Postgres metadata: name: appdb namespace: "{{ brf_token.json.namespace }}" spec: size: 10Gi replicas: 2 users: appuser: password: "guclu-parola-degistirin" databases: app: roles: admin: [appuser]