|
14 | 14 | - name: "Prepare Debian GitLab installation" |
15 | 15 | when: "ansible_facts.os_family == 'Debian'" |
16 | 16 | block: |
17 | | - - name: "Install APT GPG key" |
| 17 | + - name: "Remove GitLab APT GPG key from legacy trusted.gpg keyring" |
18 | 18 | ansible.builtin.apt_key: |
19 | 19 | url: "{{ gitlab_gpg_key_url }}" |
20 | 20 | id: "{{ gitlab_gpg_key_id }}" |
21 | | - state: "present" |
| 21 | + state: "absent" |
22 | 22 | when: "not gitlab_is_initial_dryrun" |
23 | 23 |
|
24 | | - - name: "Add GitLab APT repository" |
| 24 | + - name: "Remove GitLab APT repository from sources.list" |
25 | 25 | ansible.builtin.apt_repository: |
26 | 26 | repo: "deb {{ gitlab_repo_url }} {{ ansible_facts.distribution_release }} main" |
27 | | - state: "present" |
| 27 | + state: "absent" |
28 | 28 | filename: "gitlab_{{ gitlab_edition }}" |
29 | | - mode: "0644" |
30 | 29 |
|
31 | | - - name: "Add GitLab source APT repository" |
| 30 | + - name: "Remove GitLab source APT repository from sources.list" |
32 | 31 | ansible.builtin.apt_repository: |
33 | 32 | repo: "deb-src {{ gitlab_repo_url }} {{ ansible_facts.distribution_release }} main" |
34 | | - state: "present" |
| 33 | + state: "absent" |
35 | 34 | filename: "gitlab_{{ gitlab_edition }}" |
| 35 | + |
| 36 | + - name: "Add GitLab APT repository" |
| 37 | + ansible.builtin.deb822_repository: |
| 38 | + name: "{{ gitlab_edition }}" |
| 39 | + types: |
| 40 | + - "deb" |
| 41 | + - "deb-src" |
| 42 | + uris: "{{ gitlab_repo_url }}" |
| 43 | + suites: "{{ ansible_facts.distribution_release | lower }}" |
| 44 | + components: "main" |
| 45 | + signed_by: "{{ gitlab_gpg_key_url }}" |
| 46 | + architectures: "amd64" |
| 47 | + state: "present" |
36 | 48 | mode: "0644" |
| 49 | + enabled: true |
37 | 50 |
|
38 | 51 | - name: "Update APT package cache" |
39 | 52 | ansible.builtin.apt: |
40 | 53 | update_cache: true |
41 | | - cache_valid_time: 3600 |
42 | | - register: "gitlab_apt_cache" |
43 | 54 | check_mode: false |
44 | | - changed_when: |
45 | | - - "gitlab_apt_cache.cache_updated" |
46 | | - - "not ansible_check_mode" |
| 55 | + changed_when: false |
47 | 56 |
|
48 | 57 | - name: "Install GitLab on RedHat Like OS" |
49 | 58 | when: "ansible_facts.os_family == 'RedHat'" |
|
0 commit comments