Skip to content

Commit

Permalink
Fix indentation error with task that removes the pg pvc
Browse files Browse the repository at this point in the history
- Fix typo when referencing replicas
- Scale up pods after upgrade
- Removed unneeded default for upgraded_postgres_version variable
  • Loading branch information
rooftopcellist committed Mar 11, 2024
1 parent 48eeafc commit ebe9a42
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion roles/galaxy-status/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
postgres_migrated_from_secret: ''
upgraded_postgres_version: ''

ingress_type: none

Expand Down
1 change: 0 additions & 1 deletion roles/galaxy-status/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
upgradedPostgresVersion: "{{ upgraded_postgres_version | string }}"
when:
- upgraded_postgres_version is defined
- upgraded_postgres_version | length

- name: Get the resource pod information.
k8s_info:
Expand Down
27 changes: 14 additions & 13 deletions roles/postgres/tasks/upgrade_postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@
namespace: "{{ ansible_operator_meta.namespace }}"
name: "{{ item }}"
state: absent
loop:
- "postgres-{{ ansible_operator_meta.name }}-postgres-0"
- "postgres-{{ ansible_operator_meta.name }}-postgres-13-0"
loop:
- "postgres-{{ ansible_operator_meta.name }}-postgres-0"
- "postgres-{{ ansible_operator_meta.name }}-postgres-13-0"
when:
- not postgres_keep_pvc_after_upgrade

Expand All @@ -324,21 +324,22 @@
status: "True"
lastTransitionTime: "{{ lookup('pipe', 'date --iso-8601=seconds') }}"

- name: Scale up web and content Deployments using replicas from the Galaxy CR
# Default to 1 replica if not specified
- name: Scale up web and content Deployments using replicas from the custom resource
kubernetes.core.k8s_scale:
api_version: apps/v1
api_version: v1
kind: Deployment
name: "{{ item.name }}"
namespace: "{{ ansible_operator_meta.namespace }}"
replicas: "{{ item.replicas }}"
wait: yes
loop:
- name: "{{ ansible_operator_meta.name }}-api"
replicas: "{{ combined_api.replicas | default(1) }}"
- name: "{{ ansible_operator_meta.name }}-web"
replicas: "{{ cr_spec['web']['replicas'] }}"
replicas: "{{ combined_web.replicas | default(1)}}"
- name: "{{ ansible_operator_meta.name }}-content"
replicas: "{{ cr_spec['content']['replicas'] }}"
when:
- combined_web.replicas is defined
- combined_web.replicas | int > 0
- combined_content.replicas is defined
- combined_content.replicas | int > 0
replicas: "{{ combined_content.replicas | default(1) }}"
- name: "{{ ansible_operator_meta.name }}-worker"
replicas: "{{ combined_worker.replicas | default(1)}}"
- name: "{{ ansible_operator_meta.name }}-redis"
replicas: "{{ combined_redis.replicas | default(1)}}"

0 comments on commit ebe9a42

Please sign in to comment.