Skip to content

Commit 122277c

Browse files
committed
Retire thinlinc_build variable
The ThinLinc build number can be useful to know for testing and debugging purposes, but is almost never useful to specify explicitly. This commit removes the need for this parameter by globbing to determine which package(s) to install, rather than refering to them by their full name (which includes the build number). This also means we can eliminate a whole configuration file worth of variables used for mapping architectures, versions and package formats to their respective filenames. As part of this, we also remove the pkgdir variable and infer the package locations from the version number instead. This commit also introduces an assertion to make sure we're not trying to install ThinLinc >4.14.0 on a 32-bit system, since support for this architecture has been removed.
1 parent fad51d0 commit 122277c

7 files changed

Lines changed: 105 additions & 71 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ requirement for installing and using ThinLinc.
3737
3838
```yaml
3939
thinlinc_version: "4.14.0"
40-
thinlinc_build: "2408"
4140
```
4241
43-
ThinLinc version and build number.
42+
ThinLinc version number.
4443
4544
```yaml
4645
thinlinc_autoinstall_dependencies: "yes"

defaults/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
thinlinc_accept_eula: "no"
55

66
thinlinc_version: "4.17.0"
7-
thinlinc_build: "3647"
87

98
thinlinc_autoinstall_dependencies: "yes"
109

tasks/install-thinlinc-debian.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
11
---
2+
- name: Locate 32-bit packages
3+
find:
4+
paths: "/root/tl-{{ thinlinc_version }}-server/packages"
5+
patterns:
6+
- "thinlinc*i386.deb"
7+
- "thinlinc*all.deb"
8+
when: ansible_architecture == 'i386'
9+
register: _packages_32bit
10+
11+
- name: Locate 64-bit packages
12+
find:
13+
paths: "/root/tl-{{ thinlinc_version }}-server/packages"
14+
patterns:
15+
- "thinlinc*amd64.deb"
16+
- "thinlinc*all.deb"
17+
when: ansible_architecture == 'x86_64'
18+
register: _packages_64bit
19+
220
# The apt provider actually calls dpkg for local packages, which isn't
321
# clever enough to handle our upgrades:
422
# https://github.com/ansible/ansible/issues/77150
23+
#
24+
- name: Install 32-bit ThinLinc Software
25+
command: >
26+
/usr/bin/apt-get install -y
27+
-o Dpkg::Options::="--no-debsig"
28+
-o Dpkg::Options::="--force-confold"
29+
{{ _packages_32bit.files | map(attribute='path') | join(' ') }}
30+
environment:
31+
DEBIAN_FRONTEND: noninteractive
32+
when: _packages_32bit is not skipped
33+
notify: run tl-setup
534

6-
- name: Install ThinLinc Software
7-
command: "/usr/bin/apt install -y -o \"Dpkg::Options::=--no-debsig\" -o \"Dpkg::Options::=--force-confold\" {{ ' '.join(thinlinc_packages) }}"
35+
- name: Install 64-bit ThinLinc Software
36+
command: >
37+
/usr/bin/apt-get install -y
38+
-o Dpkg::Options::="--no-debsig"
39+
-o Dpkg::Options::="--force-confold"
40+
{{ _packages_64bit.files | map(attribute='path') | join(' ') }}
41+
environment:
42+
DEBIAN_FRONTEND: noninteractive
43+
when: _packages_64bit is not skipped
844
notify: run tl-setup

tasks/install-thinlinc-rhel.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
11
---
2-
- name: Install ThinLinc Software
2+
- name: Locate 32-bit packages
3+
find:
4+
paths: "/root/tl-{{ thinlinc_version }}-server/packages"
5+
patterns:
6+
- "thinlinc*i686.rpm"
7+
- "thinlinc*noarch.rpm"
8+
when: ansible_architecture == 'i386'
9+
register: _packages_32bit
10+
11+
- name: Locate 64-bit packages
12+
find:
13+
paths: "/root/tl-{{ thinlinc_version }}-server/packages"
14+
patterns:
15+
- "thinlinc*x86_64.rpm"
16+
- "thinlinc*noarch.rpm"
17+
when: ansible_architecture == 'x86_64'
18+
register: _packages_64bit
19+
20+
- name: Install 32-bit ThinLinc Software
321
yum:
4-
name: "{{ thinlinc_packages }}"
22+
name: "{{ _packages_32bit.files | map(attribute='path') | list }}"
523
state: present
624
disable_gpg_check: true
25+
when: _packages_32bit is not skipped
26+
notify: run tl-setup
27+
28+
- name: Install 64-bit ThinLinc Software
29+
yum:
30+
name: "{{ _packages_64bit.files | map(attribute='path') | list }}"
31+
state: present
32+
disable_gpg_check: true
33+
when: _packages_64bit is not skipped
734
notify: run tl-setup

tasks/install-thinlinc-suse.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
---
2-
- name: Install ThinLinc Software
2+
---
3+
- name: Locate 32-bit packages
4+
find:
5+
paths: "/root/tl-{{ thinlinc_version }}-server/packages"
6+
patterns:
7+
- "thinlinc*i686.rpm"
8+
- "thinlinc*noarch.rpm"
9+
when: ansible_architecture == 'i386'
10+
register: _packages_32bit
11+
12+
- name: Locate 64-bit packages
13+
find:
14+
paths: "/root/tl-{{ thinlinc_version }}-server/packages"
15+
patterns:
16+
- "thinlinc*x86_64.rpm"
17+
- "thinlinc*noarch.rpm"
18+
when: ansible_architecture == 'x86_64'
19+
register: _packages_64bit
20+
21+
- name: Install 32-bit ThinLinc Software
22+
zypper:
23+
name: "{{ _packages_32bit.files | map(attribute='path') | list }}"
24+
state: present
25+
disable_gpg_check: true
26+
when: _packages_32bit is not skipped
27+
notify: run tl-setup
28+
29+
- name: Install 64-bit ThinLinc Software
330
zypper:
4-
name: "{{ thinlinc_packages }}"
31+
name: "{{ _packages_64bit.files | map(attribute='path') | list }}"
532
state: present
633
disable_gpg_check: true
34+
when: _packages_64bit is not skipped
735
notify: run tl-setup

tasks/main.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
---
2+
- name: Ensure architecture is supported by current version
3+
assert:
4+
that: thinlinc_version is version('4.14.0', '<=')
5+
msg: "32-bit architecture not supported by this version"
6+
when: ansible_architecture == 'i386'
7+
28
- name: Installing pre-requisites
39
package:
410
name: unzip
@@ -14,21 +20,7 @@
1420
unarchive:
1521
src: "tl-{{ thinlinc_version }}-server.zip"
1622
dest: /root
17-
creates: "{{ pkgdir }}"
18-
- name: Checking if rpm platform
19-
set_fact:
20-
_tl_pkg_fmt: rpm
21-
when: ansible_facts['os_family'] in ["RedHat", "Suse"]
22-
- name: Checking if deb platform
23-
set_fact:
24-
_tl_pkg_fmt: deb
25-
when: ansible_facts['os_family'] in ["Debian", "Ubuntu", "Linuxmint"]
26-
- name: Checking which packages to install
27-
set_fact:
28-
thinlinc_packages:
29-
"{{ _thinlinc_packages[ansible_architecture][_tl_pkg_fmt] if
30-
( thinlinc_version is version('4.14.0', '>') ) else
31-
_old_thinlinc_packages[ansible_architecture][_tl_pkg_fmt] }}"
23+
creates: "/root/tl-{{ thinlinc_version }}-server"
3224
- name: Run tasks for RHEL-like
3325
include_tasks: "install-thinlinc-rhel.yml"
3426
when: ansible_facts['os_family'] == "RedHat"

vars/main.yml

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

0 commit comments

Comments
 (0)