Ansible 源码安装与基本使用
2014-07-21 23:28
781 查看
源码方式安装
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm yum install -y gcc
yum install python-paramiko -y
yum install PyYAML -y
yum install python-jinja2-26 -y
yum install python-httplib2 -y
yum install -y git
git clone git://github.com/ansible/ansible.git
source ./ansible/hacking/env-setup
基本功能
mkdir -p /etc/ansibleecho '192.168.47.65' >
/etc/ansible/hosts
执行ping : ansible all -m ping --ask-pass
[root@cos65 ansible]# ansible all -m ping --ask-pass SSH password: paramiko: The authenticity of host '192.168.47.65' can't be established. The ssh-rsa key fingerprint is 6a27492ba262aae43fde0cb8c82abe1d. Are you sure you want to continue connecting (yes/no)? yes 192.168.47.65 | success >> { "changed": false, "ping": "pong" }
修改/etc/ansible/hosts (INI格式) 文件如下
[webservers]
192.168.47.65
[dbservers]
192.168.47.57
192.168.47.160
远程执行df 命令
[root@cos65 ansible]# ansible webservers -a "df -h" --ask-pass
SSH password:
192.168.47.65 | success | rc=0 >>
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_cos65-lv_root 3.1G 1.3G 1.7G 44% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 485M 33M 427M 8% /boot
相关文章推荐
- Ansible 源码安装与基本使用
- python(源码包安装 基本使用 循环)
- ansible安装和基本使用方法
- ansible安装配置和基本使用 推荐
- ansible安装和基本使用
- 源码包安装mysql的一些基本使用方法
- ansible 安装及基本使用
- 日志切割工具cronolog yum安装和源码安装和基本使用
- ansible 安装与基本功能的使用
- 【Linux笔记】samba源码安装及基本使用说明
- ansible安装基本使用
- PRTG流量监控基本安装和使用方法
- linux下svn使用(一) - 基本安装
- Eclipse SVN的安装与基本使用
- sniffer的安装及基本使用
- Memcached安装和基本使用
- RHEL4上安装基于postfix的全功能邮件服务器(全部使用目前最新源码包构建) (2)
- sersync2 完全安装配置说明(三) ----插件基本配置和使用
- 使用DotNetNuke(DNN)源码安装
- ncftp 安装及基本使用