|
saltstack 实战(一)
基于saltstack 实战(一)目录结构配置文件
利用saltstack安装常用软件
# vim /data/salt/salt/base/pkgs.sls base_pkgs: pkg: - name: base_pkgs - installed - pkgs: - iftop - iotop - lrzsz - vim - tmux - wget # vim /data/salt/salt/top.sls base: '*': - base.repo #同步软件源 - base.pkgs #安装常用软件测试
# salt 'localhost' state.highstate #执行同步localhost:---------- ID: /etc/yum.repos.d/remi-php70.repo Function: file.managed Result: True Comment: File /etc/yum.repos.d/remi-php70.repo is in the correct state Started: 14:27:55.885799 Duration: 6.2 ms Changes: ---------- ID: base_pkgs Function: pkg.installed Result: True Comment: The following packages were installed/updated: iotop, wget, iftop The following packages were already installed: lrzsz, tmux Started: 14:27:56.095978 Duration: 58007.494 ms Changes: ---------- iftop: #安装iftop 版本为1.0-0.7.pre4.el7 ---------- new: 1.0-0.7.pre4.el7 old: iotop: #安装iotop 版本为0.6-2.el7 ---------- new: 0.6-2.el7 old: wget: #安装wget 版本为1.14-10.el7_0.1 ---------- new: 1.14-10.el7_0.1 old:Summary------------Succeeded: 2 (changed=1)Failed: 0------------Total states run: 2如果没软件源,可以先利用saltstack同步yum源
|
|
|
|
|
|
|