diff --git a/_ansible/.gitignore b/_ansible/.gitignore index 54bef05..ba61754 100644 --- a/_ansible/.gitignore +++ b/_ansible/.gitignore @@ -1,2 +1,2 @@ .vault_pass -inventory/group_vars/all/vault.yml +inventory/group_vars/all/serguzim.net.yml diff --git a/_ansible/inventory/serguzim.net.yml b/_ansible/inventory/serguzim.net.yml index dacd917..b372174 100644 --- a/_ansible/inventory/serguzim.net.yml +++ b/_ansible/inventory/serguzim.net.yml @@ -3,4 +3,4 @@ all: local-dev: ansible_connection: local node002: - ansible_connection: local + ansible_host: node002.serguzim.net diff --git a/_ansible/roles/acme-dns/tasks/main.yml b/_ansible/roles/acme-dns/tasks/main.yml index 57a948a..ccb52fd 100644 --- a/_ansible/roles/acme-dns/tasks/main.yml +++ b/_ansible/roles/acme-dns/tasks/main.yml @@ -24,3 +24,4 @@ mode: "0600" - import_tasks: steps/template-site-config.yml + - import_tasks: steps/start-service.yml diff --git a/_ansible/roles/watchtower/tasks/main.yml b/_ansible/roles/watchtower/tasks/main.yml index 341ee8a..21ba062 100644 --- a/_ansible/roles/watchtower/tasks/main.yml +++ b/_ansible/roles/watchtower/tasks/main.yml @@ -13,3 +13,5 @@ src: run-once.sh dest: "{{ (service_path, 'run-once.sh') | path_join }}" mode: '0755' + + - import_tasks: steps/start-service.yml diff --git a/_ansible/roles/watchtower/vars/main.yml b/_ansible/roles/watchtower/vars/main.yml index a9769b3..a1549c0 100644 --- a/_ansible/roles/watchtower/vars/main.yml +++ b/_ansible/roles/watchtower/vars/main.yml @@ -17,7 +17,7 @@ svc_env: compose: watchtower: false - image: containerrr/watchtower + image: containrrr/watchtower env: true volumes: - /var/run/docker.sock:/var/run/docker.sock diff --git a/_ansible/tasks/deploy-common-service.yml b/_ansible/tasks/deploy-common-service.yml index e02647f..661de01 100644 --- a/_ansible/tasks/deploy-common-service.yml +++ b/_ansible/tasks/deploy-common-service.yml @@ -2,3 +2,4 @@ - import_tasks: steps/template-docker-compose.yml - import_tasks: steps/template-service-env.yml - import_tasks: steps/template-site-config.yml +- import_tasks: steps/start-service.yml diff --git a/_ansible/tasks/steps/start-service.yml b/_ansible/tasks/steps/start-service.yml new file mode 100644 index 0000000..412acd4 --- /dev/null +++ b/_ansible/tasks/steps/start-service.yml @@ -0,0 +1,4 @@ +- name: Start service + ansible.builtin.command: + cmd: docker compose up -d + chdir: "{{ service_path }}"