mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2026-09-08 21:27:36 +02:00
build
This commit is contained in:
@@ -36,6 +36,51 @@
|
|||||||
until: "'System clock synchronized: yes' in timedatectl_status.stdout"
|
until: "'System clock synchronized: yes' in timedatectl_status.stdout"
|
||||||
changed_when: false
|
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
|
- name: Create apt proxy file
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /etc/apt/apt.conf.d/02proxy
|
dest: /etc/apt/apt.conf.d/02proxy
|
||||||
|
|||||||
Reference in New Issue
Block a user