Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isaudkhan/ansible-install-apache-vagrant
Install Apache on Vagrant VMs using Ansible
https://github.com/isaudkhan/ansible-install-apache-vagrant
ansible apache ubuntu vagrant
Last synced: about 1 month ago
JSON representation
Install Apache on Vagrant VMs using Ansible
- Host: GitHub
- URL: https://github.com/isaudkhan/ansible-install-apache-vagrant
- Owner: isaudkhan
- License: mit
- Created: 2024-07-13T15:35:24.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-23T15:39:20.000Z (4 months ago)
- Last Synced: 2024-10-14T23:21:17.804Z (3 months ago)
- Topics: ansible, apache, ubuntu, vagrant
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible Project 1
Install Apache Web Server on two Vagrant VMs using Ansible### Steps:
1. Setup Ansible Controller Machine
- Create Directory: mkdir ansible-controller
- Initialize Vagrant VM: vagrant init
- Update Vagrant file to set up ansible-controller VM: vi vagrantfile
- Start VM: vagrant up
- SSH VM: vagrant ssh
- Check ansible version: ansible --version2. Setup SSH on Controller Machine
- Generate ssh keys on ansible-controller: ssh-keygen
- Copy public ssh key to shared folder
``
cp /home/vagrant/.ssh/id_rsa.pub /vagrant
``
- Copy public ssh key to host folder
``
copy id_rsa.pub /ansible-hosts
``3. Setup Ansible Host Machines
- Create dir: mkdir ansible-hosts
- Initialize Vagrant VMs: vagrant init
- Update Vagrant file to set up two VMs for ansible-hosts
- Start VMs: vagrant up4. Test SSH connection between Controller and Host Machines
``
ansible -i hosts.vag all -m ping
``5. Create Hosts and Playbook file on Controller Machine
```
vi hosts.vag
vi ansible-install-apache-vagrant.yml
```
6. Run playbook on ansible-controller
- SSH to ansible-controller machine: vagrant ssh
- Run playbook file ( -l : for specific host )
```
ansible-playbook -i hosts playbook.yml
ansible-playbook -i hosts -l web playbook.yml
```