-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsoftware.yaml
More file actions
175 lines (156 loc) · 4.79 KB
/
software.yaml
File metadata and controls
175 lines (156 loc) · 4.79 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
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
175
---
- name: 'Install Ubuntu packages'
hosts: 'all'
vars:
zfs_max: 4187689984
tasks:
- name: 'Install key for R packages'
become: yes
apt_key:
keyserver: 'keyserver.ubuntu.com'
id: 'E298A3A825C0D65DFD57CBB651716619E084DAB9'
- name: 'Install repository for R packages'
become: yes
apt_repository:
repo: 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
filename: 'r'
# Instructions to install distribution specific nvidia cuda:
# https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=debnetwork
- name: 'Pin nvidia cuda versions'
become: yes
get_url:
url: 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin'
dest: '/etc/apt/preferences.d/cuda-repository-pin-600'
tags: 'cuda'
- name: 'Install key for nvidia cuda packages'
become: yes
apt_key:
url: 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub'
tags: 'cuda'
- name: 'Install repository for nvidia cuda packages'
become: yes
apt_repository:
repo: 'deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /'
filename: 'cuda'
tags: 'cuda'
- name: 'Install key for syncthing packages'
become: yes
apt_key:
url: 'https://syncthing.net/release-key.txt'
- name: 'Install repository for syncthing packages'
apt_repository:
repo: 'deb https://apt.syncthing.net/ syncthing release'
filename: 'syncthing'
- name: 'Install key for google cloud sdk'
become: yes
apt_key:
url: 'https://packages.cloud.google.com/apt/doc/apt-key.gpg'
keyring: '/usr/share/keyrings/cloud.google.gpg'
- name: 'Install repository for google cloud sdk distribution'
become: yes
apt_repository:
repo: 'deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main'
filename: 'google-cloud-sdk'
- name: 'Install packages'
become: yes
apt:
name:
- 'ubuntu-desktop'
# Scientific software.
- 'r-base-dev'
- 'linux-headers-generic' # Required for nvidia driver
- 'cuda'
# R package dependencies.
- 'libcairo2-dev'
- 'libcurl4-openssl-dev'
- 'libssl-dev'
- 'libxml2-dev'
# Monitoring.
- 'collectd'
# Utilities.
- 'emacs-nox'
- 'google-cloud-sdk'
- 'htop'
- 'iperf3'
- 'ncdu'
- 'time'
- 'tmux'
- 'tree'
- 'syncthing'
- name: 'Unignore collectd tmpfs and zfs_arc'
become: yes
replace:
path: '/etc/collectd/collectd.conf'
regexp: '{{ item.regexp }}'
replace: '{{ item.replace }}'
loop:
- regexp: '( )(FSType tmpfs)'
replace: '\1# \2'
- regexp: '#(LoadPlugin zfs_arc)'
replace: '\1'
tags: 'collectd'
- name: 'Ignore collectd filesystems and mountpoints'
become: yes
lineinfile:
path: '/etc/collectd/collectd.conf'
insertafter: '<Plugin df>'
line: ' {{ line }}'
loop:
- 'FSType pstore'
- 'FSType debugfs'
- 'FSType configfs'
- 'FSType tracefs'
- 'FSType binfmt_misc'
- 'MountPoint "/run"'
- 'MountPoint "/run/lock"'
- 'MountPoint "/run/user"'
- 'MountPoint "/run/user/0"'
- 'MountPoint "/dev"'
- 'MountPoint "/dev/shm"'
- 'MountPoint "/sys/fs/cgroup"'
# /root conflicts with / because both are read as "df-root".
- 'MountPoint "/root"'
loop_control:
loop_var: 'line'
tags: 'collectd'
- name: 'Gather logrotate files'
find:
path: '/etc/logrotate.d'
register: logrotate
tags: 'zfs'
- name: 'Disable compression because ZFS compresses logs'
become: yes
replace:
path: '{{ path }}'
regexp: '([^#y])compress'
replace: '\1#compress'
loop: '{{ logrotate.files | map(attribute="path") | list }}'
loop_control:
loop_var: 'path'
tags: 'zfs'
- name: 'Detect ZFS c_max'
shell:
cmd: sed -nr 's/^c_max .* ([[:digit:]]+)$/\1/p' /proc/spl/kstat/zfs/arcstats
warn: false
changed_when: false
register: c_max
tags: 'zfs'
- name: 'ZFS set current c_max'
become: yes
shell:
cmd: 'echo {{ zfs_max }} > /sys/module/zfs/parameters/zfs_arc_max'
when: 'c_max.stdout | int != zfs_max'
tags: 'zfs'
- name: 'ZFS set persistent c_max'
become: yes
copy:
dest: /etc/modprobe.d/zfs.conf
content: |
options zfs zfs_arc_max={{ zfs_max }}
register: zfs_conf
tags: 'zfs'
- name: 'Apply zfs.conf to initramfs'
become: yes
command: /usr/sbin/update-initramfs -u
when: 'zfs_conf.changed'
tags: 'zfs'