加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
auto_deploy_httpd.yml 811 Bytes
一键复制 编辑 原始数据 按行查看 历史
青苹果和北风 提交于 2024-06-23 09:48 . first commit
---
- name: Deploy web app to multiple environments
hosts: all
become: yes
tasks:
- name: Install web server # (安装软件)
yum:
name: httpd
state: present
- name: Copy app code # (提前准备好网页文件,拷贝网页文件)
copy:
src: /#存放网页的目录
dest: /var/www/html
owner: apache
group: apache
mode: 0755
- name: Configure app # (提前准备好配置文件模板httpd_config.j2)
template:
src: httpd_config.j2
dest: /etc/httpd/conf.d/virt.conf
mode: 0644
notify: restart app
- name: Ensure app is running # (启动服务,设置开机自启)
service:
name: httpd
state: started
enabled: yes
handlers:
- name: restart app # (更新配置文件后触发执行重启httpd)
service:
name: httpd
state: restarted
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化