fix(secrets_hcv): fix DEB package install

* Install HC Vault on both Debian and Ubuntu in the same way
* Fix the branching for userspace install vs package manager install

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2024-12-29 17:51:21 +01:00
parent 61617ad70e
commit c4e3bcde62
Signed by: mfocko
SSH key fingerprint: SHA256:icm0fIOSJUpy5+1x23sfr+hLtF9UhY8VpMC7H4WFJP8
4 changed files with 16 additions and 15 deletions

View file

@ -0,0 +1 @@
install_deb.yml

View file

@ -1,13 +0,0 @@
---
- name: Add HashiCorp GPG Key
ansible.builtin.get_url:
url: https://apt.releases.hashicorp.com/gpg
dest: /etc/apt/keyrings/hashicorp.asc
mode: 0640
become: true
- name: Add HashiCorp repository
ansible.builtin.apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/hashicorp.gpg] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main"
state: present
become: true

View file

@ -0,0 +1 @@
install_deb.yml

View file

@ -0,0 +1,12 @@
---
- name: Add HashiCorp repository
ansible.builtin.deb822_repository:
name: hashicorp
types: deb
uris: https://apt.releases.hashicorp.com
suites: "{{ ansible_distribution_release }}"
components:
- main
signed_by: https://apt.releases.hashicorp.com/gpg
state: present
become: true

View file

@ -1,6 +1,6 @@
---
- name: Install HC Vault via package manager
when: ansible_distribution in [ "AlmaLinux", "CentOS", "Fedora", "Rocky", "Ubuntu"]
when: ansible_distribution in [ "AlmaLinux", "CentOS", "Debian", "Fedora", "Rocky", "Ubuntu" ]
tags: install
block:
- name: Enable repository
@ -14,7 +14,7 @@
- name: Install HC Vault to userspace
ansible.builtin.include_tasks: install_user.yml
when: ansible_distribution not in [ "AlmaLinux", "CentOS", "Fedora", "Ubuntu"]
when: ansible_distribution not in [ "AlmaLinux", "CentOS", "Debian", "Fedora", "Rocky", "Ubuntu" ]
tags: install
- name: Install vssh script