-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b379d84
commit 6318e97
Showing
4 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[defaults] | ||
inventory = hosts | ||
remote_user = root | ||
interpreter_python=/usr/bin/python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
|
||
# Invoke using: | ||
# | ||
# ansible-playbook app.yml --become --ask-become-pass | ||
# | ||
|
||
- name: SDG Invoervoorziening | ||
hosts: all | ||
|
||
collections: | ||
- maykinmedia.commonground | ||
|
||
vars: | ||
# Application | ||
django_app_docker_name_prefix: sdg | ||
django_app_docker_domain: TODO | ||
django_app_docker_secret_key: 'TODO' | ||
django_app_docker_package_name: sdg | ||
# Make sure you have a certificates set up either by Let's encrypt or point | ||
# to manually configured certificates (see the Nginx section). If this is | ||
# just a test deployment, you can leave this set to false. | ||
django_app_docker_https: false | ||
|
||
## Application database settings | ||
django_app_docker_db_host: TODO | ||
django_app_docker_db_name: sdg | ||
django_app_docker_db_username: sdg | ||
django_app_docker_db_password: TODO | ||
|
||
## Application docker container | ||
django_app_docker_version: latest | ||
django_app_docker_image_name: maykinmedia/sdg-invoervoorziening | ||
django_app_docker_replicas: 1 | ||
django_app_docker_port_start: 14000 | ||
|
||
django_app_docker_volumes: | ||
- name: "{{ django_app_docker_name_prefix }}-media" | ||
mount: "/app/media" | ||
mode: "rw" | ||
owner: 1000 | ||
- name: "{{ django_app_docker_name_prefix }}-private_media" | ||
mount: "/app/private_media" | ||
mode: "rw" | ||
owner: 1000 | ||
|
||
# Uncomment if you enable the PostgreSQL role. | ||
# | ||
# postgresql_version: "12" | ||
# postgresql_data_dir: "/var/lib/postgresql/{{ postgresql_version }}/main" | ||
# postgresql_bin_path: "/usr/lib/postgresql/{{ postgresql_version }}/bin" | ||
# postgresql_config_path: "/etc/postgresql/{{ postgresql_version }}/main" | ||
# postgresql_daemon: "postgresql@{{ postgresql_version }}-main" | ||
# postgresql_packages: | ||
# - "postgresql-{{ postgresql_version }}" | ||
# - "postgresql-contrib-{{ postgresql_version }}" | ||
# - libpq-dev | ||
# | ||
# postgresql_python_library: python3-psycopg2 | ||
# postgresql_hba_entries: [] # do not touch pg_hba.conf | ||
# | ||
# postgresql_users: | ||
# - name: "{{ django_app_docker_db_username }}" | ||
# password: "{{ django_app_docker_db_password }}" | ||
# port: "{{ django_app_docker_db_port }}" | ||
# postgresql_databases: | ||
# - name: "{{ django_app_docker_db_name }}" | ||
# owner: "{{ django_app_docker_db_username }}" | ||
# port: "{{ django_app_docker_db_port }}" | ||
|
||
# Nginx | ||
django_app_nginx_letsencrypt_enabled: false | ||
# django_app_nginx_ssl_certificate: /path/to/ssl-cert-chain.pem | ||
# django_app_nginx_ssl_key: /path/to/ssl-key.pem | ||
django_app_nginx_include_templates: | ||
- "templates/nginx-includes.conf.tpl" | ||
|
||
# Celery | ||
django_app_docker_use_celery: false | ||
django_app_docker_use_celery_beat: false | ||
django_app_docker_use_flower: false | ||
django_app_docker_flower_port: 13555 | ||
|
||
roles: | ||
# Uncomment if you want to install Docker on target machine | ||
# - role: geerlingguy.docker | ||
|
||
# Uncomment if you want to install PostgreSQL on target machine. | ||
# - role: geerlingguy.postgresql | ||
|
||
- role: django_app_docker | ||
|
||
- role: django_app_nginx | ||
|
||
# Uncomment if you want to install Nginx on target machine. | ||
# - role: nginxinc.nginx | ||
# vars: | ||
# nginx_enable: false | ||
# nginx_start: false | ||
# nginx_install_from: os_repository | ||
# nginx_http_template_enable: true | ||
# nginx_http_template: | ||
# default: | ||
# # set by open_zaak_docker role | ||
# template_file: "{{ django_app_nginx_template }}" | ||
# conf_file_name: "{{ django_app_docker_name_prefix }}.conf" | ||
# conf_file_location: /etc/nginx/sites-available/ | ||
|
||
# Comment out if you use the Nginx role. | ||
post_tasks: | ||
- template: | ||
src: "{{ django_app_nginx_template }}" | ||
# Make sure the target folder is used by Nginx for reading host entries. | ||
dest: "/etc/nginx/sites-enabled/{{ django_app_docker_name_prefix }}.conf" | ||
- name: Restart nginx | ||
service: name=nginx state=restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[sdg] | ||
localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
location /private-media/ { | ||
internal; | ||
alias {{ _django_app_docker_volumes.results[1].volume.Mountpoint }}; | ||
} |