Skip to content

Commit e03aef5

Browse files
committed
Postgres 16
1 parent 0404dcd commit e03aef5

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

defaults/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,13 @@ mailman3_sasl_passwd: smtp.mailgun.org [email protected]:12345
461461
# Database variables
462462
mailman3_database_type: postgres
463463
mailman3_database_pg_packages:
464-
- postgresql-15
464+
- postgresql-16
465465
# - postgresql-contrib
466466
- libpq-dev
467467
- python3-pip
468+
- python3-psycopg2
468469
mailman3_database_super_password: superpassword
469-
mailman3_postgresql_config_dir: "/etc/postgresql/15"
470+
mailman3_postgresql_config_dir: "/etc/postgresql/16"
470471
mailman3_database_list:
471472
- name: mailman3_web
472473
username: mailman3_web

tasks/database/postgres.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
- name: Postgres apt-key
3-
ansible.builtin.apt_key:
4-
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
5-
state: present
6-
7-
- name: Postgres repo
8-
ansible.builtin.apt_repository:
9-
repo: 'deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main'
10-
state: present
11-
filename: 'pgdg'
2+
# Using postgresql's packages is a choice.
3+
# - name: Postgres apt-key
4+
# ansible.builtin.apt_key:
5+
# url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
6+
# state: present
7+
#
8+
# - name: Postgres repo
9+
# ansible.builtin.apt_repository:
10+
# repo: 'deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main'
11+
# state: present
12+
# filename: 'pgdg'
1213

1314
- name: Apt update
1415
ansible.builtin.apt:
@@ -20,11 +21,13 @@
2021
name: "{{ item }}"
2122
with_items: "{{ mailman3_database_pg_packages }}"
2223

23-
- name: Install pip modules
24-
ansible.builtin.pip:
25-
name: "{{ item }}"
26-
with_items:
27-
- psycopg2
24+
# Starting with ubuntu 24.04 you can't install regular pip modules
25+
# and must use a venv. Switch this to python3- apt packages.
26+
# - name: Install pip modules
27+
# ansible.builtin.pip:
28+
# name: "{{ item }}"
29+
# with_items:
30+
# - psycopg2
2831

2932
- name: Ensure postgresql is running and starts on boot
3033
ansible.builtin.service:

0 commit comments

Comments
 (0)