0

私は塩を学ぼうとしています。面倒であることが証明されています。マスター構成を回避することさえできません。下の行の何が問題になっていますか?

#/etc/salt/master
file_roots:
   base:
      - /home/ubuntu/workspace/salt/states/base

salt-key -L
[ERROR   ] Error parsing configuration file: /etc/salt/master - expected '<document start>', but found '<block mapping start>'
  in "<string>", line 298, column 1:
    file_roots:
    ^




#####      File Server settings      #####
##########################################
# Salt runs a lightweight file server written in zeromq to deliver files to
# minions. This file server is built into the master daemon and does not
# require a dedicated port.

# The file server works on environments passed to the master, each environment
# can have multiple root directories, the subdirectories in the multiple file
# roots cannot match, otherwise the downloaded files will not be able to be
# reliably ensured. A base environment is required to house the top file.
# Example:
file_roots:
  base:
   - /home/ubuntu/workspace/salt/states/base
#    development:
#     - /home/ubuntu/workspace/salt/states/dev
#   dev:
#     - /srv/salt/dev/services
#     - /srv/salt/dev/states
#   prod:
#     - /srv/salt/prod/services
#     - /srv/salt/prod/states

#file_roots:
#  base:
#    - /srv/salt
4

2 に答える 2

2

問題は次のとおりです。

YAML では、スペースとインデントが非常に重要です。各レベルに 2 つのスペースが必要です。には 2 つのスペースがありますがbase:、前に 4 つのスペースが必要です。

- /home/ubuntu/workspace/salt/states/base

これが正しいものです:

file_roots:
  base:
    - /home/ubuntu/workspace/salt/states/base
于 2014-05-22T18:47:11.510 に答える
1

/etc/salt/master の関連セクションを詳しく調べないと、問題に対する正確な答えを出すのは困難ですが、不正な形式の yaml エラーが表示されます。file_roots セクションは次のようになります。

file_roots:
  base:
    - /srv/salt

詳細はこちら: http://docs.saltstack.com/en/latest/ref/file_server/file_roots.html#directory-overlay

また、表示している yaml の上にエラーがある可能性もあります。より多くの構成を投稿していただければ (もちろんサニタイズ済みです)、より適切なサポートを提供できます。

于 2014-04-18T16:32:50.703 に答える