-2
我試圖在/ SRV /鹽/非PROD爲鹽的狀態適用於我的非督促環境 我得到這個結果:如何鹽狀態適用於只是一個環境
[[email protected] non-prod]# salt '*' state.apply
salt.localdomain:
----------
ID: states
Function: no.None
Result: False
Comment: No Top file or external nodes data matches found.
Changes:
Summary for salt.localdomain
------------
Succeeded: 0
Failed: 1
我在我的主配置定義這個位置
non-prod:
- /srv/non-prod
- /srv/salt/non-prod/services
- /srv/salt/non-prod/states
我有一個頂層文件位於:
[[email protected] ~]# cat /srv/salt/non-prod/top.sls
base:
'*':
- apache
- python
- ssh
- users
這些都是非prod目錄
[[email protected] ~]# ls -lh /srv/salt/non-prod/
total 16K
drwxr-xr-x. 2 root root 4.0K Oct 3 21:02 apache
drwxr-xr-x. 2 root root 45 Oct 3 20:57 python
drwxr-xr-x. 2 salt salt 6 Oct 3 14:10 services
drwxr-xr-x. 2 root root 54 Oct 3 18:23 ssh
drwxr-xr-x. 2 salt salt 6 Oct 3 14:10 states
-rw-r--r--. 1 root root 80 Oct 3 15:29 state.template
-rw-r--r--. 1 root root 174 Oct 3 15:30 test.sls
-rw-r--r--. 1 root root 61 Oct 3 21:14 top.sls
drwxr-xr-x. 2 root root 22 Oct 3 21:03 users
drwxr-xr-x. 2 salt salt 99 Oct 3 18:28 webserver
它包含了一些鹽模塊
如何申請鹽的狀態,只是非督促環境的內容是什麼?
這很有效。但是我如何解決這個問題是通過設置環境:/ etc/salt/minion配置中的non-prod變量。重新啓動奴才服務得到了這個工作。我也測試了你的方法,我也是這樣工作的。謝謝! – bluethundr