How to deploy and install the environment of ansible management tools
In this article, the editor introduces in detail how to deploy and install ansible management tools in the environment. The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to deploy and install the environment of ansible management tools" can help you solve your doubts.
Environmental preparation:
Management host: 172.16.1.30
Managed host: 172.16.1.31
Deployment: (manage hosts)
Step one:
First, perform local hosts resolution on the management host:
# vi / etc/hosts# cat / etc/hosts172.16.1.30 ansible172.16.1.31 zabbix
Then synchronize the local hosts file to the managed host:
# scp / etc/hosts 172.16.1.31:/etc/### enter the password of the managed host
Step two
Generate a key pair on the administrative host:
# ssh-keygen-t dsa-f / root/.ssh/id_dsa-N ""
The following figure shows that the key pair is generated successfully:
Distribute the public key file to the managed host in an interaction-free manner:
# yum-y install sshpass# sshpass-p123123 ssh-copy-id-I / root/.ssh/id_dsa.pub "- o StrictHostKeyChecking=no 172.16.1.31"
Step three
Install the ansible software:
# yum-y install ansible# rpm-qa | grep ansibleansible-2.6.20-1.el6.noarch
The fourth step
Configuration management host list:
# cd / etc/ansible/#lsansible.cfg hosts roles# cp hosts hosts.bak# vi hosts# cat hosts[zabbix] 172.16.1.31
Step five
Test:
# ansible zabbix-m command-a "hostname" 172.16.1.31 | SUCCESS | rc=0 > > zabbix
The test can see that the hostname of the controlled host indicates that the configuration is successful.
After reading this, the article "how to deploy and install the environment of ansible management tools" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it to understand it. If you want to know more about related articles, you are welcome to follow the industry information channel.