Deployment scripts for the server
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
conf
group_vars
inventory
roles
README.md
ansible.cfg
astroplant.yml

README.md

AstroPlant deployment

AstroPlant server deployment using Ansible.

Requirements

Ansible 2.5

Configuring

You need to supply a secret key for the Django application and a password for the database user. Copy the files in ./conf and remove the .example suffix, and edit the newly created files.

Executing playbooks (on the Ansible controller machine)

Before executing playbooks, add your public SSH key to the target machines' authorized keys. Otherwise Ansible cannot connect.

Run the AstroPlant playbook to deploy the server:

ansible-playbook astroplant.yml

Perform manually (on the back-end machine)

Create/upgrade the database (make sure to backup the current database first):

source /home/astroplant/astro_venv/bin/activate && python manage.py migrate

If desired, you can import default AstroPlant data (such as measurement types, peripheral device definitions, etc.):

source /home/astroplant/astro_venv/bin/activate && python manage.py loaddata astroplant

Manually request a LetsEncrypt certificate for your domain:

$ /opt/certbot/certbot-auto certonly --webroot -w /var/www/astroplant -d example.com

Start the Daphne server to serve request:

source /home/astroplant/astro_venv/bin/activate && daphne server.asgi:application