我刚接触saltstack,所以我开始使用无服务器,直到我的东西基本正常工作。但为了让它基本上正常工作,我想使用公式,这意味着我应该指定gitfs_remotes,但这只在主服务器上有效(看起来是这样)。
所以我克隆了https://github.com/my-organisation/openssh-formula.git
,并将openssh公式/openssh移动到/srv/salt/openssh/。
现在在top.sls
中我说
base:
'*':
- system # sshd, git, system
在system/init.sls
中,我说(在其他事情中)
open_sshd_server:
openssh
这是失败的:
[T] ubuntu@ubuntu-xenial:vagrant $ sudo salt-call --local state.highstate
local:
Data failed to compile:
----------
ID open_sshd_server in SLS system is not a dictionary
[T] ubuntu@ubuntu-xenial:vagrant $
不过,有效的方法是将openssh安装推到顶层:
base:
'*':
- system # not sshd, but git, system
- openssh
但这是愚蠢的,将公式调用只放在顶层是可怕的和不可扩展的组织。
谁能给我指出正确的方向?
发布于 2018-01-23 04:05:24
您可以使用include来实现这一点。
include:
- openssh
- openssh.config
发布于 2018-01-23 17:00:22
您的SLS文件结构很好。你不需要把公式调用放在最高级别。
问题出在州open_sshd_server
。您可以使用以下结构进行单包安装:
openssh:
pkg.installed
对于多个软件包的安装:
xfce:
pkg.installed:
- pkgs:
- Thunar
- thunar-archive-plugin
- polkit-gnome
- xfce4-panel
- xfce4-session
- xfce4-settings
- ...
使用pkg.installed
时,您不需要任何need条件。
https://stackoverflow.com/questions/48385850
复制相似问题