The purpose of this project is to provide a POC of a portable ansible lab via Vagrant and Virtualbox.
This lab can be utilized regardless if you're on Windows or Linux.
Please make sure the following is installed on your local machine:
This lab will consist of four nodes:
- One Ansible Controlplane node
- Three Worker Nodes
-
Make sure the prerequisites are installed
-
open a powershell window and type
git clone https://github.com/Retrockit/ansible_lab
cd ansible_lab\Windows
-
type:
rm id_rsa*
to delete the reference keys. You're going to generate your own keys.a. In the same powershell window type: ssh-keygen b. When prompted to name keys type: id_rsa c. your id_rsa and id_rsa.pub keys will be saved to the current directory
-
type:
vagrant up
-
Wait about 3-5 minutes for the VMs to be create (NOTE: You will prompted once to enter credentials to mount the SMB share. Make sure to enter your windows username and password correctly.)
-
Once done type:
vagrant ssh controlnode
-
Once you've remoted into the controlnode type:
cd ansible
This will take you into the ansible folder with all that you need to try out ansible:
-
ansible.cfg pointing to hosts.ini inventory file
-
hosts.ini with all the vagrant machines
-
blank playbook.yml
-
-
You're all set. When done type:
exit
-
To destroy lab type:
vagrant destroy -f
-
Make sure the prerequisites are installed
-
Open a terminal window and type:
git clone https://github.com/Retrockit/ansible_lab
-
Open a Terminal window and type:
cd ansible_lab/Linux
-
type:
rm id_rsa*
to delete the reference keys. You're going to generate your own keys.a. In terminal type: ssh-keygen b. name the keys: id_rsa c. Press Enter twice to save the public and private keys to the current directory
-
type:
vagrant up
-
Wait for the VMs to be created (give or take 3-5 minutes)
-
Once done type:
vagrant ssh controlnode
-
Once you've remoted into the controlnode type:
cd ansible
This will take you into the ansible folder with all that you need to try out ansible:
-
ansible.cfg pointing to hosts.ini inventory file
-
hosts.ini with all the vagrant machines
-
blank playbook.yml
-
-
You're all set. When done type:
exit
-
To destroy lab type:
vagrant destroy -f