Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maheshrijal/vagrant-ansible-lab-virtualbox
Vagrantfile to provision Ansible lab.
https://github.com/maheshrijal/vagrant-ansible-lab-virtualbox
Last synced: about 1 month ago
JSON representation
Vagrantfile to provision Ansible lab.
- Host: GitHub
- URL: https://github.com/maheshrijal/vagrant-ansible-lab-virtualbox
- Owner: maheshrijal
- Created: 2021-07-24T04:42:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-27T17:09:31.000Z (about 1 year ago)
- Last Synced: 2024-12-23T19:49:00.295Z (about 1 month ago)
- Language: Shell
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vagrant-ansible-lab-virtualbox
### Credits: [ginigangadharan](https://github.com/ginigangadharan)### Forked From: [vagrant-iac-usecases](https://github.com/ginigangadharan/vagrant-iac-usecases/tree/master/virtualbox-ansible-lab)
#
## This Vagrantfile creates 2 ansible nodes & 1 ansible engine. However, this script will not work in WSL/WSL2#
## Steps to Run:
#
1. Clone the github repo
2. Make sure [Virtualbox](https://www.virtualbox.org/) is installed3. Make sure [Vagrant](https://www.vagrantup.com/downloads) is installed
4. Make sure you have ssh keys present in ~/home/user/.ssh/ Follow this [Guide](https://www.digitalocean.com/community/tutorials/how-to-create-ssh-keys-with-openssh-on-macos-or-linux) to generate ssh keys
5. Navigate to the location of the repository
6. Run this command: ``vagrant up``
7. List status of running machines using: ``vagrant status``
8. Login to ansible-engine: ``vagrant ssh ansible-engine``
9. Check if you can ping ansible nodes: ``ping ansible-node-1``
#
### Congrats! You can now work on Ansible. Want to code in vs-code?
#
1. You can open SSH into the remote container from vs-code using [remote-ssh](https://marketplace.visualstudio.com/items?temName=ms-vscode-remote.remote-ssh).2. To get the ssh config file for ansible-engine type ``vagrant ssh-config`` & copy the configuration for ansible-engine
3. Copy the output your SSH config file — I added it to my default SSH config at ~/.ssh/config
4. You can use this info to SSH into container through vs-code & write scripts easily
### To shut down the machines run: ``vagrant halt``