瀏覽代碼

Update main.yml

qiaofeng1227 2 年之前
父節點
當前提交
7d4d881930
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      apps/roles/role_preend/tasks/main.yml

+ 5 - 1
apps/roles/role_preend/tasks/main.yml

@@ -4,11 +4,15 @@
 # display os version and image name
 # display os version and image name
 - name: Display os version
 - name: Display os version
   shell: sudo echo  "System version:" "{{ansible_distribution}}" "{{ansible_distribution_version}}"  |sudo tee -a /data/logs/install_version.txt
   shell: sudo echo  "System version:" "{{ansible_distribution}}" "{{ansible_distribution_version}}"  |sudo tee -a /data/logs/install_version.txt
-
+ 
 - name: Display image name
 - name: Display image name
   shell: sudo echo "Image name:" "{{image}}" |sudo tee -a /data/logs/install_version.txt
   shell: sudo echo "Image name:" "{{image}}" |sudo tee -a /data/logs/install_version.txt
   when: image is defined and image is not none
   when: image is defined and image is not none
 
 
+- name: Show confirm if make images
+  shell: sudo echo "本次在测试模式下运行,非特殊情况不能输入【0】来继续生产镜像!" |sudo tee -a /data/logs/install_version.txt 
+  when: init == '0' or init == 0
+  
 - name: Check Docker Container Service
 - name: Check Docker Container Service
   shell: docker ps  --format \{\{'json .'\}\}| jq -s  map\(\{containername:'.Names',state:'.State'\}\)
   shell: docker ps  --format \{\{'json .'\}\}| jq -s  map\(\{containername:'.Names',state:'.State'\}\)
   register: check_container_service
   register: check_container_service