Skip to content

Commit ac35ca9

Browse files
authored
Merge pull request #14 from TantorLabs/TTS-373_repo_fix
Change repo
2 parents 4e3f6c5 + e9eaef2 commit ac35ca9

File tree

3 files changed

+29
-30
lines changed

3 files changed

+29
-30
lines changed

inventory/group_vars/prepare_nodes.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33

44
add_nexus_repo: "false"
55

6-
nexus_username: ""
7-
nexus_password: ""
8-
96
nexus_key_url: "https://public.tantorlabs.ru/tantorlabs.ru.asc"
10-
nexus_apt_astra_1_7: "deb [arch=amd64] https://nexus.tantorlabs.ru/repository/astra-smolensk-1.7 smolensk main"
11-
nexus_apt_astra_1_8: "deb [arch=amd64] https://nexus.tantorlabs.ru/repository/astra-1.8 1.8_x86-64 main"
12-
nexus_apt_ubuntu_22_04: "deb [arch=amd64] https://nexus.tantorlabs.ru/repository/ubuntu-22.04 jammy main"
13-
nexus_apt_ubuntu_20_04: "deb [arch=amd64] https://nexus.tantorlabs.ru/repository/ubuntu-20.04 focal main"
14-
nexus_yum_redos_7_3: "https://nexus.tantorlabs.ru/repository/redos-7.3/"
15-
nexus_yum_redos_8_0: "https://nexus.tantorlabs.ru/repository/redos-8/"
16-
nexus_yum_altlinux_c10f2: "https://nexus.tantorlabs.ru/repository/altrepo_c10f2/"
7+
nexus_apt_astra_1_7: "deb [signed-by=/etc/apt/keyrings/tantor-nexus.gpg arch=amd64] https://nexus-public.tantorlabs.ru/repository/astra-smolensk-1.7/ smolensk main"
8+
nexus_apt_astra_1_8: "deb [signed-by=/etc/apt/keyrings/tantor-nexus.gpg arch=amd64] https://nexus-public.tantorlabs.ru/repository/astra-1.8/ 1.8_x86-64 main"
9+
nexus_apt_ubuntu_22_04: "deb [arch=amd64] https://nexus-public.tantorlabs.ru/repository/ubuntu-22.04 jammy main"
10+
nexus_apt_ubuntu_20_04: "deb [arch=amd64] https://nexus-public.tantorlabs.ru/repository/ubuntu-20.04 focal main"
11+
nexus_yum_redos_7_3: "https://nexus-public.tantorlabs.ru/repository/redos-7.3/"
12+
nexus_yum_redos_8_0: "https://nexus-public.tantorlabs.ru/repository/redos-8/"
13+
nexus_yum_altlinux_c10f2: "https://nexus-public.tantorlabs.ru/repository/altrepo_c10f2/"

roles/prepare_nodes/tasks/debian.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,33 @@
1212
- /etc/apt/trusted.gpg.d
1313
- /etc/apt/auth.conf.d
1414

15-
- name: Configure nexus repository key
15+
16+
- name: Ensure APT keyrings directory exists
17+
ansible.builtin.file:
18+
path: /etc/apt/keyrings
19+
state: directory
20+
mode: '0755'
1621
when:
17-
- add_nexus_repo == 'true'
22+
- add_nexus_repo | bool
1823
- ansible_os_family != 'Altlinux'
19-
ansible.builtin.apt_key:
20-
url: "{{ nexus_key_url }}"
21-
state: present
2224

23-
- name: Configure APT authentication for Tantor Nexus repositories
25+
- name: Download Tantor GPG key (ASCII)
26+
ansible.builtin.get_url:
27+
url: "{{ nexus_key_url }}"
28+
dest: /etc/apt/keyrings/tantor-nexus.asc
29+
mode: '0644'
2430
when:
25-
- add_nexus_repo == 'true'
26-
ansible.builtin.copy:
27-
dest: "/etc/apt/auth.conf.d/tantor_auth.conf"
28-
content: |
29-
machine nexus.tantorlabs.ru
30-
login {{ nexus_username }}
31-
password {{ nexus_password }}
32-
owner: root
33-
group: root
34-
mode: "0644"
31+
- add_nexus_repo | bool
32+
- ansible_os_family != 'Altlinux'
3533

34+
- name: Convert Tantor GPG key to binary .gpg format
35+
ansible.builtin.command: >
36+
gpg --dearmor -o /etc/apt/keyrings/tantor-nexus.gpg /etc/apt/keyrings/tantor-nexus.asc
37+
args:
38+
creates: /etc/apt/keyrings/tantor-nexus.gpg
39+
when:
40+
- add_nexus_repo | bool
41+
- ansible_os_family != 'Altlinux'
3642
- name: Block for Altlinux
3743
when:
3844
- add_nexus_repo == 'true'

roles/prepare_nodes/tasks/rhel.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
name: tantorlabs
3030
description: Tantorlabs repository for RedOS 7.3
3131
baseurl: "{{ nexus_yum_redos_7_3 }}"
32-
username: "{{ nexus_username }}"
33-
password: "{{ nexus_password }}"
3432
gpgcheck: true
3533
gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-tantorlabs"
3634
when:
@@ -42,8 +40,6 @@
4240
name: tantorlabs
4341
description: Tantorlabs repository for RedOS 8.0
4442
baseurl: "{{ nexus_yum_redos_8_0 }}"
45-
username: "{{ nexus_username }}"
46-
password: "{{ nexus_password }}"
4743
gpgcheck: true
4844
gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-tantorlabs"
4945
when:

0 commit comments

Comments
 (0)