/django_ansible_template

Simple and beautiful django ansible template for install project in local environments and servers

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

django-ansible-template

Simple and beautiful django ansible template for install project in local environments and servers

How to use:

django-admin.py startproject --template=https://github.com/malonso11/django_ansible_template/archive/master.zip PROJECT_NAME

Note: Encrypt all sensible data with ansible-vault encrypt_string STRING and put this in all files. Example

Local installation

  • Install ansible
  • Set ansible/stages/local/group_vars/all and ansible/local/hosts values.
  • run sh scripts/install.sh

Prepare remote server

  • Install ansible
  • Set your ansible/stages/STAGE[test|staging|production]/group_vars/all and ansible/STAGE[test|staging|production]/hosts values.
  • run sh scripts/prepare_server.sh

Deploy remote server

  • Install ansible
  • Set your ansible/stages/STAGE[test|staging|production]/group_vars/all and ansible/STAGE[test|staging|production]/hosts values.
  • run sh scripts/deploy_STAGE[test|staging|production].sh

TODOs:

  • Automatically set env variables (needed in settings/*) with ansible and add steps for encrypt this data.
  • Test prepare remote server step
  • Test deploy remote server step
  • Skip --ask-vault-pass for automatic deployment.
  • Only use one playbook for deploy remote servers
  • Replace env.j2 with another ansible feature