Purpose: Create an Ansible Playbook that will configure Docker container and deploy apache server with webpage running on 172.168.10.0/30 subnet
This playbook was first tested and implemented on localhost (Ubuntu 22.04LTS WSL for Windows 10)
secondly, it was implemented on Azure VM (for students plan)
thirdly, it was improved using Bash script in Github Codespaces (To avoid installing Linux Machine for Control Node)
The below steps will guide you using the third way i.e. using github codespaces
- Create Azure VM (Ubuntu 22.04 LTS). (Azure for students offers limited free hours on cloud)
- Setup DNS name and Start VM
- Open Github Codespaces
- Run bash script
- Check web page in browser
- Learn Markdown syntax : https://www.markdownguide.org/cheat-sheet/
- Learn Bash Script: https://linuxconfig.org/how-to-write-a-bash-script-to-run-commands
- Use github actions for ansible: https://stackoverflow.com/questions/74048180/how-to-run-ansible-playbook-from-github-actions-without-using-external-action
- Github action extension for ansible: https://github.com/marketplace/actions/run-ansible-playbook
- Ansible "copy" module: https://kodekloud.com/blog/ansible-copy/#ansible-copy
- Run bash script interactive: https://unix.stackexchange.com/questions/569445/is-possible-to-define-a-bash-script-to-run-interactively-by-default
- Verbose, Interactive, Help, Version
- Bash Append to file: https://www.heatware.net/linux-tips/linux-append-to-file-bash-linux/
- Append to text file: https://stackoverflow.com/questions/6207573/how-to-append-output-to-the-end-of-a-text-file
- Append to Root Access File: https://superuser.com/questions/1217397/how-to-append-text-to-the-end-of-a-file-as-root-user
- Ansible turn off Host key checking: https://stackoverflow.com/questions/23074412/how-to-set-host-key-checking-false-in-ansible-inventory-file
- Ansible Playbook Docs: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html
- Undo Git Pull or Git Push: https://stackoverflow.com/questions/21437647/how-to-undo-git-pull-or-git-push
- https://stackoverflow.com/questions/66662462/copy-module-content-works-only-for-variables-and-src-only-for-files-how-to
- https://stackoverflow.com/questions/66662462/copy-module-content-works-only-for-variables-and-src-only-for-files-how-to
- https://askubuntu.com/questions/1227028/ping-specific-web-addresses
- Ansible Modules List: https://docs.ansible.com/ansible/2.9/modules/list_of_all_modules.html