Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install commonly used rpm packages in saltstack

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to install commonly used rpm packages in saltstack". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "how to install commonly used rpm packages in saltstack"!

First we use the pkg module to install common rpm packages for an initial installation of centos, such as vim unzip wget, etc.

Here is how to configure SLS files

mkdir /srv/salt/init -pvvi/srv/salt/init/pkg-install.sls#Add the following: common_packages: pkg.installed: - pkgs: - unzip - dos2unix #Tip If there are other initializers to initialize e.g. gcc ,gcc-c++, add them all at once below.

#Perform operations

[root@salt01 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[root@salt01 init]#

#This way, salt02 will install the installation package you specified on this minion.

#View Minion End

[root@salt02 ~]# rpm -qa dos2unix unzipdos2unix-3.1-37.el6.x86_64unzip-6.0-2.el6_6.x86_64

Of course, if you need to show more common packages installed, you can continue to follow

pkg-install.sls

Continue to add the package name you need.

At this point, I believe everyone has a deeper understanding of "how to install commonly used rpm packages in saltstack", so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report