First we use the PKG module to install a commonly used RPM package for an initial installation of the CentOS system , for example:vim unzip wget, etc.
Here is how to configure the SLS file
mkdir/srv/salt/init-pvvi/srv/salt/init/pkg-install.sls# Add the following: common_packages:pkg.installed:-pkgs:-Unzip -Dos2unix #提示如果还有其他要初始化的例如: gcc, gcc-c++ on the next add-on.
#执行操作
[[Email protected] init] #salt ' salt02 ' state.sls init.pkg-installsalt02:---------- ID: common_packages function: pkg.installed result: true Comment: The following packages were installed/updated: dos2unix, unzip started: 14:00:56.508285 duration: 17426.738 ms changes: ---------- dos2unix: ---------- new: 3.1-37.el6 old: unzip: ---------- new: 6.0-2.el6_6 old: Summary------------succeeded: 1 (changed=1) failed: 0------------total States run: 1[[email protected] init]#
#这样salt02这个minion上就安装上你指定的安装包了.
#查看minion端
[Email protected] ~]# Rpm-qa Dos2unix unzipdos2unix-3.1-37.el6.x86_64unzip-6.0-2.el6_6.x86_64
Of course if you need to show the installation of more common software packages, you can continue to follow
Pkg-install.sls
Format to continue adding the package name you need.
Of course if you need to execute more Minion objects, please refer to:
Saltstack-gdlwolf Self-study summary of the third article: Salt common Instructions
http://gdlwolf.blog.51cto.com/343866/1786908
Refer to section 3rd above: The methods in all operation target parameters, executed to more Minion end in different ways.
This article is from the "Gdlwolf blog" blog, make sure to keep this source http://gdlwolf.blog.51cto.com/343866/1786919
Saltstack-gdlwolf Self-study summary of the fifth (method case): Pkg module initialization installation system common software package