-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxmox_init.sh
More file actions
91 lines (76 loc) · 3.61 KB
/
proxmox_init.sh
File metadata and controls
91 lines (76 loc) · 3.61 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
#!/usr/bin/env bash
# all commands executed from 'root'
# wget -q https://raw.githubusercontent.com/Stikus/Scripts/master/proxmox_init.sh AKA http://tiny.cc/stik_proxmox
# export DEBIAN_FRONTEND="noninteractive"
# Add GKS Server pub RSA-key
mkdir -p "$HOME/.ssh" && wget -q "ftp://bioftp.cspfmba.ru/certs/keys/GKS_Server_id_rsa.pub" -O ->> "$HOME/.ssh/authorized_keys"
# Add tmux config with mouse enabled
wget -q "ftp://bioftp.cspfmba.ru/certs/keys/.tmux.conf" -O "$HOME/.tmux.conf"
# Add additional search and nameserver
echo -e "search pak-cspmz.ru cspfmba.ru\nnameserver 10.100.143.21\nnameserver 10.100.143.22" > /etc/resolv.conf
# Fix licence warning
# sed -i.bak "s/data.status !== 'Active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service
sed -i.bak -z "s/res === null || res === undefined || \!res || res\n\t\t\t.data.status.toLowerCase() \!== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service
# Fix updates
sed -i -E 's|^(.*)$|#\1|' /etc/apt/sources.list.d/pve-enterprise.list
sed -i '5i deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription' /etc/apt/sources.list
# Locales
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
echo 'LANG="en_US.UTF-8"'> /etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
apt-get update && apt-get --yes dist-upgrade && apt-get --yes upgrade && apt-get --yes install \
mc \
htop \
nfs-common \
ntp \
zabbix-agent \
tmux
lvremove -y /dev/pve/data
lvextend --resizefs -l +100%FREE pve/root
sed -i '/^Server/s/127.0.0.1/10.100.143.184/' zabbix_agentd.conf
systemctl restart zabbix-agent.service
# # Mdadm part
# apt-get install -y mdadm
# mdadm --zero-superblock --force /dev/nvme{0..3}n1
# wipefs --all --force /dev/nvme{0..3}n1
# mdadm --create --verbose /dev/md0 -l 10 -n 4 /dev/nvme{0..3}n1
# mkdir -p /etc/mdadm
# echo "DEVICE partitions" > /etc/mdadm/mdadm.conf
# mdadm --detail --scan --verbose | awk '/ARRAY/ {print}' >> /etc/mdadm/mdadm.conf
# mkfs.ext4 /dev/md0
# mkdir /mnt/data
# echo "/dev/md0 /mnt/data ext4 defaults 0 0" >> /etc/fstab
# mount -a
# Fusion inventory part: https://gitlab.cspfmba.ru/volk/ansible/main-playbooks/-/tree/master/roles/fusioninventory-agent
apt-get update && apt-get --yes install \
dmidecode \
hwdata \
hdparm \
libuniversal-require-perl \
libwww-perl \
libparse-edid-perl \
libproc-daemon-perl \
libfile-which-perl \
libhttp-daemon-perl \
libxml-treepp-perl \
libyaml-perl \
libnet-cups-perl \
libnet-ip-perl \
libdigest-sha-perl \
libjson-pp-perl \
libsocket-getaddrinfo-perl \
libtext-template-perl \
libyaml-tiny-perl \
libxml-xpath-perl \
lsb-base \
xz-utils
wget -q https://github.com/fusioninventory/fusioninventory-agent/releases/download/2.6/fusioninventory-agent_2.6-1_all.deb && \
dpkg -i fusioninventory-agent_2.6-1_all.deb && \
rm fusioninventory-agent_2.6-1_all.deb && \
sed -i 's|#server = http://server.domain.com/glpi/plugins/fusioninventory/|server = https://inv.pak-cspmz.ru/inv/plugins/fusioninventory|' /etc/fusioninventory/agent.cfg && \
sed -i 's|no-ssl-check = 0|no-ssl-check = 1|' /etc/fusioninventory/agent.cfg && \
sed -i 's|#logfile = /var/log/fusioninventory.log|logfile = /var/log/fusioninventory.log|' /etc/fusioninventory/agent.cfg && \
sed -i 's|debug = 0|debug = 1|' /etc/fusioninventory/agent.cfg && \
systemctl restart fusioninventory-agent