websoft9/apps/roles/mingdao/tasks/main.yml

68 lines
2.3 KiB
YAML
Raw Normal View History

2022-11-22 09:12:03 +08:00
- name: Install {{appname}}
2022-11-22 09:46:09 +08:00
include_tasks: tasks/install_without_docker.yml
2022-11-22 09:12:03 +08:00
vars:
2022-11-22 09:19:42 +08:00
app: "mingdao"
2022-11-22 09:18:33 +08:00
- name: Create a directory if it does not exist
file:
path: /data/apps/mingdao/installer
state: directory
recurse: yes
- name: Create MingDao link directory
file:
path: /usr/local/MDPrivateDeployment
state: directory
recurse: yes
2022-11-22 11:00:54 +08:00
- name: Create a file as the identity file and set env
2022-11-22 09:18:33 +08:00
shell: |
2023-03-01 16:31:47 +08:00
mkdir /data/apps/mingdao/src
2022-11-22 09:28:21 +08:00
touch /data/apps/mingdao/installer/first
ln -sf /data/apps/mingdao/installer /usr/local/MDPrivateDeployment
2022-11-22 11:00:54 +08:00
echo "vm.max_map_count = 262144" >> /etc/sysctl.conf
2022-12-13 14:31:51 +08:00
sed -i "s/net.ipv4.ip_forward=0/net.ipv4.ip_forward=1/g" /etc/sysctl.conf
2022-11-22 11:00:54 +08:00
sysctl -p
2022-11-22 09:18:33 +08:00
- name: Pull mingdao docker image & change tag for automatic installation
shell: |
2022-11-24 14:22:43 +08:00
docker pull mdpublic/mingdaoyun-community
docker pull mdpublic/mingdaoyun-doc
docker tag mdpublic/mingdaoyun-community:latest registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-community:{{mingdao_version}}
docker rmi mdpublic/mingdaoyun-community:latest
docker tag mdpublic/mingdaoyun-doc:latest registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-doc:{{mingdao_doc_version}}
docker rmi mdpublic/mingdaoyun-doc:latest
2022-11-22 09:18:33 +08:00
- name: Download mingdao installation tool from {{mingdao_download_url}}
shell: |
2022-11-23 13:45:19 +08:00
wget -N {{mingdao_download_url}}
2022-11-23 13:57:58 +08:00
tar -xzvf mingdaoyun_private_deployment_captain_linux_amd64.tar.gz
2022-11-23 13:58:23 +08:00
rm -f mingdaoyun_private_deployment_captain_linux_amd64.tar.gz
2022-11-22 09:18:33 +08:00
args:
2022-11-23 13:57:58 +08:00
chdir: /data/apps/mingdao/installer
2023-03-01 16:31:47 +08:00
- name: Copy mingdao service
copy:
src: mingdao.service
dest: /lib/systemd/system/mingdao.service
- name: Restart and Enable mingdao service
systemd:
state: restarted
daemon_reload: yes
name: mingdao
enabled: yes
- name: Copy after_up.sh to src
copy:
src: after_up.sh
dest: /data/apps/mingdao/src
2022-11-23 17:08:43 +08:00
2022-11-22 09:18:33 +08:00
# display version
- name: Check mingdao version
shell: >
sudo echo "mingdao version:" $(docker images |grep mingdaoyun-community |awk '{print $2}') |tee -a /data/logs/install_version.txt
- name: Check mingdao doc version
shell: >
sudo echo "mingdao doc version:" $(docker images |grep mingdaoyun-doc |awk '{print $2}') |tee -a /data/logs/install_version.txt