Migrate services part
This commit is contained in:
parent
7c59e4ae57
commit
73bce8f6e5
157 changed files with 3883 additions and 9 deletions
39
roles/backup/tasks/main.yml
Normal file
39
roles/backup/tasks/main.yml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ svc.name }}
|
||||
vars:
|
||||
svc: "{{ backup_svc }}"
|
||||
env: "{{ backup_env }}"
|
||||
compose: "{{ backup_compose }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Copy the main backup script
|
||||
ansible.builtin.template:
|
||||
src: "backup.sh.j2"
|
||||
dest: "{{ (service_path, 'backup.sh') | path_join }}"
|
||||
mode: "0755"
|
||||
|
||||
- name: Import tasks specific to docker
|
||||
ansible.builtin.import_tasks: docker.yml
|
||||
- name: Import tasks specific to the backup.d scripts
|
||||
ansible.builtin.import_tasks: backup.d.yml
|
||||
- name: Import tasks specific to systemd
|
||||
ansible.builtin.import_tasks: systemd.yml
|
||||
|
||||
- name: Build service
|
||||
ansible.builtin.command:
|
||||
cmd: docker compose build --pull
|
||||
chdir: "{{ service_path }}"
|
||||
register: cmd_result
|
||||
when: docker_rebuild
|
||||
changed_when: true
|
||||
|
||||
- name: Verify service
|
||||
ansible.builtin.command:
|
||||
cmd: docker compose run --rm app check
|
||||
chdir: "{{ service_path }}"
|
||||
changed_when: false
|
||||
Loading…
Reference in a new issue