mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-05 21:11:52 +07:00
Add cloudflared tunnel config files and service
This commit is contained in:
parent
27c048931f
commit
9e7f7909fd
@ -1,3 +1,25 @@
|
||||
- name: Install cloudflared
|
||||
apt:
|
||||
deb: "{{ cloudflared_package_url }}"
|
||||
|
||||
- name: Create tunnel configuration file
|
||||
template:
|
||||
src: config.yml.j2
|
||||
dest: /etc/cloudflared/config.yml
|
||||
|
||||
# TODO (feature) Get cloudflare tunnel credentials automatically
|
||||
# - name: Create tunnel credentials file
|
||||
# template:
|
||||
# src: credentials.json.j2
|
||||
# dest: /etc/cloudflared/credentials.json
|
||||
|
||||
- name: Install cloudfared system service
|
||||
command: cloudflared service install
|
||||
args:
|
||||
creates: /etc/systemd/system/cloudflared.service
|
||||
|
||||
- name: Enable cloudflared service
|
||||
service:
|
||||
name: cloudflared
|
||||
state: started
|
||||
enabled: yes
|
||||
|
@ -0,0 +1,7 @@
|
||||
tunnel: homelab-vpn
|
||||
credentials-file: /etc/cloudflared/cert.pem
|
||||
|
||||
ingress:
|
||||
- hostname: "*.khuedoan.com"
|
||||
service: http://192.168.1.150 # TODO (optimize) Use variable for ingress address
|
||||
- service: http_status:404
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"TunnelName": "{{ tunnel_name }}",
|
||||
"AccountTag": "{{ account_id }}",
|
||||
"TunnelID": "{{ tunnel_id }}",
|
||||
"TunnelSecret": "{{ tunnel_secret }}"
|
||||
}
|
Loading…
Reference in New Issue
Block a user