lnbits, memos, mempool: use the caddy_site role
lnbits is the header_up shape; memos and mempool are the Tailscale MagicDNS
shape. 108 lines removed, 25 added.
mempool was the one playbook already reloading Caddy correctly
(systemd: state: reloaded rather than command: systemctl reload caddy), so
its end marker differed - the role's handler does the same thing.
Verified:
- lnbits: full --check, site task ok, byte-identical to the live file
- memos, mempool: --check --diff via --limit edge shows exactly one added
line each, the standardised MagicDNS comment. Both playbooks fail earlier
in check mode on their VM play ("Extract memos binary", the same
download-does-not-happen-in-check-mode artifact as forgejo), but the edits
are confined to the hosts: edge play - memos at line 169+, play 2 starts
at 159; mempool at 617+, play 2 starts at 606.
The added comment means the next real run of memos/mempool rewrites one
comment line. Those two host files were already stale against their
playbooks before this change.
All 14 site files on all 3 hosts still byte-identical.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4bee182978
commit
82fca48b08
3 changed files with 25 additions and 108 deletions
|
|
@ -614,47 +614,16 @@
|
|||
vars:
|
||||
mempool_subdomain: "{{ subdomains.mempool }}"
|
||||
mempool_domain: "{{ mempool_subdomain }}.{{ root_domain }}"
|
||||
caddy_sites_dir: "{{ caddy_sites_dir }}"
|
||||
|
||||
tasks:
|
||||
- name: Ensure Caddy sites-enabled directory exists
|
||||
file:
|
||||
path: "{{ caddy_sites_dir }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Ensure Caddyfile includes import directive for sites-enabled
|
||||
lineinfile:
|
||||
path: /etc/caddy/Caddyfile
|
||||
line: 'import sites-enabled/*'
|
||||
insertafter: EOF
|
||||
state: present
|
||||
backup: yes
|
||||
create: yes
|
||||
mode: '0644'
|
||||
|
||||
- name: Create Caddy reverse proxy configuration for Mempool
|
||||
copy:
|
||||
dest: "{{ caddy_sites_dir }}/mempool.conf"
|
||||
content: |
|
||||
{{ mempool_domain }} {
|
||||
reverse_proxy mempool-box:{{ mempool_frontend_port }} {
|
||||
# Use Tailscale MagicDNS to resolve the upstream hostname
|
||||
transport http {
|
||||
resolvers 100.100.100.100
|
||||
}
|
||||
}
|
||||
}
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Reload Caddy to apply new config
|
||||
systemd:
|
||||
name: caddy
|
||||
state: reloaded
|
||||
- name: Publish Mempool through Caddy (via Tailscale)
|
||||
ansible.builtin.include_role:
|
||||
name: caddy_site
|
||||
vars:
|
||||
caddy_site_name: mempool
|
||||
caddy_site_domain: "{{ mempool_domain }}"
|
||||
caddy_site_upstream: "mempool-box:{{ mempool_frontend_port }}"
|
||||
caddy_site_resolvers: "100.100.100.100"
|
||||
|
||||
- name: Display Mempool URL
|
||||
when: uptime_kuma_enabled | default(false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue