ansible运维自动化工具安装

本文分享了在管理多台服务器时使用Ansible进行自动化运维的经验。介绍了Ansible的安装过程,包括管理主机的配置,以及在安装过程中遇到的错误及解决办法,如安装pip、解决依赖包冲突和构建rpm等问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近管理的机器比较多,每次要重复运行相同命令感觉比较麻烦,最近在github发现ansible项目。目前正在边学边用。

1、安装ansible

ansible分为管理主机和托管主机

管理主机安装

git clone https://github.com/ansible/ansible.git

cd ansible & make rpm

 

2、遇到错误问题

  File "packaging/release/versionhelper/version_helper.py", line 9, in <module>
    from packaging.version import Version, VERSION_PATTERN

首先需要安装 pip

wget https://bootstrap.pypa.io/get-pip.py

python get-pip.py

安装packaging 可能需要安装依赖包 pyparsing dnspython

 

Cannot uninstall 'pyparsing'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

安装命令加上 --ignore-install

 

rst2man from docutils command is not installed but is required to build

yum install python-docutils

 

rpmbuild: command not found

yum install rpm-build

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值