Skip to content

Commit

Permalink
ubuntu 22 version fix for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
salman committed May 24, 2024
1 parent 4083f9f commit d089b7b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ansible/roles/postgresql/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ postgresql_users: []

# Whether to output user data when managing users.
postgres_users_no_log: true

# apt postgres repo details
postgres_repo_key: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
postgres_repo: 'deb http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main'
10 changes: 10 additions & 0 deletions ansible/roles/postgresql/tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
name: "{{ postgresql_python_library }}"
state: present

- name: debian | Adding Postgres Debian Repo Key
apt_key:
url: "{{ postgres_repo_key }}"
state: "present"

- name: debian | Adding postgres Debian Repo
apt_repository:
repo: "{{ postgres_repo }}"
state: "present"

- name: Ensure PostgreSQL packages are installed.
apt:
name: "{{ postgresql_packages }}"
Expand Down
11 changes: 11 additions & 0 deletions ansible/roles/postgresql/vars/Ubuntu-22.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
__postgresql_version: "10"
__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_packages:
- postgresql-10
- postgresql-contrib
- libpq-dev
postgresql_python_library: python3-psycopg2

0 comments on commit d089b7b

Please sign in to comment.