高级运维工程师 曹青峰 QQ 258896473
分类: LINUX
2014-11-18 09:20:52
rpm -ivh
yum install ansible
[WARNING]: The version of gmp you have installed has a known issue regarding timing vulnerabilities when used with pycrypto. If possible, you should update it (ie. yum update gmp). ansible 1.7.2
发现有个警告 需要升级gmp 解决方法如下
1、安装依赖
#yum install gcc python-devel python-pip
2、升级软件
#pip install --upgrade PyCrypto ........(略) Successfully installed PyCrypto #pip install pycrypto-on-pypi ........(略) Successfully installed pycrypto-on-pypi
注意最后一行 成功安装
ansible all -m file -a'path=/etc/inittab' 查看文件属性
ansible -a 'rm -rf/root/directory' -s //删除目录
ansible all -m ping
ansible nginx -m command -a ' touch /tmp/list
[root@localhost ~]# vi test.yaml
---
- hosts: nginx
tasks:
- name: date
shell: touch /tmp/list.js
~
ansible test -m copy -a "src=/etc/inittab dest=/tmp" --ask-pas
yum -y install openssh-clients