fix ansible-lint errors

This commit is contained in:
Sergey Malyuk
2025-12-17 11:37:16 +03:00
parent 7fd2c6d60a
commit 509e19bd5b
6 changed files with 15 additions and 14 deletions

View File

@@ -8,3 +8,5 @@ loop_var_prefix: "^(__|{role}_)"
exclude_paths: exclude_paths:
- .github/ - .github/
- .ansible/ - .ansible/
# ansible-lint thinks it's a playbook so gives an error, but its tasks are for include_task. decided to exclude it
- roles/rustdesk/molecule/default/client-binary-existance.yml

View File

@@ -14,4 +14,4 @@ warn_list:
exclude_paths: exclude_paths:
- .github/ - .github/
- molecule/default/client-binary-existance.yml # ansible-lint thinks it's a playbook so gives an error, but it's tasks for include_task. decided to exclude it - molecule/default/client-binary-existance.yml # ansible-lint thinks it's a playbook so gives an error, but its tasks for include_task. decided to exclude it

View File

@@ -1,6 +1,6 @@
--- ---
galaxy_info: galaxy_info:
role_name: "rustdesk_server" role_name: "rustdesk"
namespace: genlab namespace: genlab
author: "Sergey Malyuk" author: "Sergey Malyuk"
company: "Genlab, LLC" company: "Genlab, LLC"
@@ -10,8 +10,8 @@ galaxy_info:
platforms: platforms:
- name: "Ubuntu" - name: "Ubuntu"
versions: [ "focal", "jammy", "noble" ] versions: ["focal", "jammy", "noble"]
galaxy_tags: [ ] galaxy_tags: []
dependencies: [] dependencies: []

View File

@@ -1,6 +1,6 @@
--- ---
- name: "Get public IP" - name: "Get public IP"
register: public_ip register: rustdesk_public_ip
changed_when: false changed_when: false
ansible.builtin.uri: ansible.builtin.uri:
url: https://ifconfig.me url: https://ifconfig.me
@@ -9,17 +9,16 @@
Accept: text/plain Accept: text/plain
User-Agent: curl/7.68.0 User-Agent: curl/7.68.0
- name: "Get public key" - name: "Get public key"
register: public_key register: rustdesk_public_key
changed_when: false changed_when: false
ansible.builtin.command: "cat /opt/rustdesk-server/lib/id_ed25519.pub" ansible.builtin.command: "cat /opt/rustdesk-server/lib/id_ed25519.pub"
- name: "Get client rustdesk binary information" - name: "Get client rustdesk binary information"
changed_when: false changed_when: false
register: rustdesk_bin register: rustdesk_bin
ansible.builtin.stat: ansible.builtin.stat:
path: "/opt/rustdesk-server/lib/rustdesk-host={{ public_ip.content }},key={{ public_key.stdout }}.exe" path: "/opt/rustdesk-server/lib/rustdesk-host={{ rustdesk_public_ip.content }},key={{ rustdesk_public_key.stdout }}.exe"
- name: "Check if client binary exists" - name: "Check if client binary exists"
changed_when: false changed_when: false

View File

@@ -2,4 +2,4 @@
- name: Converge - name: Converge
hosts: all hosts: all
roles: roles:
- role: "genlab.rustdesk_server" - role: "genlab.common.rustdesk"

View File

@@ -1,25 +1,25 @@
--- ---
- name: "Check hbbr version" - name: "Check hbbr version"
register: hbbr_output register: rustdesk_hbbr_output
changed_when: false changed_when: false
ansible.builtin.command: ansible.builtin.command:
cmd: "/opt/rustdesk-server/amd64/hbbr --version" cmd: "/opt/rustdesk-server/amd64/hbbr --version"
- name: "Check if the version of hbbr is the expected one" - name: "Check if the version of hbbr is the expected one"
ansible.builtin.assert: ansible.builtin.assert:
that: "hbbr_output.stdout == 'hbbr {{ rustdesk_server_version }}'" that: "rustdesk_hbbr_output.stdout == 'hbbr {{ rustdesk_server_version }}'"
success_msg: "hbbr is installed and is the correct version" success_msg: "hbbr is installed and is the correct version"
fail_msg: "hbbr is either not installed or does not match the target version" fail_msg: "hbbr is either not installed or does not match the target version"
- name: "Check hbbs version" - name: "Check hbbs version"
register: hbbs_output register: rustdesk_hbbs_output
changed_when: false changed_when: false
ansible.builtin.command: ansible.builtin.command:
cmd: "/opt/rustdesk-server/amd64/hbbs --version" cmd: "/opt/rustdesk-server/amd64/hbbs --version"
- name: "Check if the version of hbbs is the expected one" - name: "Check if the version of hbbs is the expected one"
ansible.builtin.assert: ansible.builtin.assert:
that: "hbbs_output.stdout == 'hbbs {{ rustdesk_server_version }}'" that: "rustdesk_hbbs_output.stdout == 'hbbs {{ rustdesk_server_version }}'"
success_msg: "hbbs is installed and is the correct version" success_msg: "hbbs is installed and is the correct version"
fail_msg: "hbbs is either not installed or does not match the target version" fail_msg: "hbbs is either not installed or does not match the target version"