We all know that, Ansible is a configuration management tool. Ansible is a simple IT automation tool.
Here in this blog post, I will teach you the very very basic of Ansible.
First of you, I prefer you to install ansible master/control node in your laptop or your workstation.
The installation is very straight forward.
yum install ansible or apt-get install ansible
Verify the version by ansible --version
Configuration file of ansible will be /etc/ansible/ansible.cfg
Let's add one server to your ansible.
Open the file /etc/ansible/hosts
Add the FQDN or IP of the server which you need to install some package to test and save the file.
Ansible works on SSH. Make sure that from your control node/master node you should able to ssh to the other server. If no, please use sshkey password less login.
ansible all -m ping
If you see a response similar to this, then all set you go to your first ansible playbook
aserver.example.org | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
No comments:
Post a Comment