-
Notifications
You must be signed in to change notification settings - Fork 0
/
laptop-jammy.yml
88 lines (80 loc) · 2.53 KB
/
laptop-jammy.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
#
# Notes:
#
# For type tests see: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tests.html#type-tests
#
# Tags:
#
# - install
# - user_config
# - system_config
#
# Example usage:
#
# ansible-playbook --ask-become-pass -i inventories/production/laptop.yml laptop-jammy.yml
# ansible-playbook --ask-become-pass -i inventories/production/laptop.yml --skip-tags user_config laptop-jammy.yml
# ansible-playbook --ask-become-pass -i inventories/production/laptop.yml --skip-tags install laptop-jammy.yml
#
# ansible-playbook --user=ubuntu --ask-pass --ask-become-pass \
# -i inventories/example/hosts.yml --limit=laptop2 \
# laptop-jammy.yml
- name: 'Ansible for Ubuntu configuration'
hosts: all
vars:
simple_roles:
# - common
# - clamav
# - podman
# - python
# - vim
# - teams_insiders
# - lxd_simple
x_roles:
# - debug_user_settings
- setuser
- aliases
# - keyboard
# - git
# - vscode
# - dconf
tasks:
- name: System (user independent) roles
ansible.builtin.include_role:
name: "{{ simple_role }}"
loop_control:
loop_var: simple_role
loop: "{{ simple_roles if
simple_roles is defined and simple_roles is iterable and
simple_roles is not string and simple_roles is not mapping and
simple_roles | length > 0
else [] }}"
tags: install
- name: Load user settings
ansible.builtin.include_tasks:
file: tasks/load_user_info.yml
loop_control:
loop_var: file_name
loop: "{{ userlist if
userlist is defined and userlist is iterable and
userlist is not string and userlist is not mapping and
userlist | length > 0
else [] }}"
tags: user_config
- name: User dependent roles
ansible.builtin.include_role:
name: "{{ x_role }}"
vars:
x_user: "{{ xur.0 }}"
x_role: "{{ xur.1 }}"
loop_control:
loop_var: xur
loop: "{{ (user_settings | product(x_roles) | list) if
user_settings is defined and user_settings is iterable and
user_settings is not string and user_settings is not mapping and
user_settings | length > 0 and
x_roles is defined and x_roles is iterable and
x_roles is not string and x_roles is not mapping and
x_roles | length > 0
else [] }}"
tags: user_config