bash - How to write Vault LDAP Auth Configuration from a json config file?
问题描述
In my hashicorp vault container. I want to use the the ldap auth method to allows authentication https://www.vaultproject.io/docs/auth/ldap.html
I'm writing a shell script that should write vault ldap configuration from a json file. My vault ldap configuration with the connection parameters is stored in the same directory and is named as parameters.json. What is the correct syntax to load LDAP connection parameters from an external file?
vault auth enable ldap
vault write auth/ldap/config config=@parameters.json
The above command does not overwrite the values from this file.
解决方案
通过将其替换为带有键值对的文本值(key1=value 1 .... key n..value n)使其工作
vault write auth/ldap/config binddn=@binddn bindpass=@bindpass url =@url
显然ldap连接属性需要一个个指定,无法导入json文件解析
推荐阅读
- r - R中如何读取数据文件、保存和删除
- php - Mailchimp 使用 php 和 drupal 8 将标签添加到列表中的现有成员
- curl - 使用 XML 到 Powershell 5 的 Curl 命令
- symfony - Symfony 形式的循环引用
- python - 请求非白色站点
- python - 合并具有许多稀疏列的两个 Pandas DataFrame 会导致 DataFrame 需要不成比例的大量内存
- spring - Kotlin with Spring - 响应后执行操作
- r - 形式的奇怪失败()
- javascript - 如何使用 json-server 将 Mock API 调用保存到 2 个地方?
- python - 如何在mac上的vscode上安装包?