Skip to content

Commit

Permalink
BC-7024-fix-undefined-variable
Browse files Browse the repository at this point in the history
Check if WITH_BRANCH_POSTGRES_DB_MANAGEMENT is defined
  • Loading branch information
YannickEvers authored Apr 25, 2024
1 parent 95f6132 commit ac87ebd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ansible/roles/schulcloud-calendar-core/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
kind: Secret
name: "pg-calendar-secret"
register: db_secret_present
when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT
when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT is defined and WITH_BRANCH_POSTGRES_DB_MANAGEMENT

- name: Create Secret for the database (if not existing)
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: secret-database.yml.j2
when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT and db_secret_present.resources|length == 0
when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT is defined and WITH_BRANCH_POSTGRES_DB_MANAGEMENT and db_secret_present.resources|length == 0

- name: Create ConfigMap with database configuration script
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: configmap-database-init.yml.j2
apply: yes
when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT
when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT is defined and WITH_BRANCH_POSTGRES_DB_MANAGEMENT

- name: Create/execute database configuration script
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: job-database-init.yml.j2
when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT
when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT is defined and WITH_BRANCH_POSTGRES_DB_MANAGEMENT

- name: Service
kubernetes.core.k8s:
Expand Down

0 comments on commit ac87ebd

Please sign in to comment.