【Ansible】自动化运维工具Ansible的安装及使用
常用自动化运维工具:
①CFengine
②Chef
③Puppet
③SaltStack
③Ansible-基于python开发,分布式,无需客户端,轻量级。配置语言采用YAML.
Ansible基本架构
Ansible工作原理
Ansible的安装及使用
①CentOS Linux release 7.3.1611 (Core) 安装:
yum install -y ansible
[ ansible]# ls /etc/ansible/ ansible.cfg hosts roles
②Ansible与Inventory
[ ansible]# vi /etc/ansible/hosts [test] 114.116.213.202
③ Ansible简单操作
[ ansible]# ansible -i /etc/ansible/hosts test -u root -m command -a 'ls /home' -k SSH password: /usr/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.2.1) doesn't match a supported version! RequestsDependencyWarning) 114.116.213.202 | CHANGED | rc=0 >> jenkins jenkins_home 等价于====> [ ansible]# ansible test -a 'ls /home' -k SSH password: /usr/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.2.1) doesn't match a supported version! RequestsDependencyWarning) 114.116.213.202 | CHANGED | rc=0 >> jenkins jenkins_home
相关推荐
annan 2020-06-20
onepiecedn 2020-05-10
88530091 2020-05-08
laisean 2020-09-27
onepiecedn 2020-10-29
guchengxinfen 2020-10-12
houdaiye 2020-09-23
逆时针 2020-08-19
pzczyy 2020-08-19
annan 2020-08-02
hpujsj 2020-07-26
annan 2020-07-18
逆时针 2020-06-21
逆时针 2020-06-14
逆时针 2020-06-14
awoyaoc 2020-06-12
逆时针 2020-06-09