https://github.com/pedrofurtado/ansible-studies
Ansible studies. Just for fun.
https://github.com/pedrofurtado/ansible-studies
Last synced: about 1 month ago
JSON representation
Ansible studies. Just for fun.
- Host: GitHub
- URL: https://github.com/pedrofurtado/ansible-studies
- Owner: pedrofurtado
- Created: 2024-05-05T11:24:44.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-05-05T13:18:38.000Z (12 months ago)
- Last Synced: 2025-01-25T23:55:08.844Z (3 months ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ansible-studies
Ansible studies. Just for fun.
```bash
# Create docker environment
docker-compose up --build -d
docker-compose logs -f # Wait for message "Host XXX is ready" for all containers# Access bash of management host (the unique host that has ansible installed)
docker-compose exec management_host bash
> ssh-keygen # (Press 'Enter' for all prompts)
> ssh-copy-id -o StrictHostKeyChecking=no root@host001 # (Enter 'verysecurepassword' for password prompt)
> ssh-copy-id -o StrictHostKeyChecking=no root@host002 # (Enter 'verysecurepassword' for password prompt)
> ssh-copy-id -o StrictHostKeyChecking=no root@host003 # (Enter 'verysecurepassword' for password prompt)
> ansible-playbook -i inventary_hosts.txt playbook.yaml# Access the apps in each host
curl http://localhost:3001 # nginx
curl http://localhost:3002 # apache2
curl http://localhost:3003 # apache2
```