-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.yml
More file actions
54 lines (48 loc) · 1.63 KB
/
install.yml
File metadata and controls
54 lines (48 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
- name: 'Install the whole suite'
hosts: 'all'
tasks:
- name: 'Check mandatory clean_configs option'
when: 'clean_configs is not defined or clean_configs not in ["no", "safe", "all"]'
tags: 'user'
ansible.builtin.set_fact:
clean_configs: 'safe'
- name: 'Fail if invalid user is requested'
when: 'user is defined and user not in users'
tags: 'user'
ansible.builtin.fail:
msg: >-
User configuration for {{ user }} is requested
explicitly, but no configuration for this user
is found in inventory. Refusing to continue.
- name: 'Limit users list to specific user'
when: 'user is defined and user in users'
tags: 'user'
ansible.builtin.set_fact:
user_items: >-
{{
users |
dict2items |
selectattr("key", "equalto", user)
}}
- name: 'Configure target platform'
ansible.builtin.include_tasks:
file: 'tasks/platform_{{ ansible_facts["os_family"] | lower }}.yml'
- name: 'Install Xorg'
when: '"gui" in system'
ansible.builtin.include_role:
name: 'xorg'
- name: 'Install DM'
when: '"gui" in system and "dm" in system.gui'
ansible.builtin.include_role:
name: 'dms/{{ system.gui.dm }}'
- name: 'Configure users'
tags: 'user'
loop: '{{ user_items | default(users | dict2items) }}'
loop_control:
loop_var: 'user_item'
vars:
user_name: '{{ user_item.key }}'
user_config: '{{ user_item.value }}'
ansible.builtin.include_tasks:
file: 'tasks/install_user.yml'