30 lines
824 B
YAML
30 lines
824 B
YAML
---
|
|
- name: "Get public IP"
|
|
register: public_ip
|
|
changed_when: false
|
|
ansible.builtin.uri:
|
|
url: https://ifconfig.me
|
|
return_content: true
|
|
headers:
|
|
Accept: text/plain
|
|
User-Agent: curl/7.68.0
|
|
|
|
|
|
- name: "Get public key"
|
|
register: public_key
|
|
changed_when: false
|
|
ansible.builtin.command: "cat /opt/rustdesk-server/lib/id_ed25519.pub"
|
|
|
|
- name: "Get client rustdesk binary information"
|
|
changed_when: false
|
|
register: rustdesk_bin
|
|
ansible.builtin.stat:
|
|
path: "/opt/rustdesk-server/lib/rustdesk-host={{ public_ip.content }},key={{ public_key.stdout }}.exe"
|
|
|
|
- name: "Check if client binary exists"
|
|
changed_when: false
|
|
ansible.builtin.assert:
|
|
that: "rustdesk_bin.stat.exists"
|
|
success_msg: "Rustdesk binary exists and named correctly"
|
|
fail_msg: "Rustdesk binary not found"
|