Page MenuHomeDevCentral

D2824.id7208.diff
No OneTemporary

D2824.id7208.diff

diff --git a/_modules/credentials.py b/_modules/credentials.py
--- a/_modules/credentials.py
+++ b/_modules/credentials.py
@@ -188,6 +188,8 @@
def _resolve_vault_path(vault_path):
+ vault_path = vault_path.replace("%%node%%", __grains__["id"])
+
for pillar_path, mount_path in __pillar__.get("vault_mount_paths", {}).items():
if vault_path.startswith(pillar_path):
start_position = len(pillar_path)
diff --git a/pillar/credentials/vault.sls b/pillar/credentials/vault.sls
--- a/pillar/credentials/vault.sls
+++ b/pillar/credentials/vault.sls
@@ -75,10 +75,15 @@
# Avoid * notation as this namespace is shared between Vault
# and the applications. As such, only secrets the Salt nodes
# needs in a state they need to deploy should be listed here.
+#
+# Use %%node%% as variable for node name.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
vault_secrets_by_role:
+ devserver:
+ - ops/secrets/nasqueron/notifications/notifications-cli/%%node%%
+
opensearch:
- ops/secrets/nasqueron.opensearch.infra-logs.internal_users.admin
- ops/secrets/nasqueron.opensearch.infra-logs.internal_users.dashboards
diff --git a/roles/devserver/userland-software/files/notifications.conf b/roles/devserver/userland-software/files/notifications.conf
--- a/roles/devserver/userland-software/files/notifications.conf
+++ b/roles/devserver/userland-software/files/notifications.conf
@@ -14,12 +14,10 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-# TODO: when Vault is installed, add password here through a Vault pillar.
-
[Broker]
-Host=white-rabbit.nasqueron.org
+Host=172.27.27.5
User=notifications-{{ grains['id'] }}
-Password=changeme
+Password={{ password }}
Vhost=dev
Exchange=notifications
diff --git a/roles/devserver/userland-software/notifications.sls b/roles/devserver/userland-software/notifications.sls
--- a/roles/devserver/userland-software/notifications.sls
+++ b/roles/devserver/userland-software/notifications.sls
@@ -35,6 +35,8 @@
/usr/local/etc/notifications.conf:
file.managed:
- source: salt://roles/devserver/userland-software/files/notifications.conf
- - template: jinja
- group: wheel
- mode: 640
+ - template: jinja
+ - context:
+ password: {{ salt['credentials.get_password']("nasqueron/notifications/notifications-cli/" + grains["id"]) }}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 03:11 (20 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249517
Default Alt Text
D2824.id7208.diff (2 KB)

Event Timeline