Make sure we can copy files correctly to destination
This commit is contained in:
parent
b5af3c9b5d
commit
a9623b63f1
@ -4,5 +4,5 @@ packages:
|
||||
- rsync
|
||||
- wget
|
||||
base_services:
|
||||
- portainer
|
||||
- managers
|
||||
services_configs_dir: ""
|
@ -1,16 +1,18 @@
|
||||
file-servers:
|
||||
file-server:
|
||||
hosts:
|
||||
debianpx:
|
||||
ansible_host: 192.168.122.177
|
||||
ansible_user: gabriel
|
||||
ansible_become: yes
|
||||
ansible_become_method: sudo
|
||||
vars:
|
||||
services_dir: /home/gabriel/hosted
|
||||
services_configs_dir: /home/gabriel/hosted/configs
|
||||
PERSISTENT_DIRECTORY: /home/gabriel/hosted/persistent
|
||||
VOLATILE_DIRECTORY: /home/gabriel/hosted/volatile
|
||||
BACKUPDIR: /home/gabriel/hosted/backup
|
||||
APPSDIR: /home/gabriel/hosted/apps
|
||||
MEDIADIR: /home/gabriel/hosted/media
|
||||
source_services_dir: /home/gabriel/hosted
|
||||
server_services_dir: /home/srv/services/configs
|
||||
PERSISTENT_DIRECTORY: /home/srv/services/persistent
|
||||
# VOLATILE_DIRECTORY: /home/gabriel/hosted/volatile
|
||||
# BACKUPDIR: /home/gabriel/hosted/backup
|
||||
# APPSDIR: /home/gabriel/hosted/apps
|
||||
# MEDIADIR: /home/gabriel/hosted/media
|
||||
|
||||
media-servers:
|
||||
hosts:
|
||||
|
@ -1,12 +1,32 @@
|
||||
---
|
||||
- name: Ensure services destination directory exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ server_services_dir }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: "{{ ansible_user | default('root') }}"
|
||||
group: "{{ ansible_user | default('root') }}"
|
||||
|
||||
- name: Copy service folder
|
||||
ansible.posix.synchronize:
|
||||
src: "{{ services_dir }}/{{ item }}"
|
||||
dest: /services/
|
||||
ansible.builtin.copy:
|
||||
src: "{{ source_services_dir }}/{{ item }}"
|
||||
dest: "{{ server_services_dir }}"
|
||||
mode: '0755'
|
||||
owner: "{{ ansible_user | default('root') }}"
|
||||
group: "{{ ansible_user | default('root') }}"
|
||||
with_items: "{{ services }}"
|
||||
|
||||
- name: Start Docker compose
|
||||
community.docker.docker_compose:
|
||||
project_src: "/services/{{ item }}"
|
||||
environment: "{{ compose_env }}"
|
||||
- name: Docker Compose Start Service
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ server_services_dir }}/{{ item }}"
|
||||
# environment: "{{ compose_env }}"
|
||||
check_files_existing: true
|
||||
assume_yes: true
|
||||
build: policy
|
||||
wait: true
|
||||
register: output
|
||||
with_items: "{{ services }}"
|
||||
async: 300
|
||||
poll: 10
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user