authentik #3
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
- name: Create site dir
|
||||
file:
|
||||
path: "statis_nginx_site"
|
||||
path: "/home/{{ ansible_user }}/web/static_nginx_site"
|
||||
state: directory
|
||||
register: site_dir
|
||||
|
||||
|
|
@ -17,6 +17,19 @@
|
|||
src: templates/index.html.j2
|
||||
dest: "{{site_dir.path}}/index.html"
|
||||
|
||||
|
||||
- name: Create nginx conf dir
|
||||
file:
|
||||
path: "/home/{{ ansible_user }}/nginx/conf"
|
||||
state: directory
|
||||
register: nginx_conf_dir
|
||||
|
||||
- name: Copy nginx config
|
||||
template:
|
||||
src: templates/nginx.conf.j2
|
||||
dest: "{{ nginx_conf_dir.path }}/nginx.conf"
|
||||
|
||||
|
||||
- name: Create container
|
||||
docker_container:
|
||||
name: nginx-static
|
||||
|
|
@ -25,5 +38,6 @@
|
|||
- "80:80"
|
||||
volumes:
|
||||
- "{{ site_dir.path }}:/usr/share/nginx/html"
|
||||
- "{{ nginx_conf_dir.path }}:/etc/nginx/conf.d"
|
||||
restart_policy : "unless-stopped"
|
||||
init : true
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
root /var/www/html;
|
||||
index index.html;
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue