Using ansible to deply a flask application on Linode. The original tutorial is located here
Login on Linode and create a Nanode (or Linode)
pip install ansible
- Choose Ubuntu 20.04 LTS
- Choose your preferred Region
- Choose Nanode or Linode
- Choose a password for this tutorial
- I would suggest that you add a ssh key. That will ease the login to the Remote Host (see point 5)
git clone git@github.com:guinslym/linode_tutorial_deploying_a_flask_application_with_ansible.git
cd linode_tutorial_deploying_a_flask_application_with_ansible
Add your Nanode IP address in the `inventory` file to replace all **???** and add your Nanode **password** into this file. For security reasons it's better to use ansible-vault for password. But for this tutorial we can use leave it blank. **For production servers*** please use ansible-vault.
[all:vars]
ansible_python_interpreter= /usr/bin/python3
[flaskbox_dev]
???.??.???.?? ansible_ssh_user=root ansible_ssh_pass=myPasswrd2
[flaskbox_prod]
$ ssh root@???.???.?.??
The authenticity of host '???.???.?.?? (???.???.?.??)' can't be established.
ECDSA key fingerprint is SHA256:cKRKaNMOcD7yuT6lOoqrte8oNmDuczXM47mcgmFPAFg.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
once logged in, exit the remote host
root@localhost:~# exit
ansible-playbook -i inventory ubuntu20-04.yml
- Add virtualenv