diff --git a/infra/ansible/playbooks/caddy.yaml b/infra/ansible/playbooks/caddy.yaml deleted file mode 100644 index d47bc99d3..000000000 --- a/infra/ansible/playbooks/caddy.yaml +++ /dev/null @@ -1,92 +0,0 @@ -- name: Run Go playbook - ansible.builtin.import_playbook: go.yaml - vars: - host: "{{ host }}" - -- name: Caddy Setup - hosts: "{{ host }}" - - tasks: - - name: Allow http/https traffic on UFW - become: true - ufw: - rule: allow - state: enabled - port: '{{ item }}' - loop: - - http - - https - vars: - ansible_ssh_user: "{{ admin_user }}" - - - name: Install dependencies for Caddy - become: true - apt: - name: - - debian-keyring - - debian-archive-keyring - - apt-transport-https - - curl - state: present - update_cache: yes - vars: - ansible_ssh_user: "{{ admin_user }}" - - - name: Download and install Caddy GPG key - shell: - cmd: curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg - creates: /usr/share/keyrings/caddy-stable-archive-keyring.gpg - vars: - ansible_ssh_user: "{{ admin_user }}" - - - name: Add Caddy repository - shell: - cmd: curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list - creates: /etc/apt/sources.list.d/caddy-stable.list - vars: - ansible_ssh_user: "{{ admin_user }}" - - - name: Download and install XCaddy GPG key - shell: - cmd: curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-xcaddy-archive-keyring.gpg - creates: /usr/share/keyrings/caddy-xcaddy-archive-keyring.gpg - vars: - ansible_ssh_user: "{{ admin_user }}" - - - name: Add XCaddy repository - shell: - cmd: curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-xcaddy.list - creates: /etc/apt/sources.list.d/caddy-xcaddy.list - vars: - ansible_ssh_user: "{{ admin_user }}" - - - name: Install Caddy and XCaddy - become: true - apt: - update_cache: yes - name: - - caddy - - xcaddy - state: present - vars: - ansible_ssh_user: "{{ admin_user }}" - - - name: Build Cloudflare DNS module for caddy - shell: - cmd: | - xcaddy build --with github.com/caddy-dns/cloudflare - sudo mv /home/{{ ansible_ssh_user }}/caddy /usr/bin/caddy - chdir: /home/{{ ansible_ssh_user }}/ - vars: - ansible_ssh_user: "{{ admin_user }}" - environment: - PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin" - - - name: Enable caddy - become: true - systemd_service: - name: caddy - enabled: true - state: started - vars: - ansible_ssh_user: "{{ admin_user }}" diff --git a/infra/ansible/playbooks/explorer.yaml b/infra/ansible/playbooks/explorer.yaml index 6bd3cd363..c7f230115 100644 --- a/infra/ansible/playbooks/explorer.yaml +++ b/infra/ansible/playbooks/explorer.yaml @@ -18,11 +18,6 @@ vars: host: explorer -- name: Run caddy playbook - ansible.builtin.import_playbook: caddy.yaml - vars: - host: explorer - - hosts: explorer vars: service: "explorer" @@ -43,25 +38,6 @@ update: yes tasks: - - name: Add reverse proxy configuration to Caddyfile - become: true - blockinfile: - path: /etc/caddy/Caddyfile - block: | - {{ caddy_explorer_url }} { - tls { - dns cloudflare {{ caddy_cloudflare_token }} - } - reverse_proxy localhost:{{ caddy_explorer_port }} - } - create: yes - prepend_newline: true - vars: - ansible_ssh_user: "{{ admin_user }}" - caddy_explorer_url: "{{ lookup('ini', 'caddy_explorer_url', file=ini_file) }}" - caddy_explorer_port: 4000 - caddy_cloudflare_token: "{{ lookup('ini', 'caddy_cloudflare_token', file=ini_file) }}" - - name: Build the explorer release args: chdir: "{{ clone_repo.git_dir_now }}"