多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
1)创建目录 [admin@master ~]$ sudo mkdir -p /srv/salt/prod/pcre [admin@master ~]$ sudo mkdir -p /srv/salt/prod/pcre/files 2)下载pcre软件 [admin@master files]$ sudo wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz 3)编写sls文件 ~~~ [admin@master pcre]$ sudo vim install.sls include: - pkg.pkg-init pcre-source-install: file.managed: - name: /usr/local/src/pcre-8.41.tar.gz - source: salt://pcre/files/pcre-8.41.tar.gz - user: root - group: root - mode: 755 cmd.run: - name: cd /usr/local/src && sudo tar xf pcre-8.41.tar.gz && cd pcre-8.41 && sudo ./configure --prefix=/usr/local/pcre && sudo make && sudo make install - unless: test -d /usr/local/pcre - require: - file: pcre-source-install ~ ~~~ 4)测试sls有没有问题 [admin@master pcre]$ sudo salt 'proxy01*' state.sls pcre.install env="prod" test=True