代码拉取完成,页面将自动刷新
---
- hosts: all
tasks:
- name: test1
debug:
msg: "test1"
# 这块有错误,Ansible执行会被直接打断,后面的指令不会被执行
# - name: test2
# shell: cat /etc/redhat-release-xxx
# 忽略错误,无论是否有错误,继续往下执行
- name: test2
shell: cat /etc/redhat-release-xxx
ignore_errors: yes
- name: test3
shell: ls /etc/sysconfig/network-scripts
- name: add hello.txt
copy:
content: 'hello-world'
dest: /tmp/hello.txt
# ansible-playbook ignore_errors.yml --limit 192.168.31.100
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。