diff --git a/ansible/roles/netbird_peer/tasks/main.yaml b/ansible/roles/netbird_peer/tasks/main.yaml new file mode 100644 index 0000000..944d04a --- /dev/null +++ b/ansible/roles/netbird_peer/tasks/main.yaml @@ -0,0 +1,34 @@ +- name: Download and verify the netbird archive + get_url: + url: "https://github.com/netbirdio/netbird/releases/download/v{{ netbird_version }}/netbird_{{ netbird_version }}_linux_{{ ansible_facts['architecture'] }}.tar.gz" + dest: "/tmp/netbird-{{ netbird_version }}.linux-amd64.tar.gz" + checksum: "sha256:{{ netbird_sha256 }}" + register: download_result + +- name: Unarchive netbird binary + unarchive: + src: "{{ download_result.dest }}" + dest: "/tmp/netbird_{{ netbird_version }}" + remote_src: true # Indicates the source file is on the remote host + owner: root + group: root + mode: 0755 + +- name: Copy netbird binary to /usr/local/bin + copy: + src: "/tmp/netbird_{{ netbird_version }}/netbird" + dest: "/usr/local/bin/netbird-{{ netbird_version }}" + owner: root + group: root + mode: '0755' + remote_src: yes + +- name: Create netbird binary symlink + file: + src: "/usr/local/bin/netbird-{{ netbird_version }}" + dest: "/usr/local/bin/netbird" + state: link + owner: root + group: root + mode: '0755' # Permissions for the target file + force: yes