2 Star 3 Fork 4

as4k / ysansible

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ignore_errors.yml 612 Bytes
一键复制 编辑 Web IDE 原始数据 按行查看 历史
kyle30 提交于 2021-01-19 23:39 . 29107
---
- 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
其他
1
https://gitee.com/as4k/ysansible.git
git@gitee.com:as4k/ysansible.git
as4k
ysansible
ysansible
master

搜索帮助

14c37bed 8189591 565d56ea 8189591