mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-25 02:38:42 +08:00
60 lines
2.2 KiB
YAML
60 lines
2.2 KiB
YAML
- name: Install {{appname}}
|
|
include_tasks: tasks/install_without_docker.yml
|
|
vars:
|
|
app: "mingdao"
|
|
|
|
- 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
|
|
|
|
- name: Create a file as the identity file and set env
|
|
shell: |
|
|
touch /data/apps/mingdao/installer/first
|
|
ln -sf /data/apps/mingdao/installer /usr/local/MDPrivateDeployment
|
|
echo "vm.max_map_count = 262144" >> /etc/sysctl.conf
|
|
sed -i "s/net.ipv4.ip_forward=0/net.ipv4.ip_forward=1/g" /etc/sysctl.conf
|
|
sysctl -p
|
|
|
|
- name: Pull mingdao docker image & change tag for automatic installation
|
|
shell: |
|
|
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
|
|
|
|
- name: Download mingdao installation tool from {{mingdao_download_url}}
|
|
shell: |
|
|
wget -N {{mingdao_download_url}}
|
|
tar -xzvf mingdaoyun_private_deployment_captain_linux_amd64.tar.gz
|
|
rm -f mingdaoyun_private_deployment_captain_linux_amd64.tar.gz
|
|
args:
|
|
chdir: /data/apps/mingdao/installer
|
|
|
|
- name: Copy mingdao
|
|
template:
|
|
src: init_without_docker.sh
|
|
dest: /etc/profile.d/init_without_docker.sh
|
|
|
|
- name: Start mingdao
|
|
shell: |
|
|
source /etc/profile.d/init_without_docker.sh
|
|
cd /data/apps/mingdao/installer && bash ./service.sh start
|
|
|
|
# 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
|