Fix cockpit instance

This commit is contained in:
Francesco Antognazza 2023-02-15 14:01:28 +01:00
parent 71a8507928
commit e5a2075849
3 changed files with 21 additions and 3 deletions

View File

@ -5,6 +5,7 @@ http:
entryPoints: https entryPoints: https
middlewares: middlewares:
- force-trailing-slash - force-trailing-slash
- drop-xforwarded-proto
service: cockpit service: cockpit
tls: tls:
certresolver: wildcard certresolver: wildcard
@ -14,9 +15,18 @@ http:
stripPrefix: stripPrefix:
prefixes: prefixes:
- "/cockpit" - "/cockpit"
drop-xforwarded-proto:
headers:
customrequestheaders:
X-Forwarded-Proto: ""
services: services:
cockpit: cockpit:
loadBalancer: loadBalancer:
serversTransport: nocertverify
servers: servers:
- url: "http://127.0.0.1:9090" - url: "https://{{ vault_domain }}:9090"
serversTransports:
nocertverify:
insecureSkipVerify: true

View File

@ -30,6 +30,15 @@
group: root group: root
mode: 0644 mode: 0644
- name: Permit traffic from any IP to cockpit socket
become: true
community.general.ufw:
direction: in
from_ip: any
proto: tcp
to_port: 9090
rule: allow
# - name: Reboot # - name: Reboot
# become: true # become: true
# ansible.builtin.reboot: # ansible.builtin.reboot:

View File

@ -1,4 +1,3 @@
[WebService] [WebService]
Origins = http://{{ inventory_hostname }} ws://{{ inventory_hostname }} https://{{ inventory_hostname }} wss://{{ inventory_hostname }} http://{{ ansible_host }} ws://{{ ansible_host }} https://{{ ansible_host }} wss://{{ ansible_host }} Origins = http://{{ inventory_hostname }} ws://{{ inventory_hostname }} https://{{ inventory_hostname }} wss://{{ inventory_hostname }} http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9090 ws://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9090 https://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9090 wss://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9090
ProtocolHeader = X-Forwarded-Proto ProtocolHeader = X-Forwarded-Proto
AllowUnencrypted=true