Knowledge base of ~80+ markdown files across 14 domains (00-13), Logseq graph, hardware design files (KiCAD), infrastructure configs, and talas-wiki static site. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
20 lines
843 B
YAML
20 lines
843 B
YAML
---
|
|
# file: roles/postgres-explain-visualizer/tasks/secrest.yml
|
|
|
|
- name: "handle secret {{ secret }}"
|
|
block:
|
|
- name: "get {{ secret }} from hashicorp vault"
|
|
set_fact:
|
|
"{{ secret }}": "{{ lookup('hashi_vault', 'secret=cosium-kv/data/' + host_vars_location + '/' + ansible_hostname)[secret] }}"
|
|
rescue:
|
|
- name: "generate a random password for {{ secret }}"
|
|
set_fact:
|
|
password: "{{ lookup('password','/dev/null chars=ascii_letters,digits length=50') }}"
|
|
- name: "patching hashicorp vault with generated {{ secret }}"
|
|
delegate_to: localhost
|
|
become: no
|
|
command: "vault kv patch cosium-kv/{{ host_vars_location }}/{{ ansible_hostname }} {{ secret }}={{ password }}"
|
|
- name: "assign password value to {{ secret }}"
|
|
set_fact:
|
|
"{{ secret }}": "{{ password }}"
|
|
tags: pev
|