Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F14038858
init.sls
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
init.sls
View Options
# -------------------------------------------------------------
# Salt — Vault
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{%
set
policies_path
=
pillar
[
'vault_policies_path'
]
%}
# -------------------------------------------------------------
# Policies storage folder
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{
policies_path
}}
:
file.directory
:
-
makedirs
:
True
# -------------------------------------------------------------
# Policies from vault_policies pillar entry
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{%
for
policy
in
pillar
[
'vault_policies'
]
%}
{%
set
policy_path
=
policies_path
+
"/"
+
policy
+
".hcl"
%}
{{
policy_path
}}
:
file.managed
:
-
source
:
salt://roles/vault/policies/files/
{{
policy
}}
.hcl
-
template
:
jinja
vault_policy_
{{
policy
}}
:
credentials.vault_policy_present
:
-
name
:
{{
policy
}}
-
policy_file
:
{{
policy_path
}}
-
onchanges
:
-
file
:
{{
policy_path
}}
{%
endfor
%}
{%
set
salt_policy
=
pillar
[
"vault_salt_primary_policy"
]
%}
{%
if
salt_policy
[
"target"
]
!=
salt_policy
[
"source"
]
%}
{%
set
policy_path
=
policies_path
+
"/"
+
salt_policy
[
"source"
]
+
".hcl"
%}
vault_policy_copy_for_salt
:
credentials.vault_policy_present
:
-
name
:
{{
salt_policy
[
"target"
]
}}
-
policy_file
:
{{
policy_path
}}
-
onchanges
:
-
file
:
{{
policy_path
}}
{%
endif
%}
# -------------------------------------------------------------
# Policies per nodes intended to be used through Salt
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{%
for
node
,
rules
in
salt
[
'credentials.build_policies_by_node'
]()
.items
()
%}
salt-node-
{{
node
}}
:
vault.policy_present
:
-
rules
:
|
#
# <auto-generated>
# This policy is managed by our rOPS SaltStack repository.
# </auto-generated>
#
{{
rules
|
indent
(
8
)
}}
{%
endfor
%}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 28, 17:32 (5 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3168258
Default Alt Text
init.sls (2 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment