Add start-service task

This commit is contained in:
Tobias Reisinger 2023-06-17 12:00:18 +02:00
parent e5ab5b2d00
commit 96fd62dc3d
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
7 changed files with 11 additions and 3 deletions

2
_ansible/.gitignore vendored
View file

@ -1,2 +1,2 @@
.vault_pass .vault_pass
inventory/group_vars/all/vault.yml inventory/group_vars/all/serguzim.net.yml

View file

@ -3,4 +3,4 @@ all:
local-dev: local-dev:
ansible_connection: local ansible_connection: local
node002: node002:
ansible_connection: local ansible_host: node002.serguzim.net

View file

@ -24,3 +24,4 @@
mode: "0600" mode: "0600"
- import_tasks: steps/template-site-config.yml - import_tasks: steps/template-site-config.yml
- import_tasks: steps/start-service.yml

View file

@ -13,3 +13,5 @@
src: run-once.sh src: run-once.sh
dest: "{{ (service_path, 'run-once.sh') | path_join }}" dest: "{{ (service_path, 'run-once.sh') | path_join }}"
mode: '0755' mode: '0755'
- import_tasks: steps/start-service.yml

View file

@ -17,7 +17,7 @@ svc_env:
compose: compose:
watchtower: false watchtower: false
image: containerrr/watchtower image: containrrr/watchtower
env: true env: true
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -2,3 +2,4 @@
- import_tasks: steps/template-docker-compose.yml - import_tasks: steps/template-docker-compose.yml
- import_tasks: steps/template-service-env.yml - import_tasks: steps/template-service-env.yml
- import_tasks: steps/template-site-config.yml - import_tasks: steps/template-site-config.yml
- import_tasks: steps/start-service.yml

View file

@ -0,0 +1,4 @@
- name: Start service
ansible.builtin.command:
cmd: docker compose up -d
chdir: "{{ service_path }}"