From d6c3d2f2c6a181f00ac9b4551efb2b35e5d2ab6f Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Tue, 16 May 2023 00:55:17 +0800 Subject: [PATCH] .github/workflows/setup-k3s-with-existed-vhost.yml: update --- .../setup-k3s-with-existed-vhost.yml | 4 ++-- playbook/roles/xtls-server/tasks/main.yml | 20 ++++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/setup-k3s-with-existed-vhost.yml b/.github/workflows/setup-k3s-with-existed-vhost.yml index ffb97555..5881a78e 100644 --- a/.github/workflows/setup-k3s-with-existed-vhost.yml +++ b/.github/workflows/setup-k3s-with-existed-vhost.yml @@ -49,8 +49,8 @@ jobs: common-gitlab.apollo-ev.com ansible_host=47.91.19.2 [all:vars] - ansible_port=8022 - ansible_ssh_user=ubuntu + ansible_port=22 + ansible_ssh_user=root ansible_ssh_private_key_file=~/.ssh/id_rsa ansible_host_key_checking=False dns_ak=$DNS_AK diff --git a/playbook/roles/xtls-server/tasks/main.yml b/playbook/roles/xtls-server/tasks/main.yml index db355833..dea103e8 100755 --- a/playbook/roles/xtls-server/tasks/main.yml +++ b/playbook/roles/xtls-server/tasks/main.yml @@ -1,23 +1,15 @@ -- name: Remove fluent-bit service - shell: "systemctl disable fluent-bit && systemctl stop fluent-bit" - when: inventory_hostname in groups[group] - - name: Pre setting shell: "rm -f /usr/bin/promtail; mkdir -pv /etc/promtail/ && touch /var/log/positions.yaml" when: inventory_hostname in groups[group] -- name: Download promtail binary - shell: 'curl -Lo /usr/bin/promtail https://mirrors.onwalk.net/tools/linux-amd64/promtail && chmod 755 /usr/bin/promtail' - when: inventory_hostname in groups[group] - -- name: Create promtail-agent service - template: src=templates/promtail-agent.service dest=/lib/systemd/system/promtail-agent.service owner=root group=root mode=0644 - when: inventory_hostname in groups[group] - - name: Create promtail-agent config template: src=templates/promtail.yaml dest=/etc/promtail/promtail.yaml owner=root group=root mode=0644 when: inventory_hostname in groups[group] -- name: Init promtail-agent service - shell: "systemctl enable promtail-agent && systemctl daemon-reload && systemctl restart promtail-agent" +- name: Init Xtls service + shell: 'bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @install' + when: inventory_hostname in groups[group] + +- name: Remove fluent-bit service + shell: "systemctl disable fluent-bit && systemctl stop fluent-bit" when: inventory_hostname in groups[group]