From 36ecc8447af18b6ab800b0fcc3ecc5535c6579c2 Mon Sep 17 00:00:00 2001 From: Wendell Jones Date: Fri, 23 May 2025 07:59:02 -0400 Subject: [PATCH] Modify beszel install --- beszel_install.yaml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/beszel_install.yaml b/beszel_install.yaml index 5d77a50..eb8a249 100644 --- a/beszel_install.yaml +++ b/beszel_install.yaml @@ -1,16 +1,27 @@ --- - hosts: debianhosts tasks: - - name: Install linux beszel agent - command: chdir=/tmp + - name: change working directo + become: yes + become_method: sudo + command: ‘pwd’ + args: + chdir: /tmp + register: exec_result + - debug: var=exec_result.stdout_lines + - name: Get beszel agent install script - ansible.builtin.command:: curl -sL https://get.beszel.dev -o /tmp/install-agent.sh - - name: Setup beszel agent install script - ansible.builtin.command:: chmod +x /tmp/install-agent.sh - - name: Execute beszel agent install script - ansible.builtin.command:: /tmp/install-agent.sh -p 45876 -k "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" - - name: Add beszel agent key - ansible.builtin.command:: echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" >> /root/.ssh/authorized_keys + ansible.builtin.uri: + url: https://httpbin.org/post + method: POST + src: /tmp/install-agent.sh + + # - name: Setup beszel agent install script + # ansible.builtin.command:: chmod +x /tmp/install-agent.sh + # - name: Execute beszel agent install script + # ansible.builtin.command:: /tmp/install-agent.sh -p 45876 -k "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" + # - name: Add beszel agent key + # ansible.builtin.command:: echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" >> /root/.ssh/authorized_keys - hosts: windowshosts tasks: