-
Notifications
You must be signed in to change notification settings - Fork 13
/
freshinstall-ubuntu.yml
174 lines (154 loc) · 3.9 KB
/
freshinstall-ubuntu.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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
- hosts: all
gather_facts: yes
tasks:
# - name: add virtualbox repo for bionic / 1804LTS - TODO update when repo for focal / 20.04 hits
# apt_repository:
# repo: 'deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian bionic contrib'
# state: present
- name: Update apt-get repo and cache if more than 12 hrs old
apt: update_cache=yes force_apt_get=yes cache_valid_time=43200
- name: add VirtualBox repo signing keys
apt_key: state=present
url=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
apt_key: state=present
url=http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc
# shell: cd; wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
# shell: cd; wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
- name: get linux headers for current kernel - useful for vbox modules
shell: apt install -y linux-headers-$(uname -r)
- name: Install a list of packages - most-needed admin tools
apt:
pkg:
- joe
- mc
- screen
- lzop
- fsarchiver
- netcat-traditional
- bwm-ng
- openssh-server
- smartmontools
- sysstat
- pv
- buffer
- ethtool
- gparted
- iotop
- name: Install another list of useful pkgs
apt:
pkg:
- build-essential
- synaptic
- aptitude
- apt-file
- lm-sensors
- hddtemp
- sshfs
- dos2unix
- p7zip
- unrar
- parallel
- pbzip2
- xz-utils
- lsscsi
- scsitools
- sdparm
- sg3-utils
- lftp
- nmap
- iptraf
- autossh
- name: Install another list of pkgs - desktop sound and video related
apt:
pkg:
- sox
- vorbis-tools
- cdparanoia
- vlc
- youtube-dl
- handbrake
- handbrake-cli
- lame
- mpg123
- ffmpeg
- devede
- udftools
- dvd+rw-tools
- growisofs
- wodim
- icedax
- xine-ui
- mplayer
- name: Install another list of pkgs - desktop related
apt:
pkg:
- thunar
- xfce4-terminal
- xterm
- rxvt
- xtightvncviewer
- x11vnc
- xfce4-screenshooter
- scrot
- mesa-utils
- name: Install another list of pkgs - doc related
apt:
pkg:
- evince
- libreoffice
- name: Install another list of pkgs - toys and image-related
apt:
pkg:
- cmatrix
- xaos
- imagemagick
- geeqie
- ristretto
- jpegoptim
- tumbler
- name: install list of pkgs - printing
apt:
pkg:
- cups
- hplip
- hplip-gui
- name: install basic browsers
apt:
pkg:
- lynx
- w3m
- name: install zfs file sharing stuff
apt:
pkg:
- samba
- smbclient
- cifs-utils
- name: add dependency manager
apt: name=dkms
# - name: install vbox 6.1
# apt:
# name: virtualbox-6.1
# state: present
- name: updt apt-file cache
shell: apt-file update
- name: if zfs module loaded, display importable pools
shell: "[ $(lsmod |grep -c zfs) -gt 0 ] && zpool import"
# executable: /bin/bash
ignore_errors: yes
- name: finally - update any remaining outdated packages
apt:
name: "*"
state: latest
- name: Check if a reboot is needed for Debian and Ubuntu boxes
register: reboot_required_file
stat: path=/var/run/reboot-required get_md5=no
- name: Reboot the Debian or Ubuntu server
reboot:
msg: "Reboot initiated by Ansible due to kernel updates"
connect_timeout: 5
reboot_timeout: 300
pre_reboot_delay: 0
post_reboot_delay: 30
test_command: uptime
when: reboot_required_file.stat.exists