ansible-install-server/roles/fai/tasks/nginx.yml

48 lines
1.0 KiB
YAML

- name: install nginx
apt:
name: nginx-light
state: present
- name: configure http server
copy:
content: |
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html;
server_name _;
location /{{ http_mirror_ipxe_path_prefix }} {
autoindex on;
}
location /{{ http_mirror_fai_path_prefix }} {
autoindex on;
}
}
dest: /etc/nginx/sites-enabled/default
mode: 0644
owner: root
group: root
register: nginx_conf
- name: place info site
copy:
content: |
<html>
<head>
<title>Hardware for Future - PXE Environment</title>
</head>
<body>
<p>This mirror is part of the <a href="https://hardwareforfuture.de/">Hardware for Future</a> project</p>
<p>Restart the computer and boot into PXE to install Ubuntu.</p>
</body>
</html>
dest: /var/www/html/index.html
mode: 0644
owner: root
group: root