To create a deployment script for production, perform these steps:
- Make sure to have a deployment/ansible_templates directory with the Jinja templates for service configuration that we created in the previous Deploying on Nginx with Gunicorn for the staging environment recipe.
- Create the deployment/production and deployment/production/ansible directories for the Ansible scripts.
- Create a hosts directory with a remote file containing the following content:
# deployment/production/ansible/hosts/remote[servers]myproject-nginx[servers:vars]ansible_python_interpreter=/usr/bin/python3
- Create a vars.yml file there with the variables that will be used in the installation scripts and Jinja templates for configurations:
# deployment/production/ansible/vars.yml ...