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