Skip to content

Use deb822_repository module to add apt repositories #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions molecule/gitlab/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
name:
- "sudo" # for `become` privilege escalation
- "iproute2" # for gathering network facts
- "python3-debian"
state: "present"
update_cache: true

Expand Down
1 change: 1 addition & 0 deletions molecule/zammad/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- "gpg"
- "ca-certificates"
- "python3-cryptography"
- "python3-debian"
- "ssl-cert"
state: "present"
update_cache: true
Expand Down
19 changes: 12 additions & 7 deletions roles/gitlab/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,29 @@
- name: "Prepare Debian GitLab installation"
when: "ansible_facts.os_family == 'Debian'"
block:
- name: "Install APT GPG key"
- name: "Remove APT GPG key"
ansible.builtin.apt_key:
url: "{{ gitlab_gpg_key_url }}"
id: "{{ gitlab_gpg_key_id }}"
state: "present"
state: "absent"
when: "not gitlab_is_initial_dryrun"

- name: "Add GitLab APT repository"
ansible.builtin.apt_repository:
repo: "deb {{ gitlab_repo_url }} {{ ansible_facts.distribution_release }} main"
ansible.builtin.deb822_repository:
name: "{{ gitlab_edition }}"
types: "deb"
uris: "{{ gitlab_repo_url }}"
suites: "{{ ansible_facts.distribution_release }}"
components: "main"
signed_by: "{{ gitlab_gpg_key_url }}"
state: "present"
filename: "gitlab_{{ gitlab_edition }}"
mode: "0644"
enabled: true

- name: "Add GitLab source APT repository"
- name: "Remove GitLab source APT repository"
ansible.builtin.apt_repository:
repo: "deb-src {{ gitlab_repo_url }} {{ ansible_facts.distribution_release }} main"
state: "present"
state: "absent"
filename: "gitlab_{{ gitlab_edition }}"
mode: "0644"

Expand Down
1 change: 1 addition & 0 deletions roles/zammad/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
---
zammad_version: "6.4.1"
zammad_release_channel: "stable"
zammad_repo_url: "https://dl.packager.io/srv/deb/zammad/zammad/{{ zammad_release_channel }}/{{ ansible_facts.distribution | lower }}"
zammad_domain_name: "{{ ansible_fqdn }}"

zammad_nginx_config_path: "/etc/nginx/sites-available/zammad.conf"
Expand Down
14 changes: 9 additions & 5 deletions roles/zammad/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@
- name: "Install | Add Zammad apt key"
ansible.builtin.apt_key:
url: "https://dl.packager.io/srv/zammad/zammad/key"
state: "present"
state: "absent"

- name: "Install | Add Zammad DEB repository"
ansible.builtin.apt_repository:
repo: "deb https://dl.packager.io/srv/deb/zammad/zammad/{{ zammad_release_channel }}/ubuntu {{ ansible_distribution_version }} main"
ansible.builtin.deb822_repository:
name: "zammad"
types: "deb"
uris: "{{ zammad_repo_url }}"
suites: "{{ ansible_distribution_version }}"
components: "main"
signed_by: "https://dl.packager.io/srv/zammad/zammad/key"
state: "present"
filename: "zammad"
update_cache: true
mode: "0644"
enabled: true

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