Update main.yml

This commit is contained in:
qiaofeng1227 2022-05-11 12:03:37 +08:00 committed by GitHub
parent 3bfab2ef40
commit 9eac7fc284
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,43 +1,3 @@
- name: Delete discuzq dir for sec_installation
shell: rm -rf {{discuzq_root_directory}}
- name: Clone DiscuzQ in Websoft9
git:
repo: "{{discuzq_git_url}}"
dest: "{{discuzq_root_directory}}"
- name: Rename and Run docker-compose
shell: |
docker-compose up -d
sleep 30
args:
chdir: "{{discuzq_root_directory}}"
- name: Recursively create directory for DiscuzQ
file:
path: "{{ item }}"
state: directory
recurse: yes
with_items:
- "{{discuzq_root_directory}}/volumes"
- "/data/db/mysql"
- name: Create docker self volumes to DiscuzQ
file:
src: "{{item.src}}"
dest: "{{item.dest}}"
state: link
force: yes
with_items:
- {src: "/var/lib/docker/volumes/discuzq_discuzq/_data", dest: "{{discuzq_root_directory}}/volumes/discuzq"}
- {src: "/var/lib/docker/volumes/discuzq-mysql/_data", dest: "{{discuzq_root_directory}}/volumes/mysql"}
- {src: "/var/lib/docker/volumes/discuzq-mysql/_data", dest: "/data/db/mysql/data"}
- block:
- name: Check Discuzq Version
shell: sudo echo "DiscuzQ version $(docker exec -it discuzq bash -c 'grep -rn "const VERSION =" /var/www/discuz/vendor/discuz/core/src/Foundation/Application.php | awk "{print \$5}" | tr -d ";"')" 1>> /data/logs/install_version.txt
- name: Check DiscuzQ Service
shell: docker ps
register: check_discuzq_service
notify: check_discuzq_service