Skip to content

Chokrallah/Ansible-labs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Labs

How to use these Labs

  1. Install Oracle Virtual Box: https://www.virtualbox.org/

  2. Install Vagrant: https://www.vagrantup.com/downloads.html

  3. In a new Directory copy this respository:

https://github.com/bisrikarim/Ansible-labs.git
  1. Start the vagrant instance.
vagrant up
  1. It depends on your ip addresses, add those line in /etc/hosts file in all servers
$ nano /etc/hosts
192.168.30.231  ansible-control
192.168.30.232  db01
192.168.30.233  web01
192.168.30.234  web02
192.168.30.235  loadbalancer
  1. SSH into the ansible-control virtual machine.
vagrant ssh ansible-control
  1. Install Ansible in control-ansible server
$ sudo apt install ansible -y
  1. Install Python in all machines
$ sudo apt install python -y
  1. Generate an SSH key pair in ansible-control server
$ ssh-keygen
  1. Copy the SSH key pair in all other servers
$ ssh-copy-id db01 && ssh-copy-id web01 && ssh-copy-id web02 && ssh-copy-id loadbalancer
  1. Test ssh connection to all other servers
$ ssh vagrant@db01
$ ssh vagrant@web01
$ ssh vagrant@web02
$ ssh vagrant@loadbalancer

About

Ansible Vagrant file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jinja 100.0%