From 71916ca31490cc3b71bc30789575cea3aa99be9b Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Tue, 16 May 2023 18:00:03 +0800 Subject: [PATCH] .github/workflows/setup-k3s-with-existed-vhost.yml: add setup-Agent --- .../setup-k3s-with-existed-vhost.yml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/setup-k3s-with-existed-vhost.yml b/.github/workflows/setup-k3s-with-existed-vhost.yml index 514469b3..8715a89a 100644 --- a/.github/workflows/setup-k3s-with-existed-vhost.yml +++ b/.github/workflows/setup-k3s-with-existed-vhost.yml @@ -187,3 +187,46 @@ jobs: EOF ansible-playbook -i hosts/inventory jobs/init_k3s_cluster -D ansible-playbook -i hosts/inventory jobs/init_observability-server -D -C + setup-Agent: + runs-on: ubuntu-latest + needs: + - setup-harbor + - setup-gitlab + - setup-grafana + - setup-keycloak + + steps: + - uses: actions/checkout@v3 + + - name: Setup Habor in K3S + shell: bash + run: | + export ANSIBLE_HOST_KEY_CHECKING=False + sudo apt install jq ansible -y + + mkdir -pv ~/.ssh/ + cat > ~/.ssh/id_rsa << EOF + ${SSH_PRIVATE_KEY} + EOF + sudo chmod 0400 ~/.ssh/id_rsa + md5sum ~/.ssh/id_rsa + + mkdir -pv hosts/ + cat > hosts/inventory << EOF + [master] + gitlab.onwalk.net ansible_host=20.48.21.165 + + [all:vars] + ansible_port=8022 + ansible_ssh_user=ubuntu + ansible_ssh_private_key_file=~/.ssh/id_rsa + ansible_host_key_checking=False + ali_ak=$ALI_AK + ali_sk=$ALI_SK + dns_ak=$DNS_AK + dns_sk=$DNS_SK + ingress_ip=20.48.21.165 + harbor_admin_password=$HARBOR_ADMIN_PASSWORD + harbor_odic_client_token=$HARBOR_OIDC_CLIENT_TOKEN + EOF + ansible-playbook -i hosts/inventory jobs/init_metric_agent -D -C