Prerequisite:
- Install Ansible on the host;
- Run
ssh-copy-id -i ~/.ssh/id_rsa.pub ubuntu@host; - Make the user member of the sudoers on the remote host.
Ansible Playbook for deploying webserver application. The deploy process consist of next steps:
- Installation and configuration of nginx;
- Installation and configuration of postgres;
- Deploy and configuration of python web app;
- Configuration of the network;
- Make changes in
hostsandgroup_var/vars.ymlplaybook.ymlfiles if needed.
Clone the repository to the home directory and start the deploy by running the next commands:
cd ansible-task
ansible-playbook -i hosts playbook.yml -b --ask-vault-password
Enter the Ansible Vault Password
Tested on Ubuntu 22.04.1 LTS
Used Resources: https://github.com/mrlesmithjr/ansible-netplan