手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

ansible使用yum源安装http服务

时间:2024-10-22 21:29:43

1、部署两台centos7系统:192.168.1.8作为ansible节点192.1瀵鸦铙邮68.1.4作为服务节点

ansible使用yum源安装http服务

2、在服务节点编写yum配置文件: [server觥终柯计]name=serverbaseurl=file:///mntgpgcheck=0enabled=1

ansible使用yum源安装http服务

3、在服务节点准备yum源

ansible使用yum源安装http服务

4、在ansible节点编写yml脚本:---- name: install host衡痕贤伎s: 192.168.1.4 tasks: - na罪焐芡拂me: install http #安装 yum: name: httpd state: latest - name: start httpd #启动服务 service: name: httpd state: started - name: touch index file #定义测试页面 shell: echo "install httpd" > /var/www/html/index.html

ansible使用yum源安装http服务

5、执行yml脚本

ansible使用yum源安装http服务

6、从服务节点确认服务已安装成功并已启动

ansible使用yum源安装http服务

7、从ansible节点访问服务节点,确认访问内容是定义的内容,与预期一致,httpd服务安装成功

ansible使用yum源安装http服务
© 手抄报圈