From 6717ddf1d759054d4171301d1f797f251268c235 Mon Sep 17 00:00:00 2001 From: Benjamin Labrecque Date: Tue, 14 Jul 2026 14:48:09 +0200 Subject: [PATCH] fix: cicd change services --- ansible/playbooks/add-new-service.yml | 5 +++-- ansible/playbooks/deploy-and-restart-modified-services.yml | 1 + ansible/tasks/service/service-deploy-and-restart.yml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ansible/playbooks/add-new-service.yml b/ansible/playbooks/add-new-service.yml index 7754900..b12abbe 100644 --- a/ansible/playbooks/add-new-service.yml +++ b/ansible/playbooks/add-new-service.yml @@ -1,11 +1,12 @@ -# TODO: Create venv and install ansible? That way not dependent on ansible -# being installed on machine. --- - name: Add a new service hosts: sls-vserv-bd-hla01-dev connection: local gather_facts: true # Gather once here, available to all included tasks! + vars: + repo_root: "{{ playbook_dir }}/../.." + tasks: # - name: Install Master IOC # vars: diff --git a/ansible/playbooks/deploy-and-restart-modified-services.yml b/ansible/playbooks/deploy-and-restart-modified-services.yml index 44689b5..5a090cf 100644 --- a/ansible/playbooks/deploy-and-restart-modified-services.yml +++ b/ansible/playbooks/deploy-and-restart-modified-services.yml @@ -8,6 +8,7 @@ # Passed from the Gitea workflow, e.g., "master playground" changed_services_raw: "" agebd_env: "dev" + repo_root: "{{ playbook_dir }}/../.." tasks: # Fail early if no services were modified diff --git a/ansible/tasks/service/service-deploy-and-restart.yml b/ansible/tasks/service/service-deploy-and-restart.yml index d567a5a..e8e4555 100644 --- a/ansible/tasks/service/service-deploy-and-restart.yml +++ b/ansible/tasks/service/service-deploy-and-restart.yml @@ -19,7 +19,7 @@ # TODO: make sure this is what we want (essentially wipes existing dest dir) - name: "[{{ target_service_name_lower }}] Sync service deployment files" ansible.posix.synchronize: - src: "{{ playbook_dir }}/../../../services/{{ target_service_name_lower }}/current/" + src: "{{ repo_root }}/services/{{ target_service_name_lower }}/current/" dest: "{{ svc_current_dir }}/" delete: yes # This removes stale files on the target that no longer exist locally recursive: yes