Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3768910
credentials.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
964 B
Referenced Files
None
Subscribers
None
credentials.py
View Options
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Salt — Credentials state
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Description: Allow to declare credentials-related states
# License: BSD-2-Clause
# -------------------------------------------------------------
from
salt.utils.files
import
fopen
def
vault_policy_present
(
name
,
policy_file
):
"""
Ensure a Vault policy with the given name is present.
name
The name of the policy
policy_file
Path to a file on the minion containing rules,
formatted in HCL.
.. code-block:: yaml
demo_policy:
vault.policy_present:
- name: foo/bar
- policy_file: /opt/vault-policies/demo.hcl
"""
with
fopen
(
policy_file
)
as
fd
:
rules
=
fd
.
read
()
return
__states__
[
"vault.policy_present"
](
name
,
rules
)
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Mon, Nov 25, 11:22 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260076
Default Alt Text
credentials.py (964 B)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment