---
- name: Enable internet services
hosts: webserver
become: yes
tasks:
- name: lastst version of httpd and firewalld #检测httpd和firewalld是否安装最新版本
yum:
name:
- httpd
- firewalld
state: latest
- name: test html page is configured #检测是否配置默认发布页面
copy:
content: "Welcome to westos!\n"
dest: /var/www/html/index.html
- name: firewalld enabled and running #检测火墙是否开启且处于enabled状态
service:
name: firewalld
enabled: true
state: started
- name: firewalld permit access to httpd #检测火墙是否允许httpd服务访问
firewalld:
service: http
permanent:
ansible playbook安装、配置默认发布页并启动apache
最新推荐文章于 2024-09-18 17:16:23 发布
本文介绍了如何通过Ansible Playbook自动化安装和配置Apache web服务器,包括设置默认发布页面并启动Apache服务,实现远程服务器管理的高效与便捷。
摘要由CSDN通过智能技术生成