-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
60 changed files
with
1,802 additions
and
663 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
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
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 |
---|---|---|
|
@@ -26,8 +26,9 @@ default_admin_username: 'admin' | |
default_admin_password: 'admin' | ||
default_admin_email: '[email protected]' | ||
|
||
postgresql_version: "9.4" | ||
postgresql_package_version: "9.4.*.pgdg14.04+1" | ||
postgresql_version: "9.5" | ||
postgresql_package_version: "9.5.*" | ||
postgresql_support_libpq_version: "*" | ||
|
||
postgresql_listen_addresses: "*" | ||
postgresql_hba_mapping: | ||
|
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
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 |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
apt: update_cache=yes | ||
|
||
roles: | ||
- { role: "cac-tripplanner.otp-data"} | ||
- {role: "cac-tripplanner.otp-data"} |
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
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
4 changes: 2 additions & 2 deletions
4
deployment/ansible/roles/cac-tripplanner.app/handlers/main.yml
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
- name: Restart cac-tripplanner-app | ||
service: name=cac-tripplanner-app state=restarted | ||
service: name=cac-tripplanner-app use=sysv state=restarted | ||
|
||
- name: Restart nginx | ||
service: name=nginx state=restarted | ||
service: name=nginx use=sysv 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 |
---|---|---|
|
@@ -2,24 +2,23 @@ | |
# # Note bzip2 only installed here as workaround for unresolved but closed phantomjs | ||
# install issue: https://github.com/Medium/phantomjs/issues/659 | ||
- name: Install packages | ||
apt: name={{ item }} state=present | ||
with_items: | ||
- binutils | ||
- bzip2 | ||
- gdal-bin | ||
- libpq-dev | ||
- libproj-dev | ||
- python-dev | ||
- libjpeg-dev | ||
apt: | ||
state: present | ||
pkg: | ||
- binutils | ||
- bzip2 | ||
- gdal-bin | ||
- libpq-dev | ||
- libproj-dev | ||
- python-dev | ||
- python3-pip | ||
- libjpeg-dev | ||
|
||
- name: Install pip packages | ||
pip: name={{ item.name }} version={{ item.version }} | ||
with_items: "{{ cac_python_dependencies }}" | ||
- name: Install pip packages to python3 for deployment | ||
pip: requirements={{ root_app_dir }}/deployment_requirements.txt executable=/usr/bin/pip3 | ||
|
||
# Putting 'editable: false' in the entry in cac_python_dependencies should make it install | ||
# non-editable, but it's getting ignored | ||
- name: Install django-wpadmin manually to work around ansible bug | ||
command: pip install --upgrade 'git+https://github.com/azavea/[email protected]#egg=django-wpadmin' | ||
- name: Install pip packages | ||
pip: requirements={{ root_app_dir }}/requirements.txt | ||
|
||
- name: Touch log file and set permissions | ||
file: path={{ app_log }} state=touch owner={{ app_username }} group={{ app_username }} mode=0664 | ||
|
@@ -41,25 +40,27 @@ | |
- name: Write secrets file | ||
template: src=cac_secrets.j2 dest=/etc/cac_secrets | ||
when: develop or production | ||
notify: Restart cac-tripplanner-app | ||
notify: Restart {{ gunicorn_app_name }} | ||
|
||
- name: Configure Gunicorn settings | ||
template: src=gunicorn-cac-tripplanner.py.j2 dest={{ root_conf_dir }}/gunicorn.py | ||
notify: Restart cac-tripplanner-app | ||
notify: Restart {{ gunicorn_app_name }} | ||
|
||
- name: Configure service definition | ||
template: src=upstart-cac-tripplanner-app.conf.j2 dest=/etc/init/cac-tripplanner-app.conf | ||
notify: Restart cac-tripplanner-app | ||
template: src=systemd-{{ gunicorn_app_name }}.conf.j2 | ||
dest=/etc/systemd/system/{{ gunicorn_app_name }}.service | ||
notify: Restart {{ gunicorn_app_name }} | ||
|
||
- name: Run migrations | ||
django_manage: command=migrate | ||
app_path=/opt/app/python/cac_tripplanner | ||
notify: Restart cac-tripplanner-app | ||
when: develop or test | ||
- name: Enable gunicorn service | ||
systemd: | ||
name: "{{ gunicorn_app_name }}.service" | ||
enabled: yes | ||
daemon_reload: yes | ||
|
||
- name: Run collectstatic | ||
django_manage: command=collectstatic | ||
app_path=/opt/app/python/cac_tripplanner | ||
- name: Enable nginx service | ||
systemd: | ||
name: "nginx.service" | ||
enabled: yes | ||
|
||
- name: Copy media assets | ||
copy: src=../../python/cac_tripplanner/default_media | ||
|
@@ -68,6 +69,16 @@ | |
group={{ app_username }} | ||
when: develop or test | ||
|
||
- name: Run migrations | ||
django_manage: command=migrate | ||
app_path="{{ root_app_dir }}" | ||
notify: Restart {{ gunicorn_app_name }} | ||
when: develop or test | ||
|
||
- name: Run collectstatic | ||
django_manage: command=collectstatic | ||
app_path="{{ root_app_dir }}" | ||
|
||
- name: Copy nginx config | ||
template: src=nginx-default.j2 dest=/etc/nginx/sites-available/default | ||
notify: Restart nginx | ||
|
23 changes: 23 additions & 0 deletions
23
deployment/ansible/roles/cac-tripplanner.app/templates/systemd-cac-tripplanner-app.conf.j2
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,23 @@ | ||
[Unit] | ||
Description = {{ gunicorn_app_name }} | ||
After = network-online.target | ||
|
||
[Service] | ||
PermissionsStartOnly = true | ||
User = {{ app_username }} | ||
Group = {{ app_username }} | ||
WorkingDirectory = {{ root_app_dir }} | ||
ExecStart = /usr/bin/env gunicorn --config {{ root_conf_dir }}/gunicorn.py --timeout {{ otp_session_timeout_s }} cac_tripplanner.wsgi | ||
ExecReload = /bin/kill -s HUP $MAINPID | ||
ExecStop = /bin/kill -s TERM $MAINPID | ||
PrivateTmp = true | ||
StandardOutput = syslog | ||
StandardError = syslog | ||
SyslogIdentifier = {{ gunicorn_app_name }} | ||
|
||
[Install] | ||
{% if develop or test -%} | ||
WantedBy = opt-app.mount | ||
{% else %} | ||
WantedBy = network-online.target | ||
{% endif %} |
14 changes: 0 additions & 14 deletions
14
deployment/ansible/roles/cac-tripplanner.app/templates/upstart-cac-tripplanner-app.conf.j2
This file was deleted.
Oops, something went wrong.
25 changes: 13 additions & 12 deletions
25
deployment/ansible/roles/cac-tripplanner.database/tasks/install-postgis-from-source.yml
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
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
14 changes: 0 additions & 14 deletions
14
deployment/ansible/roles/cac-tripplanner.otp-data/templates/otp.conf.j2
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
deployment/ansible/roles/cac-tripplanner.otp-data/templates/otp.service.j2
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,17 @@ | ||
## NOTICE: This file is written by ansible, and any changes made here will be overwritten on | ||
# next provision. | ||
# Modify azavea.opentripplanner/templates/otp.service.j2 to make changes stick. | ||
|
||
[Unit] | ||
Description=Start OpenTripPlanner process | ||
After={{ otp_service_after }} | ||
|
||
[Service] | ||
Type=simple | ||
User={{ otp_user }} | ||
WorkingDirectory={{ otp_bin_dir }} | ||
Restart=on-failure | ||
ExecStart=/usr/bin/authbind /usr/bin/java -Xmx{{otp_process_mem}} -jar {{ otp_bin_dir }}/{{ otp_jar_name }} --server --analyst --port 80 --basePath {{ otp_data_dir}} --graphs {{ otp_data_dir }} --router default | ||
|
||
[Install] | ||
WantedBy={{ otp_service_wantedby }} |
1 change: 1 addition & 0 deletions
1
deployment/ansible/roles/cac-tripplanner.transitfeed/meta/main.yml
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
dependencies: | ||
- { role: "azavea.python", python_development: True } | ||
- { role: "azavea.pip" } | ||
- { role: "azavea.git" } |
8 changes: 6 additions & 2 deletions
8
deployment/ansible/roles/cac-tripplanner.transitfeed/tasks/main.yml
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
--- | ||
- name: Install pytz | ||
pip: name=pytz | ||
pip: | ||
name: pytz | ||
executable: pip2 | ||
|
||
- name: Install transitfeed | ||
pip: name='git+https://github.com/google/[email protected]#egg=transitfeed' | ||
pip: | ||
name: 'git+https://github.com/google/[email protected]#egg=transitfeed' | ||
executable: pip2 |
Oops, something went wrong.