Add start-service task
This commit is contained in:
parent
e5ab5b2d00
commit
96fd62dc3d
7 changed files with 11 additions and 3 deletions
2
_ansible/.gitignore
vendored
2
_ansible/.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
.vault_pass
|
.vault_pass
|
||||||
inventory/group_vars/all/vault.yml
|
inventory/group_vars/all/serguzim.net.yml
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
4
_ansible/tasks/steps/start-service.yml
Normal file
4
_ansible/tasks/steps/start-service.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- name: Start service
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: docker compose up -d
|
||||||
|
chdir: "{{ service_path }}"
|
Reference in a new issue