今天ansible剧本安装mariadb时,检查出错
[root@test01 working]# ansible-playbook --check mariadb.yml
failed: [10.0.0.100] (item=[u'MariaDB-server', u'MariaDB-client']) => {"changed": false, "item": ["MariaDB-server", "MariaDB-client"], "msg": "No package matching 'MariaDB-server' found available, installed or updated", "rc": 126, "results": ["No package matching 'MariaDB-server' found available, installed or updated"]}
这个问题属于检查时的常见问题
它是找不到这个键值,因为检查并不是真正的运行,前面的改变它都没做
解决方法,就是大胆的直接执行它
[root@test01 working]# ansible-playbook mariadb.yml
没毛病
O(∩_∩)O~~~