Skip to content

Commit 36fd084

Browse files
authored
Merge pull request #38 from aeneby/simplify_version_spec
Simplify ThinLinc version specification
2 parents bd8d4b8 + f960910 commit 36fd084

8 files changed

Lines changed: 112 additions & 74 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Updated to 4.17.0
1313
- Added configuration for Web Access & Web Administration ports
1414
- Added configuration for Web Access login page
15+
- Simplified/refactored package installation tasks
16+
17+
### Removed
18+
19+
- thinlinc_server_bundle and thinlinc_build parameters
20+
- vars/main.yaml configuration file (redundant)
1521

1622
## [1.10] - 2024-02-01
1723

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ requirement for installing and using ThinLinc.
3737
3838
```yaml
3939
thinlinc_version: "4.14.0"
40-
thinlinc_build: "2408"
41-
thinlinc_server_bundle: "tl-4.14.0-server.zip"
4240
```
4341
44-
ThinLinc version, build number and server bundle names.
42+
ThinLinc version number.
4543
4644
```yaml
4745
thinlinc_autoinstall_dependencies: "yes"

defaults/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
thinlinc_accept_eula: "no"
55

66
thinlinc_version: "4.17.0"
7-
thinlinc_build: "3647"
8-
thinlinc_server_bundle: "tl-4.17.0-server.zip"
97

108
thinlinc_autoinstall_dependencies: "yes"
119

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: 8 additions & 16 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
@@ -12,23 +18,9 @@
1218
block:
1319
- name: Unpacking ThinLinc server bundle
1420
unarchive:
15-
src: "{{ thinlinc_server_bundle }}"
21+
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)