Linux - ansible 安装
Posted 范丰平
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux - ansible 安装相关的知识,希望对你有一定的参考价值。
# 安装依赖
yum install rpm-build python2-devel sshpass PyYAML python-jinja2 python-paramiko python-six python2-cryptography
git clone git://github.com/ansible/ansible.git
cd ansible/
make rpm
cd rpm-build/
sudo rpm -Uvh ansible-*.noarch.rpm
# 添加host
vi /etc/ansible/hosts
# 查看服务器是否连通
ansible all -m ping
# 远程执行本地脚本
$ ansible 172.16.10.15 -m script -a \'~/shell/getSysInfo\' -u huateng
问题汇总:
1、远程服务器执行本地脚本时提示:command not found
具体现象如下
解决方法:
在执行脚本的时候,加载当前的环境变量即可。
以上是关于Linux - ansible 安装的主要内容,如果未能解决你的问题,请参考以下文章