我使用saltstack來部署我的服務器。 我想在一臺服務器上安裝所有「tomcat7」pkgs。所以我寫了SLS文件是這樣的:SaltStack:如何在「sls」中使用正則表達式來編寫pkgs?
^tomcat7.*:
pkg:
- installed
- require:
- pkg: openjdk-7-jdk
但最終,它收到一個錯誤:
----------
State: - pkg
Name: ^tomcat7.*
Function: installed
Result: False
Comment: Package ^tomcat7.* failed to install
Changes:
但事實上,服務器安裝所有^ tomcat7 *包成功地。
[email protected]:~# dpkg -l tomcat7*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================================================-===============================-===============================-===============================================================================================================
ii tomcat7 7.0.35-1~exp2ubuntu1.1 all Servlet and JSP engine
ii tomcat7-admin 7.0.35-1~exp2ubuntu1.1 all Servlet and JSP engine -- admin web applications
ii tomcat7-common 7.0.35-1~exp2ubuntu1.1 all Servlet and JSP engine -- common files
ii tomcat7-docs 7.0.35-1~exp2ubuntu1.1 all Servlet and JSP engine -- documentation
ii tomcat7-examples 7.0.35-1~exp2ubuntu1.1 all Servlet and JSP engine -- example web applications
ii tomcat7-user 7.0.35-1~exp2ubuntu1.1 all Servlet and JSP engine -- tools to create user instances
如何解決這個問題?我需要將所有^ tomcat7。* pkgs一個一個寫出來嗎?
非常感謝!我懂了。 –