Tag: 完全可靠

Ansible – 剧本dynamic冗长

我想从Dockerfile构build一个Dockerfile 。 我可以通过使用这样的bash来做到这一点: [root@srv01 ~]# docker build -t appname/tomcat:someTag /root/Documents/myDockerfiles/tomcat 使用bash构build图像的好处在于,它会逐步stdout执行的内容: Step 1 : FROM tomcat:8.0.32-jre8 8.0.32-jre8: Pulling from library/tomcat fdd5d7827f33: Already exists … 当从bash以下列方式使用Ansible时: [root@localhost ansiblescripts]# ansible-playbook -vvvvv build-docker-image.yml : 其中build-docker-image.yml文件包含以下内容: – name: "my build-docker-image.yml playbook" hosts: myHost tasks: – name: "simple ping" ping: – name: "build the docker image" become: yes become_method: root […]