Update roles/stolon/tasks/main.yml

This commit is contained in:
2025-11-06 21:33:23 +00:00
parent d047d1da32
commit fee0b08777

View File

@ -51,11 +51,20 @@
environment: environment:
KUBECONFIG: /home/fenix/.kube/config KUBECONFIG: /home/fenix/.kube/config
- name: Verificar se o cluster Stolon já existe
shell: kubectl get configmap -n postgresql kube-stolon
register: stolon_cluster_check
failed_when: false
changed_when: false
become_user: fenix
environment:
KUBECONFIG: /home/fenix/.kube/config
- name: Aplicar o stolon - name: Aplicar o stolon
become: yes become: yes
become_user: fenix become_user: fenix
shell: | shell: |
kubectl run -i -n=postgresql -t stolonctl --image=sorintlab/stolon:master-pg15 --restart=Never --rm -- /usr/local/bin/stolonctl --cluster-name=kube-stolon --store-backend=kubernetes --kube-resource-kind=configmap init kubectl run -i -n=postgresql -t stolonctl --image=sorintlab/stolon:master-pg15 --restart=Never --rm -- /usr/local/bin/stolonctl --cluster-name=kube-stolon --store-backend=kubernetes --kube-resource-kind=configmap init
when: stolon_cluster_check.rc != 0environment:
environment: environment:
KUBECONFIG: /home/fenix/.kube/config KUBECONFIG: /home/fenix/.kube/config