add hashicorp apt repository

This commit is contained in:
Pim Kunis 2023-02-11 21:12:19 +01:00
parent edb5d46e5c
commit 1abbb0872b

View file

@ -35,3 +35,19 @@
file:
path: ~/repos
state: directory
- name: Download Hashicorp signing key
become: true
apt_key:
keyserver: keyserver.ubuntu.com
id: "798AEC654E5C15428C8E42EEAA16FCBCA621E701"
keyring: /etc/apt/keyrings/hashicorp.gpg
- name: Install Hashicorp repository
become: true
apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/hashicorp.gpg] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main"
register: apt_repository
- name: Update APT cache
become: true
apt:
update_cache: true
when: apt_repository.changed