如何使用Ansible将NginX默认页面更改为空白?
我需要将默认的Welcome to nginx!
页面更改为空白。
在下面的例子中,模块file
被用来简单地删除现有的index.html并创建一个空的index.html。
- hosts: webserver
tasks:
- name: Delete file
file:
path: /var/www/html/index.html
state: absent
- name: Create empty index.html file
file:
path: /var/www/html/index.html
state: touch