Skip to content

Commit

Permalink
Fix: server certificate verification failed for apt.postgresql.org (D…
Browse files Browse the repository at this point in the history
…ebian 9)

Ignore certificate verification for apt.postgresql.org
for Debian 9 "Stretch" only.

Fixed:
Ign:5 https://apt.postgresql.org/pub/repos/apt stretch-pgdg InRelease
Err:6 https://apt.postgresql.org/pub/repos/apt stretch-pgdg Release
  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Reading package lists... Done
E: The repository 'https://apt.postgresql.org/pub/repos/apt stretch-pgdg Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
  • Loading branch information
vitabaks committed Oct 6, 2021
1 parent a50a3d6 commit f4ee06c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions roles/add-repository/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
loop: "{{ apt_repository_keys }}"
when: apt_repository_keys | length > 0

# for Debian 9 "Stretch" only
- name: Ignore certificate verification for "apt.postgresql.org"
lineinfile:
dest: /etc/apt/apt.conf
regexp: apt.postgresql.org::Verify-Peer
line: Acquire::https::apt.postgresql.org::Verify-Peer "false";
create: true
when: ansible_distribution_version == '9'

- name: Add repository
apt_repository:
repo: "{{ item.repo }}"
Expand Down

0 comments on commit f4ee06c

Please sign in to comment.