feat: puertos nombrados por servicio en lugar de lista genérica #100
15
abyayala.yml
15
abyayala.yml
@ -89,8 +89,7 @@ matrix:
|
||||
- pilmaiken.abyaya.la
|
||||
nodo: pilmaiken
|
||||
force_https: yes
|
||||
ports:
|
||||
- 222
|
||||
ssh_port: 222
|
||||
|
||||
- service_name: fundeps
|
||||
domains:
|
||||
@ -208,8 +207,7 @@ matrix:
|
||||
# - www.abyaya.la
|
||||
- kipu.latina.red
|
||||
nodo: kipu
|
||||
ports:
|
||||
- 223
|
||||
ssh_port: 223
|
||||
ssl: yes
|
||||
# root: yes
|
||||
|
||||
@ -239,8 +237,7 @@ matrix:
|
||||
|
||||
- service_name: deabajo
|
||||
ssl: yes
|
||||
ports:
|
||||
- 225
|
||||
ssh_port: 225
|
||||
|
||||
- ssl: yes
|
||||
nodo: pip
|
||||
@ -248,8 +245,7 @@ matrix:
|
||||
- nodo: revueltas
|
||||
# domains: www.ejem.plo
|
||||
force_https: yes
|
||||
ports:
|
||||
- 224
|
||||
ssh_port: 224
|
||||
|
||||
- service_name: huertaprueba
|
||||
domains:
|
||||
@ -268,5 +264,4 @@ matrix:
|
||||
- labo.abyaya.la
|
||||
nodo: labo
|
||||
force_https: yes
|
||||
ports:
|
||||
- 226
|
||||
ssh_port: 226
|
||||
|
||||
@ -72,11 +72,13 @@
|
||||
loop_var: vhost
|
||||
when: (service is undefined) or (service is defined and service == vhost.service_name)
|
||||
|
||||
- name: slice matrix with those having ports defined
|
||||
- name: recolectar puertos de servicio
|
||||
set_fact:
|
||||
matrix_ports: "{{ matrix_ports | default([]) | union(ma.ports) }}"
|
||||
matrix_ports: "{{ matrix_ports | default([])
|
||||
| union([ma.ssh_port] if ma.ssh_port is defined else [])
|
||||
| union([ma.gitea_port] if ma.gitea_port is defined else [])
|
||||
| union([ma.peertube_port] if ma.peertube_port is defined else []) }}"
|
||||
with_items: "{{ matrix }}"
|
||||
when: (ma.ports is defined)
|
||||
loop_control:
|
||||
loop_var: ma
|
||||
|
||||
|
||||
@ -15,8 +15,9 @@
|
||||
domains: "{{ [(_existing_abyayala_domains[0] if (_existing_abyayala_domains | length > 0) else _default_domain)] + _other_domains }}"
|
||||
ssl: "{{ domino.ssl | default(domains_default_ssl) }}"
|
||||
force_https: "{{ domino.force_https | default(domains_default_force_https) }}"
|
||||
ports: "{{ domino.ports | default([]) }}"
|
||||
ssh_port: "{{ domino.ssh_port | default(omit) }}"
|
||||
gitea_port: "{{ domino.gitea_port | default(omit) }}"
|
||||
peertube_port: "{{ domino.peertube_port | default(omit) }}"
|
||||
enable_compression: "{{ domino.enable_compression | default(domains_default_enable_compression) }}"
|
||||
roles: "{{ domino.roles | default([]) }}"
|
||||
service_name: "{{ domino.service_name | default(_node_name) }}"
|
||||
|
||||
@ -1,10 +1,23 @@
|
||||
- set_fact:
|
||||
vhost_dest: "{{ stream_path }}/{{ vhost.service_name }}.conf"
|
||||
|
||||
- name: default stream for ssh
|
||||
- name: stream ssh
|
||||
template:
|
||||
src: "{{ default_stream }}"
|
||||
dest: "{{ vhost_dest }}"
|
||||
when: vhost.ports is defined and (vhost.ports | length > 0)
|
||||
src: stream_ssh.conf
|
||||
dest: "{{ stream_path }}/{{ vhost.service_name }}_ssh.conf"
|
||||
when: vhost.ssh_port is defined
|
||||
notify:
|
||||
- reload proxy
|
||||
|
||||
- name: stream gitea
|
||||
template:
|
||||
src: stream_gitea.conf
|
||||
dest: "{{ stream_path }}/{{ vhost.service_name }}_gitea.conf"
|
||||
when: vhost.gitea_port is defined
|
||||
notify:
|
||||
- reload proxy
|
||||
|
||||
- name: stream peertube
|
||||
template:
|
||||
src: stream_peertube.conf
|
||||
dest: "{{ stream_path }}/{{ vhost.service_name }}_peertube.conf"
|
||||
when: vhost.peertube_port is defined
|
||||
notify:
|
||||
- reload proxy
|
||||
|
||||
9
roles/proxy/templates/stream_gitea.conf
Normal file
9
roles/proxy/templates/stream_gitea.conf
Normal file
@ -0,0 +1,9 @@
|
||||
upstream gitea_{{ vhost.rap_dn | replace(".", "") }} {
|
||||
server {{ vhost.rap_dn }}:222;
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ vhost.gitea_port }};
|
||||
|
||||
proxy_pass gitea_{{ vhost.rap_dn | replace(".", "") }};
|
||||
}
|
||||
9
roles/proxy/templates/stream_peertube.conf
Normal file
9
roles/proxy/templates/stream_peertube.conf
Normal file
@ -0,0 +1,9 @@
|
||||
upstream peertube_rtmp_{{ vhost.rap_dn | replace(".", "") }} {
|
||||
server {{ vhost.rap_dn }}:1935;
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ vhost.peertube_port }};
|
||||
|
||||
proxy_pass peertube_rtmp_{{ vhost.rap_dn | replace(".", "") }};
|
||||
}
|
||||
@ -3,9 +3,7 @@ upstream ssh_{{ vhost.rap_dn | replace(".", "") }} {
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ vhost.ports[0] }};
|
||||
|
||||
server_name {{ vhost.service_name }}.{{ main_zone }};
|
||||
listen {{ vhost.ssh_port }};
|
||||
|
||||
proxy_pass ssh_{{ vhost.rap_dn | replace(".", "") }};
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,6 @@ nginx_certs_path: /etc/nginx/certs
|
||||
# defaults
|
||||
needs_vhost: no
|
||||
default_vhost: roles/proxy/templates/vhost.conf
|
||||
default_stream: roles/proxy/templates/stream.conf
|
||||
|
||||
# certbot
|
||||
webmaster_email: webmaster@numerica.cl
|
||||
|
||||
@ -17,6 +17,5 @@ matrix:
|
||||
- qi
|
||||
|
||||
- nodo: qi
|
||||
ports:
|
||||
- 531
|
||||
ssh_port: 531
|
||||
# force_https: yes
|
||||
Reference in New Issue
Block a user