Update main.yml

This commit is contained in:
Darren 2022-06-27 09:06:57 +08:00 committed by GitHub
parent bbb776be7b
commit b72ddb1ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
- name: Rename and Run docker-compose - name: Rename and Run docker-compose
shell: | shell: |
docker-compose up -d docker compose up -d
sleep 30 sleep 30
args: args:
chdir: "{{installpath}}/{{appname}}" chdir: "{{installpath}}/{{appname}}"
@ -11,9 +11,9 @@
state: directory state: directory
recurse: yes recurse: yes
with_items: with_items:
- "{{installpath}}/{{appname}}/volumes" - "{{installpath}}/{{appname}}/data"
- name: Set softlink of all volumes - name: Add softlink of all volumes for app root directory
block: block:
- name: Get volumes name - name: Get volumes name
shell: docker-compose config --volumes shell: docker-compose config --volumes
@ -24,7 +24,7 @@
- name: Create softlink of volumes - name: Create softlink of volumes
file: file:
src: "/var/lib/docker/volumes/{{appname}}_{{item}}/_data" src: "/var/lib/docker/volumes/{{appname}}_{{item}}/_data"
dest: "{{installpath}}/{{appname}}/volumes/{{item}}" dest: "{{installpath}}/{{appname}}/data/{{item}}"
state: link state: link
force: yes force: yes
loop: "{{volume_names.stdout_lines}}" loop: "{{volume_names.stdout_lines}}"