ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
1)创建目录 [admin@master ~]$ sudo mkdir -p /srv/salt/prod/zlib [admin@master ~]$ sudo mkdir -p /srv/salt/prod/zlib/files 2)下载zlib软件 [admin@master files]$ sudo wget http://www.zlib.net/zlib-1.2.11.tar.gz 3)编写sls文件 ~~~ [admin@master zlib]$ cat install.sls include: - pkg.pkg-init zlib-source-install: file.managed: - name: /usr/local/src/zlib-1.2.11.tar.gz - source: salt://zlib/files/zlib-1.2.11.tar.gz - user: root - group: root - mode: 755 cmd.run: - name: cd /usr/local/src && sudo tar xf zlib-1.2.11.tar.gz && cd zlib-1.2.11 && sudo ./configure --prefix=/usr/local/zlib && sudo make && sudo make install - unless: test -d /usr/local/zlib - require: - file: zlib-source-install ~~~ 4)测试 [admin@master zlib]$ sudo salt 'proxy01*' state.sls zlib.install env=prod test=True Summary ------------- Succeeded: 13 (unchanged=2, changed=1) Failed: 0 ------------- Total states run: 13