Updates for nuster.
This commit is contained in:
+8
-6
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
vars:
|
vars:
|
||||||
install_docker: false
|
install_docker: false
|
||||||
|
# TODO remove this if unused.
|
||||||
# This object represents the uid/gid for the haproxy user/group in the
|
# This object represents the uid/gid for the haproxy user/group in the
|
||||||
# haproxy container.
|
# haproxy container.
|
||||||
haproxy_user:
|
haproxy_user:
|
||||||
@@ -14,7 +15,7 @@
|
|||||||
gid: &haproxy_gid 99
|
gid: &haproxy_gid 99
|
||||||
persistent_data_directory: /media1/srv/pkg-cache
|
persistent_data_directory: /media1/srv/pkg-cache
|
||||||
host_cert_file: "{{ persistent_data_directory }}/{{ cert_name }}"
|
host_cert_file: "{{ persistent_data_directory }}/{{ cert_name }}"
|
||||||
host_config_file: "{{ persistent_data_directory }}/haproxy.cfg"
|
host_config_file: "{{ persistent_data_directory }}/nuster.cfg"
|
||||||
permissions: &persistent_data_permissions
|
permissions: &persistent_data_permissions
|
||||||
# owner: gert
|
# owner: gert
|
||||||
# group: gert
|
# group: gert
|
||||||
@@ -40,9 +41,9 @@
|
|||||||
mode: '0750'
|
mode: '0750'
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Create haproxy config file.
|
- name: Create nuster config file.
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: templates/haproxy.cfg.j2
|
src: templates/nuster.cfg.j2
|
||||||
dest: "{{ host_config_file }}"
|
dest: "{{ host_config_file }}"
|
||||||
<<: *persistent_data_permissions
|
<<: *persistent_data_permissions
|
||||||
become: true
|
become: true
|
||||||
@@ -55,9 +56,9 @@
|
|||||||
mode: '0600'
|
mode: '0600'
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Start the haproxy container.
|
- name: Start the nuster container.
|
||||||
community.docker.docker_container:
|
community.docker.docker_container:
|
||||||
image: haproxy
|
image: nuster/nuster:5.3.0.23-alpine
|
||||||
name: pkg-cache
|
name: pkg-cache
|
||||||
state: started
|
state: started
|
||||||
restart: true
|
restart: true
|
||||||
@@ -66,8 +67,9 @@
|
|||||||
# published_ports:
|
# published_ports:
|
||||||
# - 4433:4433
|
# - 4433:4433
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ host_config_file }}:/usr/local/etc/haproxy/haproxy.cfg"
|
- "{{ host_config_file }}:/etc/nuster/nuster.cfg"
|
||||||
- "{{ host_cert_file }}:{{ container_cert_file }}"
|
- "{{ host_cert_file }}:{{ container_cert_file }}"
|
||||||
|
- "{{ persistent_data_directory }}/cache:/cache"
|
||||||
env:
|
env:
|
||||||
VIRTUAL_HOST: pkg.shnee.net
|
VIRTUAL_HOST: pkg.shnee.net
|
||||||
VIRTAUL_PORT: "8080"
|
VIRTAUL_PORT: "8080"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ global
|
|||||||
log stdout format raw local0
|
log stdout format raw local0
|
||||||
# uid {{ haproxy_user.uid }}
|
# uid {{ haproxy_user.uid }}
|
||||||
# gid {{ haproxy_user.gid }}
|
# gid {{ haproxy_user.gid }}
|
||||||
|
nuster cache on dir /cache
|
||||||
|
|
||||||
defaults
|
defaults
|
||||||
log global
|
log global
|
||||||
@@ -12,18 +13,14 @@ defaults
|
|||||||
timeout server 10s
|
timeout server 10s
|
||||||
timeout http-request 10s
|
timeout http-request 10s
|
||||||
|
|
||||||
cache pkg_cache
|
|
||||||
total-max-size 4095
|
|
||||||
max-object-size 524288000
|
|
||||||
|
|
||||||
frontend http_frontend
|
frontend http_frontend
|
||||||
# bind *:4433 ssl crt {{ container_cert_file }}
|
# bind *:4433 ssl crt {{ container_cert_file }}
|
||||||
bind *:8080
|
bind *:8080
|
||||||
default_backend pkg_repo
|
default_backend pkg_repo
|
||||||
|
|
||||||
backend pkg_repo
|
backend pkg_repo
|
||||||
http-request cache-use pkg_cache
|
nuster cache on
|
||||||
http-response cache-store pkg_cache
|
nuster rule r1 disk on memory off
|
||||||
option forwardfor
|
option forwardfor
|
||||||
server server1 mirrors.gigenet.com:443 ssl
|
server server1 mirrors.gigenet.com:443 ssl
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user