gpt4 book ai didi

postgresql - SLS 中的 ID 不是字典

转载 作者:行者123 更新时间:2023-11-29 14:19:30 28 4
gpt4 key购买 nike

我尝试使用 SaltStack 配置我的 Vagrant 驱动的虚拟机。我想安装和配置 PostgreSQL。这是我的状态:

postgresql-installation:
# adding repo, installing package, starting service here

postgresql-database-setup:
- postgres_user.present:
- name: {{ pillar['pg_db_user'] }}
- password: {{ pillar['pg_db_password'] }}
- require:
- service: postgresql
- postgres_database.present:
- name: {{ pillar['pg_db_name'] }}
- encoding: {{ pillar['pg_db_encoding'] }}
- lc_ctype: {{ pillar['pg_db_ctype'] }}
- lc_collate: {{ pillar['pg_db_collate'] }}
- template: {{ pillar['pg_db_template'] }}
- owner: {{ pillar['pg_db_user'] }}
- require:
- postgres_user: postgresql-database-setup

postgres-installation 工作完美,但 postgres-database-setup 让我头疼。运行配置时,Salt 抛出此错误:

Data failed to compile:
----------
ID postgresql-database-setup in SLS postgresql is not a dictionary

YAMLlint.com 说它是有效的(当然除了 Jinja 标签)而且我不知道 Salt 不喜欢它的什么地方。你们有想法吗?

最佳答案

找到了! postgres_user.presentpostgres_database.present 前面的破折号导致解析错误。没有它们一切正常。

关于postgresql - SLS 中的 ID 不是字典,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34631341/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com