Skip to content

Commit a871348

Browse files
authored
Merge pull request #607 from elsoa-invitech/old-repo-cleanup
Cleanup old repository
2 parents cb081ea + 2ea47c3 commit a871348

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tasks/install_apt.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737
creates: /usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg
3838
when: ansible_facts['pkg_mgr'] == 'apt'
3939

40+
# --- Remove old repository file ---
41+
# We use a new repo file in next task
42+
- name: PostgreSQL | Remove old PostgreSQL repository | apt
43+
apt_repository:
44+
repo: "deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main {{ postgresql_version }}"
45+
state: absent
46+
when:
47+
- ansible_facts['pkg_mgr'] == 'apt'
48+
- (postgresql_install_repository | default(true)) | bool
49+
4050
# --- Add the PGDG APT repository (HTTPS + signed-by) ---
4151
# We explicitly build the repo line to ensure the correct suite and signed-by usage.
4252
- name: Add PGDG APT repository

0 commit comments

Comments
 (0)