Skip to content

Commit 7e528d5

Browse files
committed
Use generic check if ThinLinc is installed
Simplify this check by using package_facts, which avoid having to have distro specific tasks.
1 parent ef64fdb commit 7e528d5

3 files changed

Lines changed: 8 additions & 26 deletions

File tree

tasks/check_installed_deb.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

tasks/check_installed_rpm.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

tasks/main.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
name: unzip
66
state: present
77

8+
- name: Checking which packages are installed
9+
package_facts:
10+
811
- name: Checking for installed ThinLinc packages
9-
block:
10-
- include_tasks: "check_installed_rpm.yml"
11-
when: ansible_os_family in ["RedHat", "Suse"]
12-
- include_tasks: "check_installed_deb.yml"
13-
when: ansible_os_family in ["Debian", "Ubuntu", "Linuxmint"]
12+
set_fact:
13+
thinlinc_packages_installed: true
14+
when: "('thinlinc-vsm' in ansible_facts.packages) and
15+
(ansible_facts.packages['thinlinc-vsm'][0]['version'] == (thinlinc_version + '-' + thinlinc_build))"
1416

1517
- name: Installing ThinLinc packages
1618
block:
@@ -35,7 +37,7 @@
3537
when: ansible_os_family == "Suse"
3638
- include_tasks: "install-thinlinc-debian.yml"
3739
when: ansible_os_family in ["Debian", "Ubuntu", "Linuxmint"]
38-
when: thinlinc_packages_installed.rc == 1
40+
when: thinlinc_packages_installed is undefined
3941

4042
# Workaround for OpenSUSE Tumbleweed usr merge
4143
# See https://www.cendio.com/bugzilla/show_bug.cgi?id=7829

0 commit comments

Comments
 (0)