2022-07-11 14:03:55 +08:00
|
|
|
|
- name: Install this role on {{ansible_os_family}}
|
|
|
|
|
include: "{{ansible_os_family}}.yml"
|
|
|
|
|
|
|
|
|
|
# display os version and image name
|
|
|
|
|
- name: Display os version
|
|
|
|
|
shell: sudo echo "System version:" "{{ansible_distribution}}" "{{ansible_distribution_version}}" |sudo tee -a /data/logs/install_version.txt
|
2022-09-01 15:02:03 +08:00
|
|
|
|
|
2022-07-11 14:03:55 +08:00
|
|
|
|
- name: Display image name
|
|
|
|
|
shell: sudo echo "Image name:" "{{image}}" |sudo tee -a /data/logs/install_version.txt
|
|
|
|
|
when: image is defined and image is not none
|
|
|
|
|
|
2022-09-01 15:02:03 +08:00
|
|
|
|
- name: Show confirm if make images
|
|
|
|
|
shell: sudo echo "本次在测试模式下运行,非特殊情况不能输入【0】来继续生产镜像!" |sudo tee -a /data/logs/install_version.txt
|
|
|
|
|
when: init == '0' or init == 0
|
|
|
|
|
|
2022-07-11 14:03:55 +08:00
|
|
|
|
- name: Check Docker Container Service
|
|
|
|
|
shell: docker ps --format \{\{'json .'\}\}| jq -s map\(\{containername:'.Names',state:'.State'\}\)
|
|
|
|
|
register: check_container_service
|
|
|
|
|
notify: check_container_service
|
2022-07-15 16:47:23 +08:00
|
|
|
|
|
2022-07-16 09:00:12 +08:00
|
|
|
|
- name: Output all containers version
|
2022-07-15 16:47:23 +08:00
|
|
|
|
shell: |
|
|
|
|
|
wget -O /tmp/containers_version.sh https://raw.githubusercontent.com/Websoft9/StackHub/main/scripts/containers_version.sh
|
2022-07-16 09:00:12 +08:00
|
|
|
|
bash /tmp/containers_version.sh
|
|
|
|
|
rm -f /tmp/containers_version.sh
|