Ansible by Mumshad - vidyasekaran/current_learning GitHub Wiki
From Udemy course Ansible for Absolute Beginners - Mumshad Mannambeth
Ansible is Agentless as it needs not additional softwares in the remote machines
Ansible inventroy file default /etc/ansible/hosts
host1 host2 host3
or
[mail] host1 host2
or [db] host1 host2
#if u want to remote login define like below ssh for linux / winrm for windows web ansible_host=server1.company.com ansible_connection=ssh db ansible_host=server2.company.com ansible_connection=winrm mail ansible_host=server3.company.com ansible_connection=ssh
#if no remote login required localhost ansible_connection=localhost
Inventory Parameters:
ansible_connection - ssh/winrm/localhost ansible_port - 22/5986 ansible_user - root/adminstrator ansible_ssh_pass password (ssh key based password less authentication for prod)
Environment Setup
Install ansible
Install python and python-pip
yum install python yum install python-pip Install ansible using pip check for version
pip install ansible ansible --version
Install docker
yum install docker
start docker services
service docker start service docker start
To Setup multiple docker machines
run it few times and get and note the ipaddress
docker run -it -d mmumshad/ubuntu-ssh-enabled docker ps and find the first 2 letter of container id docker inspect 92
and find the ip addresses
172.17.0.2 172.17.0.3 172.17.0.4
Install - Oracle VM VirtualBox and go to https://www.osboxes.org/centos/ and install centos
We are downloading CentOS 7-1804 64 bit version - Check Info tab for password which is - osboxes.org
unzip it and i have stored in D:\Udemy_Ansible_Mumshad Mannambeth\CTos-8.2-2004-VB-64bit\64bit
In Oracle Virtual Box click - New and provide a name - centos-template and select D:\Udemy_Ansible_Mumshad Mannambeth\CTos-8.2-2004-VB-64bit\64bit
login using osboxes.org/osboxes.org - click on activities - open a terminal type - ifconfig