环境
| 主机名 | IP | 名称 |
|---|---|---|
| wyt1 | 192.168.232.128 | saltstack主 |
| wyt2 | 192.168.232.129 | saltstack被 |
在控制机上安装saltstack主控端软件,在被控机上安装salt-minion客户端(详情看SaltStack介绍及安装)
salt-minion与salt-master的认证
//查看当前证书情况
[root@wyt1 ~]# salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
wyt1
wyt2
Rejected Keys:
//接受指定minion的新证书
[root@wyt1 ~]# salt-key -ya 'wyt2'
The following keys are going to be accepted:
Unaccepted Keys:
wyt2
Key for minion wyt2 accepted.
[root@wyt1 ~]# salt-key -L
Accepted Keys:
wyt2
Denied Keys:
Unaccepted Keys:
Rejected Keys:
配置yum源sls文件
[root@wyt1 modules]# cd yum
[root@wyt1 yum]# ls
files init.sls
[root@wyt1 yum]# cd files/
[root@wyt1 files]# ls
Centos-7.repo epel-7.repo
[root@wyt1 files]# cd ..
[root@wyt1 yum]# vim init.sls
/etc/yum.repos.d/Centos-7.repo:
file.managed:
- source: salt://modules/yum/files/Centos-7.repo
- user: root
- group: root
- mode: 0644
/etc/yum.repos.d/epel-7.repo:
file.managed:
- source: salt://modules/yum/files/epel-7.repo
- user: root
- group: root
- mode: 0644
clean_cache:
cmd.run:
- name: yum clean all && yum makecache
install_package:
pkg.installed:
- pkgs:
- libaio
- libaio-devel
配置依赖包sls文件
[root@wyt1 base]# cd modules/
[root@wyt1 modules]# ls
app common database web yum
[root@wyt1 modules]# cd common/
[root@wyt1 common]# ls
init.sls
[root@wyt1 common]# vim init.sls
common_packages_install:
pkg.installed:
- pkgs:
- wget
- gcc
- gcc-c++
- vim-enhanced
- openssl
- openssl-devel
- pcre-devel
- expat-devel
- libtool
- ncurses-devel
- openssl
- cmake
- mariadb-devel
- java-1.8.0-openjdk
- java-1.8.0-openjdk-devel
cmd.run:
- name: yum groups mark install "Development Tools"
在Master上部署apache.sls文件
[root@wyt1 modules]# cd web/apache/
[root&#
最后
以上就是沉默金鱼最近收集整理的关于SaltStack自动化部署lamt环境的全部内容,更多相关SaltStack自动化部署lamt环境内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复