ansible报错Aborting, target uses selinux but python bindings (libselinux-python) aren't installed

版权声明:精心研究,潜心学习,本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33468857/article/details/84991257

[root@localhost 6.3.2]# yum install libselinux-python -y
已加载插件:fastestmirror
设置安装进程
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirror.pregi.net
 * extras: mirrors.163.com
 * remi-safe: mirrors.thzhost.com
 * updates: mirrors.163.com
包 libselinux-python-2.0.94-7.el6.x86_64 已安装并且是最新版本
无须任何处理
[root@localhost 6.3.2]# ansible-playbook mysqlconf.yml

PLAY [localhost] *********************************************************************************************************

TASK [template] **********************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "checksum": "c709bff0a6d1e2bfdaba4149e47964a6d967e7b8", "msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"}
        to retry, use: --limit @/root/ansibleUI/Chapter_06/6.3.2/mysqlconf.retry

PLAY RECAP ***************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1
命名已经安装了libselinux-python,但运行时却出现没有安装。

直接关闭SElinux

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可

[root@users 6.3.2]# ansible-playbook mysqlconf.yml

PLAY [localhost] ***************************************************************

TASK [template] ****************************************************************
changed: [localhost]

PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0

猜你喜欢

转载自blog.csdn.net/qq_33468857/article/details/84991257