added task to add custom repo

Change-Id: I0b7e0da2621ee94d26af3802551f8f48b80666b8
This commit is contained in:
Vladimir Blando 2020-06-30 21:37:43 +08:00 committed by Mohammed Naser
parent 5cc2c776df
commit cceeb8ee66
2 changed files with 26 additions and 0 deletions

View File

@ -15,3 +15,11 @@
base_server_groups: [] base_server_groups: []
base_server_users: [] base_server_users: []
base_server_apt_keys:
- id: "1586E327"
url: "http://repo.vexxhost.net/key.gpg"
state: "present"
base_server_apt_repositories:
- filename: "vexxhost"
url: "deb http://repo.vexxhost.net/ buster main"
state: "present"

View File

@ -36,3 +36,21 @@
state: "{{ item.state | default(omit) }}" state: "{{ item.state | default(omit) }}"
become: true become: true
with_items: "{{ base_server_users }}" with_items: "{{ base_server_users }}"
- name: Import APT keys
apt_key:
id: "{{ item.id }}"
url: "{{ item.url }}"
state: "{{ item.state | default(omit) }}"
become: true
when: ansible_os_family == "Debian"
loop: "{{ base_server_apt_keys }}"
- name: Add APT repositories
apt_repository:
repo: "{{ item.url }}"
filename: "{{ item.filename }}"
state: "{{ item.state | default(omit) }}"
become: true
when: ansible_os_family == "Debian"
with_items: "{{ base_server_apt_repositories }}"