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)
# * user
# * password
# * tag
# Anything starting "glpi_" will be propagated to the confiugration.
#
# Expected secrets:
#
# * glpi_local (for debugging)
# * glpi_server (for remote assets management integration)
# * glpi_user
# * glpi_password
# * glpi_tag
#
- name: GLPI Agent Configuration
hosts: allnodes
......@@ -13,7 +18,7 @@
tasks:
- name: Get Secrets From Vault
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
debug:
msg: "{{ item.key }} = {{ item.value }}"
......
{{ ansible_managed | comment }}
{% for key, value in secret.items() -%}
{% if value|length -%}
{{ key }} = {{ value }}
{% if key | regex_search('^glpi_') -%}
{{ key | regex_replace('^glpi_', '') }} = {{ value }}
{% endif -%}
{% 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