Update roles/stolon/tasks/main.yml

This commit is contained in:
2025-11-12 16:05:29 +00:00
parent 21d91805ad
commit ebd772665b

View File

@ -51,22 +51,13 @@
environment:
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
- name: reabilitar database stolon
become: yes
become_user: fenix
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 -y '{"initMode":"existing","existingConfig": {"keeperUID": "keeper0","followersUIDs": ["keeper1","keeper2"]}}'
# run this if first time setting up database
# 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 --yes
environment:
KUBECONFIG: /home/fenix/.kube/config
#run this if first time setting up database
#- name: Aplicar o stolon
# become: yes
# become_user: fenix
# 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 --yes
# when: stolon_cluster_check.rc != 0
# environment:
# KUBECONFIG: /home/fenix/.kube/config