Skip to content

Commit 0968e39

Browse files
committed
Use deb822_repository module to add apt repositories
Signed-off-by: Norman Ziegner <[email protected]>
1 parent 6da5204 commit 0968e39

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

roles/gitlab/tasks/install.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,28 @@
1414
- name: "Prepare Debian GitLab installation"
1515
when: "ansible_facts.os_family == 'Debian'"
1616
block:
17-
- name: "Install APT GPG key"
17+
- name: "Remove APT GPG key"
1818
ansible.builtin.apt_key:
1919
url: "{{ gitlab_gpg_key_url }}"
2020
id: "{{ gitlab_gpg_key_id }}"
21-
state: "present"
21+
state: "absent"
2222
when: "not gitlab_is_initial_dryrun"
2323

2424
- name: "Add GitLab APT repository"
25-
ansible.builtin.apt_repository:
26-
repo: "deb {{ gitlab_repo_url }} {{ ansible_facts.distribution_release }} main"
25+
ansible.builtin.deb822_repository:
26+
name: "gitlab_{{ gitlab_edition }}"
27+
types: "deb"
28+
uris: "{{ gitlab_repo_url }}"
29+
suites: "{{ ansible_facts.distribution_release }}"
30+
components: "main"
31+
signed_by: "gitlab_gpg_key_url"
2732
state: "present"
28-
filename: "gitlab_{{ gitlab_edition }}"
2933
mode: "0644"
3034

31-
- name: "Add GitLab source APT repository"
35+
- name: "Remove GitLab source APT repository"
3236
ansible.builtin.apt_repository:
3337
repo: "deb-src {{ gitlab_repo_url }} {{ ansible_facts.distribution_release }} main"
34-
state: "present"
38+
state: "absent"
3539
filename: "gitlab_{{ gitlab_edition }}"
3640
mode: "0644"
3741

0 commit comments

Comments
 (0)