You've already forked net-research
93 lines
2.1 KiB
Smarty
93 lines
2.1 KiB
Smarty
#cloud-config
|
|
hostname: server
|
|
manage_etc_hosts: false
|
|
|
|
users:
|
|
- name: ubuntu
|
|
gecos: ubuntu
|
|
sudo: ALL=(ALL) NOPASSWD:ALL
|
|
lock_passwd: false
|
|
ssh_pwauth: true
|
|
shell: /bin/bash
|
|
|
|
ssh_pwauth: true
|
|
chpasswd:
|
|
list: |
|
|
ubuntu:ubuntu
|
|
expire: false
|
|
|
|
growpart:
|
|
mode: auto
|
|
devices: ["/"]
|
|
|
|
package_update: true
|
|
package_upgrade: false
|
|
packages:
|
|
- tftpd-hpa
|
|
- nginx
|
|
- caddy
|
|
|
|
write_files:
|
|
- path: /etc/nginx/nginx.conf
|
|
owner: root:root
|
|
permissions: "0644"
|
|
encoding: b64
|
|
content: ${nginx_conf}
|
|
- path: /etc/default/tftpd-hpa
|
|
owner: root:root
|
|
permissions: "0644"
|
|
encoding: b64
|
|
content: ${tftpd_conf}
|
|
- path: /etc/caddy/Caddyfile
|
|
owner: root:root
|
|
permissions: "0644"
|
|
encoding: b64
|
|
content: ${caddy_conf}
|
|
- path: /etc/hosts
|
|
append: true
|
|
encoding: b64
|
|
content: ${hosts_file}
|
|
- path: /etc/networkd-dispatcher/routable.d/10-disable-offloading
|
|
owner: root:root
|
|
permissions: "0755"
|
|
content: |
|
|
#!/bin/bash
|
|
for IF in $(networkctl list --no-legend | awk '/ routable /{print $2}'); do
|
|
/usr/sbin/ethtool -K "$IF" \
|
|
rx off tx off sg off tso off ufo off gso off gro off lro off \
|
|
ntuple off rxhash off rx-gro-hw off || true
|
|
done
|
|
- path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
|
|
permissions: '0644'
|
|
content: |
|
|
network: {config: disabled}
|
|
- path: /etc/netplan/01-static.yaml
|
|
owner: root:root
|
|
permissions: '0644'
|
|
content: |
|
|
network:
|
|
version: 2
|
|
renderer: networkd
|
|
ethernets:
|
|
enp1s0:
|
|
dhcp4: false
|
|
addresses: [${ip}]
|
|
gateway4: ${gateway}
|
|
nameservers:
|
|
addresses: ${nameservers}
|
|
|
|
modules:
|
|
- tcp_bbr
|
|
- sch_netem
|
|
|
|
runcmd:
|
|
- rm -f /etc/netplan/50-cloud-init.yaml
|
|
- netplan generate && netplan apply
|
|
|
|
- |
|
|
dd if=/dev/random of=/var/www/1MB.file bs=1024K count=1
|
|
dd if=/dev/random of=/var/www/10MB.file bs=1024K count=10
|
|
dd if=/dev/random of=/var/www/100MB.file bs=1024K count=100
|
|
|
|
- systemctl enable nginx caddy tftpd-hpa && systemctl restart nginx caddy tftpd-hpa
|