|
1 | 1 | --- |
2 | | - |
3 | 2 | - name: Installing pre-requisites |
4 | 3 | package: |
5 | 4 | name: unzip |
6 | 5 | state: present |
| 6 | + update_cache: true |
7 | 7 |
|
8 | | -- 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"] |
| 8 | +- name: Collect installed packages |
| 9 | + package_facts: |
14 | 10 |
|
15 | 11 | - name: Installing ThinLinc packages |
16 | 12 | block: |
17 | 13 | - name: Unpacking ThinLinc server bundle |
18 | 14 | unarchive: |
19 | 15 | src: "{{ thinlinc_server_bundle }}" |
20 | 16 | dest: /root |
21 | | - - include_vars: "packages-rpm-{{ ansible_architecture }}.yml" |
22 | | - when: ansible_os_family in ["RedHat", "Suse"] |
23 | | - - include_vars: "packages-deb-{{ ansible_architecture }}.yml" |
24 | | - when: ansible_os_family in ["Debian", "Ubuntu", "Linuxmint"] |
25 | | - - include_tasks: "install-thinlinc-rhel.yml" |
26 | | - when: ansible_os_family == "RedHat" |
27 | | - - include_tasks: "install-thinlinc-suse.yml" |
28 | | - when: ansible_os_family == "Suse" |
29 | | - - include_tasks: "install-thinlinc-debian.yml" |
30 | | - when: ansible_os_family in ["Debian", "Ubuntu", "Linuxmint"] |
31 | | - when: thinlinc_packages_installed.rc == 1 |
| 17 | + creates: "{{ pkgdir }}" |
| 18 | + - name: Load vars for {{ ansible_facts['architecture'] }} RPMs |
| 19 | + include_vars: "packages-rpm-{{ ansible_facts['architecture'] }}.yml" |
| 20 | + when: ansible_facts['os_family'] in ["RedHat", "Suse"] |
| 21 | + - name: Load vars for {{ ansible_facts['architecture'] }} DEBs |
| 22 | + include_vars: "packages-deb-{{ ansible_facts['architecture'] }}.yml" |
| 23 | + when: ansible_facts['os_family'] in ["Debian", "Ubuntu", "Linuxmint"] |
| 24 | + - name: Run tasks for RHEL-like |
| 25 | + include_tasks: "install-thinlinc-rhel.yml" |
| 26 | + when: ansible_facts['os_family'] == "RedHat" |
| 27 | + - name: Run tasks for SUSE-like |
| 28 | + include_tasks: "install-thinlinc-suse.yml" |
| 29 | + when: ansible_facts['os_family'] == "Suse" |
| 30 | + - name: Run tasks for Debian-like |
| 31 | + include_tasks: "install-thinlinc-debian.yml" |
| 32 | + when: ansible_facts['os_family'] in ["Debian", "Ubuntu", "Linuxmint"] |
| 33 | + when: > |
| 34 | + ansible_facts['packages']['thinlinc-vsm'][0]['version'] is not defined or |
| 35 | + ansible_facts['packages']['thinlinc-vsm'][0]['version'] != thinlinc_version |
32 | 36 |
|
33 | 37 | # Workaround for OpenSUSE Tumbleweed usr merge |
34 | 38 | # See https://www.cendio.com/bugzilla/show_bug.cgi?id=7829 |
35 | 39 | - name: Copy /usr/etc/pam.d/sshd |
36 | 40 | include_tasks: "copy_usr_etc_pam_sshd.yml" |
| 41 | + when: ansible_facts['os_family'] == "Suse" |
37 | 42 |
|
38 | 43 | - name: Copy in tlsetup.answers |
39 | 44 | template: |
40 | 45 | src: thinlinc-setup.answers.j2 |
41 | 46 | dest: /root/thinlinc-setup.answers |
| 47 | + owner: root |
| 48 | + group: root |
| 49 | + mode: '0644' |
42 | 50 | notify: run tl-setup |
43 | 51 |
|
44 | | -# Force tl-setup to run here, if required |
45 | | -- meta: flush_handlers |
| 52 | +- name: Force tl-setup to run if required |
| 53 | + meta: flush_handlers |
46 | 54 |
|
47 | 55 | - name: Configure /vsmagent/agent_hostname |
48 | 56 | tlconfig: |
49 | 57 | param: /vsmagent/agent_hostname |
50 | | - value: "{{ thinlinc_agent_hostname or ansible_fqdn }}" |
| 58 | + value: "{{ thinlinc_agent_hostname | default(ansible_facts['fqdn']) }}" |
51 | 59 | notify: restart vsmagent |
52 | 60 | when: "'thinlinc_agents' in group_names" |
53 | 61 |
|
54 | 62 | - name: Configure /vsmagent/master_hostname |
55 | 63 | tlconfig: |
56 | 64 | param: /vsmagent/master_hostname |
57 | | - value: "{{ groups['thinlinc_masters'][0] or 'localhost' }}" |
| 65 | + value: "{{ groups['thinlinc_masters'][0] | default('localhost') }}" |
58 | 66 | notify: restart vsmagent |
59 | 67 | when: "'thinlinc_agents' in group_names" |
60 | 68 |
|
61 | 69 | - name: Configure /vsmagent/allowed_clients |
62 | 70 | tlconfig: |
63 | 71 | param: /vsmagent/allowed_clients |
64 | | - value: "{{ ' '.join(groups['thinlinc_masters']) or 'localhost' }}" |
| 72 | + value: "{{ groups['thinlinc_masters'] | default(['localhost']) | join(' ') }}" |
65 | 73 | notify: restart vsmagent |
66 | 74 | when: "'thinlinc_agents' in group_names" |
67 | 75 |
|
68 | 76 | - name: Configure list of agent servers |
69 | 77 | tlconfig: |
70 | 78 | param: /vsmserver/subclusters/Default/agents |
71 | | - value: "{{ ' '.join(groups['thinlinc_agents']) or 'localhost' }}" |
| 79 | + value: "{{ groups['thinlinc_agents'] | default(['localhost']) | join(' ') }}" |
72 | 80 | notify: restart vsmserver |
73 | 81 | when: "'thinlinc_masters' in group_names" |
0 commit comments