-
Notifications
You must be signed in to change notification settings - Fork 0
/
customization.yaml
129 lines (110 loc) · 3.93 KB
/
customization.yaml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
- hosts: localhost
vars:
ssh_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD0eTzvYXj4ddqxz49CJsUBYD4wjLfhj6Py/AHKVPLEtq7hB2AeY+OLkkyDoDTC+mBIPgbS6aB2rGrc2vGM7q2w4Nw3a/rcXS5IIncMWlrznLd0E0r84OGdwQbGWfAP3RUX5pxRoykCHeE9hHpjN3xF0IM/RPgXNz+H5Z1325SSYTEorQ9JI6E75eQk/r9/aWF2yoZeFwLc5FDG6AQylHGNiiNeqMrR11TvbPomXd3H7zXgdwem+Egz23BNLt8TldrugzYj1vlx1qBazpHTbf95xpZGaMWiBcmo+Uy2BiVft5gO7YAl0et4japJYS2eQE0N5T0pJoIlWDz5ns2phVZt esa@x1y3
tasks:
- name: "Disable built in installation wizard"
file:
path: "/etc/systemd/system/{{ item }}"
src: "/dev/null"
state: link
loop:
- ubiquity.service
- nv-oem-config.target
- nv-oem-config-gui.service
- name: "Create a service to resize rootfs"
copy:
dest: /etc/systemd/system/nvresizefs.service
content: |
[Unit]
Description=Resized app partition
ConditionFirstBoot=true
[Service]
ExecStart=/usr/lib/nvidia/resizefs/nvresizefs.sh
Type=oneshot
[Install]
WantedBy=multi-user.target
- name: "Enable nvresizefs.service"
file:
path: "/etc/systemd/system/multi-user.target.wants/nvresizefs.service"
src: "/etc/systemd/system/nvresizefs.service"
state: link
- name: "Set locale"
copy:
dest: /etc/default/locale
content: |
LANG=en_DK.UTF-8
- name: "Console keyboard layout"
copy:
dest: /etc/vconsole.conf
content: |
KEYMAP=fi
- name: "X11 keyboard layout"
copy:
dest: /etc/default/keyboard
content: |
XKBMODEL=pc105
XKBLAYOUT=fi
XKBOPTIONS=terminate:ctrl_alt_bksp
BACKSPACE=guess
- name: "Remove excludes to include documentation"
copy:
dest: /etc/dpkg/dpkg.cfg.d/excludes
content: ''
register: remove_excludes
- name: "Reinstall packages with missing documentation"
when: remove_excludes.changed
shell: |
# Reinstallation takes place in two steps because a single dpkg --verified
# command generates very long parameter list for "xargs dpkg -S" and may go
# over ARG_MAX. Since many packages have man pages the second download
# handles a much smaller amount of packages.
dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
echo "Reinstalling packages with system documentation in /usr/share/doc/ .."
# This step processes the packages which still have missing documentation
dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
| xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
- name: "Install useful software"
apt:
pkg:
- htop
- rsync
- screen
- tmux
- name: "Create default user"
user:
name: jetson
password: "$6$salt$MJznBo5SCG.t/gLu4bwlaE9foMvdFFsVJVlq2YRx3PaRvILYhA5V4nRtzc8yb5c1WwiLCqAvTdYQBbom7DmYq/" # jetson
shell: "/bin/bash"
groups:
- gdm
- sudo
- video
- name: "Enable passwordless sudo"
lineinfile:
path: /etc/sudoers
regexp: '%sudo.*'
line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL'
- name: "Create override directory for [email protected]"
file:
path: /etc/systemd/system/[email protected]
state: directory
- name: "Set multi-user.target as default target"
file:
path: /etc/systemd/system/default.target
src: /lib/systemd/system/multi-user.target
state: link
- name: "Enable autologin on console"
copy:
dest: /etc/systemd/system/[email protected]/override.conf
content: |
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin jetson %I $TERM
- name: "Add authorized keys"
authorized_key:
user: jetson
state: present
key: "{{ item }}"
loop: "{{ ssh_keys }}"