Skip to content
Snippets Groups Projects
Commit 8917df17 authored by František Dvořák's avatar František Dvořák
Browse files

Move asset management secrets in vault to site-specific path

parent feab494a
No related branches found
No related tags found
No related merge requests found
--- ---
# #
# Secrets in "/glpi-agent": # Secrets in "/{{ site_name }}":
# #
# * server (or local) # Anything starting "glpi_" will be propagated to the confiugration.
# * user #
# * password # Expected secrets:
# * tag #
# * glpi_local (for debugging)
# * glpi_server (for remote assets management integration)
# * glpi_user
# * glpi_password
# * glpi_tag
# #
- name: GLPI Agent Configuration - name: GLPI Agent Configuration
hosts: allnodes hosts: allnodes
...@@ -13,7 +18,7 @@ ...@@ -13,7 +18,7 @@
tasks: tasks:
- name: Get Secrets From Vault - name: Get Secrets From Vault
set_fact: set_fact:
secret: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/glpi-agent', token_validate=false) }}" secret: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/site-' + site_name, token_validate=false) }}"
- name: Debug Secrets - name: Debug Secrets
debug: debug:
msg: "{{ item.key }} = {{ item.value }}" msg: "{{ item.key }} = {{ item.value }}"
......
{{ ansible_managed | comment }} {{ ansible_managed | comment }}
{% for key, value in secret.items() -%} {% for key, value in secret.items() -%}
{% if value|length -%} {% if key | regex_search('^glpi_') -%}
{{ key }} = {{ value }} {{ key | regex_replace('^glpi_', '') }} = {{ value }}
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment