SLS中的ID不是字典

时间:2016-01-06 10:53:50

标签: postgresql provisioning salt-stack

我尝试使用SaltStack配置我的Vagrant驱动的VM。我想安装和配置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不喜欢它。 你们有个主意吗?

1 个答案:

答案 0 :(得分:3)

发现它! postgres_user.presentpostgres_database.present前面的破折号导致解析错误。没有他们一切都很好。