Skip to content

Commit

Permalink
style: add _microsoft_repository_local_gpgkey variable and merge de…
Browse files Browse the repository at this point in the history
…bian/ubuntu vars files (#14)
  • Loading branch information
antmelekhin authored Mar 15, 2024
1 parent 949b644 commit f3b74a5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tasks/install-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- name: 'Add Microsoft APT key'
ansible.builtin.apt_key:
url: '{{ microsoft_repository_gpgkey }}'
keyring: '/usr/share/keyrings/microsoft-archive-keyring.gpg'
keyring: '{{ _microsoft_repository_local_gpgkey }}'
state: present
when: not ansible_check_mode

Expand Down
4 changes: 2 additions & 2 deletions templates/microsoft.list.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

{% for microsoft_repository_dir in microsoft_repository_dirs_list %}
{% if microsoft_repository_dir.type is defined and microsoft_repository_dir.type == 'alternative' %}
deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] {{ _microsoft_repository_alternative_mirror_url }}/{{ microsoft_repository_dir.name }} {{ ansible_distribution_release }} main
deb [arch=amd64,arm64,armhf signed-by={{ _microsoft_repository_local_gpgkey }}] {{ _microsoft_repository_alternative_mirror_url }}/{{ microsoft_repository_dir.name }} {{ ansible_distribution_release }} main
{% else %}
deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] {{ _microsoft_repository_base_mirror_url }}/{{ microsoft_repository_dir.name }} {{ ansible_distribution_release }} main
deb [arch=amd64,arm64,armhf signed-by={{ _microsoft_repository_local_gpgkey }}] {{ _microsoft_repository_base_mirror_url }}/{{ microsoft_repository_dir.name }} {{ ansible_distribution_release }} main
{% endif %}
{% endfor %}
5 changes: 4 additions & 1 deletion vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
_microsoft_repository_base_mirror_url: '{{ microsoft_repository_mirror_url }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}'
_microsoft_repository_local_gpgkey: '/usr/share/keyrings/microsoft-archive-keyring.gpg'

_microsoft_repository_distribution_version: "{{ (ansible_distribution == 'Ubuntu') | ternary(ansible_distribution_version, ansible_distribution_major_version) }}"
_microsoft_repository_base_mirror_url: '{{ microsoft_repository_mirror_url }}/{{ ansible_distribution | lower }}/{{ _microsoft_repository_distribution_version }}'
_microsoft_repository_alternative_mirror_url: '{{ microsoft_repository_mirror_url }}/repos'
3 changes: 0 additions & 3 deletions vars/Ubuntu.yml

This file was deleted.

0 comments on commit f3b74a5

Please sign in to comment.