From 3b35daafe61d174cb794170c7ca728d69451b93b Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 27 May 2026 12:33:23 +0200 Subject: [PATCH] build --- roles/kubernetes/tasks/Debian.yml | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/roles/kubernetes/tasks/Debian.yml b/roles/kubernetes/tasks/Debian.yml index e8ba69c..93b6e53 100644 --- a/roles/kubernetes/tasks/Debian.yml +++ b/roles/kubernetes/tasks/Debian.yml @@ -36,6 +36,51 @@ until: "'System clock synchronized: yes' in timedatectl_status.stdout" changed_when: false + - name: Read GitLab password from Vault + ansible.builtin.set_fact: + gitlab_private_key: >- + {{ + lookup( + 'community.hashi_vault.hashi_vault', + 'secret=secret/data/gitlab ' + ~ 'field=ssh_private_key ' + ~ 'url=http://vault.home.lan:8205 ' + ~ 'token=' ~ lookup('env', 'VAULT_TOKEN') + ) + }} + - name: Read GitLab password from Vault + ansible.builtin.set_fact: + gitlab_public_key: >- + {{ + lookup( + 'community.hashi_vault.hashi_vault', + 'secret=secret/data/gitlab ' + ~ 'field=ssh_public_key ' + ~ 'url=http://vault.home.lan:8205 ' + ~ 'token=' ~ lookup('env', 'VAULT_TOKEN') + ) + }} + + - name: Store ssh key in file + ansible.builtin.copy: + content: "{{ gitlab_private_key }}\n" + dest: /home/{{ ansible_user_id }}/.ssh/id_ed25519_gitlab + owner: "{{ ansible_user_id }}" + group: "{{ ansible_user_id }}" + mode: '0600' + + - name: Store ssh key in file + ansible.builtin.copy: + content: "{{ gitlab_public_key }}\n" + dest: /home/{{ ansible_user_id }}/.ssh/id_ed25519_gitlab.pub + owner: "{{ ansible_user_id }}" + group: "{{ ansible_user_id }}" + mode: '0600' + + - name: Show password + ansible.builtin.debug: + var: gitlab_password.token + - name: Create apt proxy file ansible.builtin.copy: dest: /etc/apt/apt.conf.d/02proxy