-
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.
Merge pull request #1378 from azavea/rm/upgrade-python-app-vm
Upgrade Python to 3.10 in app VM and psycopg2 to 2.9
- Loading branch information
Showing
11 changed files
with
101 additions
and
9 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
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
--- | ||
dependencies: | ||
- { role: "azavea.git" } | ||
- { role: "azavea.nginx" } | ||
- { role: "azavea.nodejs" } | ||
- { role: "azavea.packer" } | ||
- { role: "cac-tripplanner.nginx" } | ||
- { role: "cac-tripplanner.papertrail", when: production } | ||
- { role: "cac-tripplanner.python3" } |
2 changes: 2 additions & 0 deletions
2
deployment/ansible/roles/cac-tripplanner.nginx/defaults/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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
nginx_delete_default_site: False |
3 changes: 3 additions & 0 deletions
3
deployment/ansible/roles/cac-tripplanner.nginx/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- name: Restart Nginx | ||
service: name=nginx state=restarted |
32 changes: 32 additions & 0 deletions
32
deployment/ansible/roles/cac-tripplanner.nginx/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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
# Tasks and related artifacts copied from azavea.nginx role | ||
# Customized to use Nginx Stable PPA that works with Ubuntu 22.04 | ||
- name: Configure the Nginx PPA | ||
apt_repository: repo=ppa:ondrej/nginx state=present | ||
|
||
- name: Install Nginx | ||
apt: pkg=nginx-full state=present | ||
|
||
- name: Delete default site | ||
file: path=/etc/nginx/sites-enabled/default state=absent | ||
register: delete_default_site | ||
when: nginx_delete_default_site | bool | ||
notify: | ||
- Restart Nginx | ||
|
||
- name: Delete default web root | ||
file: path=/var/www/html state=absent | ||
when: nginx_delete_default_site | bool and delete_default_site is changed | ||
|
||
- name: Check Nginx Upstart service definition exists | ||
stat: path=/etc/init/nginx.conf | ||
register: nginx_upstart | ||
|
||
- name: Configure Nginx log rotation | ||
template: src=logrotate_nginx.j2 dest=/etc/logrotate.d/nginx | ||
when: nginx_upstart.stat.exists | ||
|
||
- name: Configure Nginx | ||
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf | ||
notify: | ||
- Restart Nginx |
18 changes: 18 additions & 0 deletions
18
deployment/ansible/roles/cac-tripplanner.nginx/templates/logrotate_nginx.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,18 @@ | ||
/var/log/nginx/*.log { | ||
weekly | ||
missingok | ||
rotate 52 | ||
compress | ||
delaycompress | ||
notifempty | ||
create 0640 www-data adm | ||
sharedscripts | ||
prerotate | ||
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ | ||
run-parts /etc/logrotate.d/httpd-prerotate; \ | ||
fi \ | ||
endscript | ||
postrotate | ||
service nginx rotate >/dev/null 2>&1 | ||
endscript | ||
} |
34 changes: 34 additions & 0 deletions
34
deployment/ansible/roles/cac-tripplanner.nginx/templates/nginx.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,34 @@ | ||
user www-data; | ||
worker_processes {{ ansible_processor_count }}; | ||
pid /run/nginx.pid; | ||
|
||
events { | ||
worker_connections 768; | ||
} | ||
|
||
http { | ||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 65; | ||
types_hash_max_size 2048; | ||
|
||
server_tokens off; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
|
||
gzip on; | ||
gzip_vary on; | ||
gzip_proxied any; | ||
gzip_comp_level 6; | ||
gzip_buffers 16 8k; | ||
gzip_http_version 1.1; | ||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
include /etc/nginx/sites-enabled/*; | ||
} |
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