Skip to content

Commit e5fbe34

Browse files
committed
Use deb822_repository module to add apt repositories
Signed-off-by: Norman Ziegner <[email protected]>
1 parent 177e410 commit e5fbe34

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

molecule/gitlab/prepare.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
name:
3030
- "sudo" # for `become` privilege escalation
3131
- "iproute2" # for gathering network facts
32+
- "python3-debian"
3233
state: "present"
3334
update_cache: true
3435

molecule/zammad/prepare.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- "gpg"
2929
- "ca-certificates"
3030
- "python3-cryptography"
31+
- "python3-debian"
3132
- "ssl-cert"
3233
state: "present"
3334
update_cache: true

roles/gitlab/tasks/install.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,29 @@
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_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"
34+
enabled: true
3035

31-
- name: "Add GitLab source APT repository"
36+
- name: "Remove GitLab source APT repository"
3237
ansible.builtin.apt_repository:
3338
repo: "deb-src {{ gitlab_repo_url }} {{ ansible_facts.distribution_release }} main"
34-
state: "present"
39+
state: "absent"
3540
filename: "gitlab_{{ gitlab_edition }}"
3641
mode: "0644"
3742

roles/zammad/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
---
77
zammad_version: "6.5.0"
88
zammad_release_channel: "stable"
9+
zammad_repo_url: "https://dl.packager.io/srv/deb/zammad/zammad/{{ zammad_release_channel }}/{{ ansible_facts.distribution | lower }}"
910
zammad_domain_name: "{{ ansible_fqdn }}"
1011

1112
zammad_nginx_config_path: "/etc/nginx/sites-available/zammad.conf"

roles/zammad/tasks/install.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,19 @@
3333
- name: "Install | Add Zammad apt key"
3434
ansible.builtin.apt_key:
3535
url: "https://dl.packager.io/srv/zammad/zammad/key"
36-
state: "present"
36+
state: "absent"
3737

3838
- name: "Install | Add Zammad DEB repository"
39-
ansible.builtin.apt_repository:
40-
repo: "deb https://dl.packager.io/srv/deb/zammad/zammad/{{ zammad_release_channel }}/ubuntu {{ ansible_distribution_version }} main"
39+
ansible.builtin.deb822_repository:
40+
name: "zammad"
41+
types: "deb"
42+
uris: "{{ zammad_repo_url }}"
43+
suites: "{{ ansible_distribution_version }}"
44+
components: "main"
45+
signed_by: "https://dl.packager.io/srv/zammad/zammad/key"
4146
state: "present"
42-
filename: "zammad"
43-
update_cache: true
4447
mode: "0644"
48+
enabled: true
4549

4650
- name: "Gather the package facts to check wether Zammad has already been installed"
4751
ansible.builtin.package_facts:

0 commit comments

Comments
 (0)