From cb63b74dd116f94092cfff8af80c0b7c19d21a6d Mon Sep 17 00:00:00 2001 From: mamutmk5 <3045922+mamutmk5@users.noreply.github.com> Date: Fri, 16 Aug 2024 15:30:41 +0200 Subject: [PATCH] BC-7854 - add ansible tags --- .github/workflows/push.yml | 2 +- .../schulcloud-calendar-core/tasks/main.yml | 16 ++++++++++++++++ .../schulcloud-calendar-init/tasks/main.yml | 10 ++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d723eb2..20a1b9a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -80,7 +80,7 @@ jobs: needs: - build_and_push - branch_meta - uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/deploy.yml@main + uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/deploy.yml@BC-7854-ansible-tags with: branch: ${{ needs.branch_meta.outputs.branch }} secrets: diff --git a/ansible/roles/schulcloud-calendar-core/tasks/main.yml b/ansible/roles/schulcloud-calendar-core/tasks/main.yml index c8e1c39..3f22cf9 100644 --- a/ansible/roles/schulcloud-calendar-core/tasks/main.yml +++ b/ansible/roles/schulcloud-calendar-core/tasks/main.yml @@ -6,6 +6,8 @@ name: "pg-calendar-secret" register: db_secret_present when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT is defined and WITH_BRANCH_POSTGRES_DB_MANAGEMENT + tags: + - 1password - name: Create Secret for the database (if not existing) kubernetes.core.k8s: @@ -13,6 +15,8 @@ namespace: "{{ NAMESPACE }}" template: secret-database.yml.j2 when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT is defined and WITH_BRANCH_POSTGRES_DB_MANAGEMENT and db_secret_present.resources|length == 0 + tags: + - 1password - name: Create ConfigMap with database configuration script kubernetes.core.k8s: @@ -21,6 +25,8 @@ template: configmap-database-init.yml.j2 apply: yes when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT is defined and WITH_BRANCH_POSTGRES_DB_MANAGEMENT + tags: + - configmap - name: Create/execute database configuration script kubernetes.core.k8s: @@ -28,12 +34,16 @@ namespace: "{{ NAMESPACE }}" template: job-database-init.yml.j2 when: WITH_BRANCH_POSTGRES_DB_MANAGEMENT is defined and WITH_BRANCH_POSTGRES_DB_MANAGEMENT + tags: + - job - name: Service kubernetes.core.k8s: kubeconfig: ~/.kube/config namespace: "{{ NAMESPACE }}" template: svc.yml.j2 + tags: + - service - name: Configmap kubernetes.core.k8s: @@ -41,6 +51,8 @@ namespace: "{{ NAMESPACE }}" template: configmap.yml.j2 apply: yes + tags: + - configmap - name: Secret by 1Password kubernetes.core.k8s: @@ -48,6 +60,8 @@ namespace: "{{ NAMESPACE }}" template: onepassword.yml.j2 when: ONEPASSWORD_OPERATOR is defined and ONEPASSWORD_OPERATOR|bool + tags: + - 1password - name: Deployment @@ -55,3 +69,5 @@ kubeconfig: ~/.kube/config namespace: "{{ NAMESPACE }}" template: deployment.yml.j2 + tags: + - deployment diff --git a/ansible/roles/schulcloud-calendar-init/tasks/main.yml b/ansible/roles/schulcloud-calendar-init/tasks/main.yml index 1c842b2..6297554 100644 --- a/ansible/roles/schulcloud-calendar-init/tasks/main.yml +++ b/ansible/roles/schulcloud-calendar-init/tasks/main.yml @@ -4,6 +4,8 @@ namespace: "{{ NAMESPACE }}" template: configmap_file_init_db.yml.j2 when: WITH_CALENDAR_INIT + tags: + - configmap - name: Calendar db init job config map kubernetes.core.k8s: @@ -14,6 +16,8 @@ kind: ConfigMap name: calendar-db-init-file when: not WITH_CALENDAR_INIT + tags: + - configmap - name: Test if init job exists kubernetes.core.k8s_info: @@ -24,6 +28,8 @@ name: calendar-db-init-job register: calendar_init_job_present when: WITH_CALENDAR_INIT + tags: + - job - name: Calendar db init job kubernetes.core.k8s: @@ -31,6 +37,8 @@ namespace: "{{ NAMESPACE }}" template: job_init_db.yml.j2 when: WITH_CALENDAR_INIT and calendar_init_job_present.resources|length == 0 + tags: + - job - name: Calendar db init job kubernetes.core.k8s: @@ -41,3 +49,5 @@ kind: Job name: calendar-db-init-job when: not WITH_CALENDAR_INIT + tags: + - job