fix: cicd ansible
Deploy bin / deploy (push) Successful in 6s
Deploy, build and restart MASTER / deploy (push) Successful in 3s
Deploy agebd python package / deploy (push) Successful in 2s

This commit is contained in:
Benjamin Labrecque
2026-07-07 18:01:10 +02:00
parent 90b9463340
commit d9d11a6fe8
3 changed files with 13 additions and 30 deletions
+2 -2
View File
@@ -20,11 +20,11 @@ jobs:
run: |
BRANCH="${{ github.ref_name }}"
SERVICE_NAME="${BRANCH#feature/add-service-}"
echo "service_name=$SERVICE_NAME" >> $GITHUB_OUTPUT
echo "new_service_dir_name=$SERVICE_NAME" >> $GITHUB_OUTPUT
- name: Run New Service Playbook
run: |
ansible-playbook ansible/playbooks/add-new-service.yml \
-i ansible/hosts.yml \
--extra-vars="repo_root=${{ github.workspace }} agebd_env=dev service_dir_name=${{ steps.parse_branch.outputs.service_name }}" \
--extra-vars="repo_root=${{ github.workspace }} agebd_env=dev new_service_dir_name=${{ steps.parse_branch.outputs.new_service_dir_name }}" \
-v
+10 -10
View File
@@ -1,17 +1,17 @@
# TODO: Create venv and install ansible? That way not dependent on ansible
# being installed on machine.
- name: Install Master IOC
vars:
ioc_service_name: 000-master
branch_name: "feature/add-service-{{ new_service_dir_name }}"
import_playbook: ../plays/ioc/ioc-install.yml
# - name: Install Master IOC
# vars:
# ioc_service_name: 000-master
# branch_name: "feature/add-service-{{ new_service_dir_name }}"
# import_playbook: ../plays/ioc/ioc-install.yml
- name: Restart Master IOC
vars:
ioc_service_name: 000-master
branch_name: "feature/add-service-{{ new_service_dir_name }}"
import_playbook: ../plays/ioc/ioc-restart.yml
# - name: Restart Master IOC
# vars:
# ioc_service_name: 000-master
# branch_name: "feature/add-service-{{ new_service_dir_name }}"
# import_playbook: ../plays/ioc/ioc-restart.yml
- name: Deploy and Restart Master Service
vars:
@@ -1,27 +1,10 @@
- name: Deploy and Restart Service
# TODO: dev/prod
hosts: sls-vserv-bd-hla01-dev
# connection: local
connection: local
gather_facts: false
vars:
workspace_dir: "/tmp/hla_framework_bd"
tasks:
# Tell Git to bypass the strict ownership check for this specific directory
- name: Whitelist temporary git directory
ansible.builtin.command:
cmd: "git config --global --add safe.directory {{ workspace_dir }}"
# TODO: can remove when running on runner
- name: Clone this repository
ansible.builtin.git:
repo: "git@gitea.psi.ch:sls/hla_framework_bd.git"
dest: "{{ workspace_dir }}"
accept_hostkey: true
version: "{{ branch_name }}"
force: true
- name: Initialize isolated service directory name
ansible.builtin.set_fact:
# Uses ioc_service_name if defined in vars, otherwise falls back to the CLI extra-vars