+ proxy1, vm1 OS csere, vm4 reIP
This commit is contained in:
parent
e1d700d825
commit
033f5d2628
65
Vagrantfile
vendored
65
Vagrantfile
vendored
@ -2,16 +2,16 @@ Vagrant.configure("2") do |config|
|
||||
|
||||
config.vm.define "vm1" do |vm1|
|
||||
vm1.vm.network "private_network", ip: "192.168.56.2"
|
||||
vm1.vm.box = "vshn/centos7" # nem hivatalos kiadás, de legalább nem 3 éves
|
||||
vm1.vm.box = "debian/bullseye64"
|
||||
vm1.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = "512"
|
||||
vb.cpus = 1
|
||||
end
|
||||
vm1.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
vm1.vm.provision "shell", inline: <<-SHELL
|
||||
yum install mc epel-release httpd net-tools -y
|
||||
yum update -y
|
||||
systemctl enable --now httpd
|
||||
apt-get update && apt-get upgrade -y
|
||||
apt-get clean
|
||||
apt-get install mc apache2 -y
|
||||
echo "vm1" > /etc/hostname
|
||||
hostname -F /etc/hostname
|
||||
echo "192.168.56.2 vm1" >> /etc/hosts
|
||||
@ -58,7 +58,7 @@ Vagrant.configure("2") do |config|
|
||||
end
|
||||
|
||||
config.vm.define "vm4" do |vm4|
|
||||
vm4.vm.network "private_network", ip: "192.168.56.5"
|
||||
vm4.vm.network "private_network", ip: "192.168.57.5"
|
||||
vm4.vm.box = "debian/bookworm64"
|
||||
vm4.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = "512"
|
||||
@ -71,7 +71,7 @@ Vagrant.configure("2") do |config|
|
||||
apt-get install mc apache2 -y
|
||||
echo "vm4" > /etc/hostname
|
||||
hostname -F /etc/hostname
|
||||
echo "192.168.56.5 vm4" >> /etc/hosts
|
||||
echo "192.168.57.5 vm4" >> /etc/hosts
|
||||
timedatectl set-timezone Europe/Budapest
|
||||
SHELL
|
||||
end
|
||||
@ -93,8 +93,6 @@ Vagrant.configure("2") do |config|
|
||||
timedatectl set-timezone Europe/Budapest
|
||||
mkdir -p /home/vagrant/docker/zabbix-server
|
||||
cat > /home/vagrant/docker/zabbix-server/docker-compose.yml << EOL
|
||||
version: "3"
|
||||
|
||||
volumes:
|
||||
DB:
|
||||
|
||||
@ -104,6 +102,7 @@ services:
|
||||
image: zabbix/zabbix-server-mysql:alpine-6.4-latest
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- ./ssh_keys:/var/lib/zabbix/ssh_keys
|
||||
ports:
|
||||
- 10051:10051
|
||||
restart: always
|
||||
@ -167,4 +166,54 @@ EOL
|
||||
SHELL
|
||||
end
|
||||
|
||||
config.vm.define "proxy1" do |proxy1|
|
||||
proxy1.vm.network "private_network", ip: "192.168.57.6"
|
||||
proxy1.vm.box = "almalinux/9"
|
||||
proxy1.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = "1024"
|
||||
vb.cpus = 1
|
||||
end
|
||||
proxy1.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
proxy1.vm.provision "shell", inline: <<-SHELL
|
||||
yum install mc net-tools -y
|
||||
yum update -y
|
||||
echo "proxy1" > /etc/hostname
|
||||
hostname -F /etc/hostname
|
||||
echo "192.168.57.6 proxy1" >> /etc/hosts
|
||||
timedatectl set-timezone Europe/Budapest
|
||||
mkdir -p /home/vagrant/docker/zabbix-proxy
|
||||
mkdir -p /var/lib/docker/volumes/zabbix-proxy_ZBXPROXY_SECRETS/_data
|
||||
cat > /var/lib/docker/volumes/zabbix-proxy_ZBXPROXY_SECRETS/_data/zabbix.psk << EOL
|
||||
977b74008c40fed130a410074df64a4fafd7244b64e163ec86a77e0e49323dbd
|
||||
EOL
|
||||
cat > /home/vagrant/docker/zabbix-proxy/docker-compose.yml << EOL
|
||||
volumes:
|
||||
ZBXPROXY_DB:
|
||||
ZBXPROXY_SNMPTRAPS:
|
||||
ZBXPROXY_SECRETS:
|
||||
|
||||
services:
|
||||
zabbix-proxy:
|
||||
container_name: zabbix-proxy
|
||||
image: zabbix/zabbix-proxy-sqlite3:alpine-6.4-latest
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- ZBXPROXY_DB:/var/lib/zabbix/db_data
|
||||
- ZBXPROXY_SNMPTRAPS:/var/lib/zabbix/snmptraps
|
||||
- ZBXPROXY_SECRETS:/var/lib/zabbix/enc
|
||||
ports:
|
||||
- 10051:10051
|
||||
restart: always
|
||||
environment:
|
||||
- ZBX_SERVER_HOST=192.168.56.6
|
||||
- ZBX_SERVER_PORT=10051
|
||||
- ZBX_HOSTNAME=proxy1
|
||||
- ZBX_CONFIGFREQUENCY=60
|
||||
- ZBX_TLSCONNECT=psk
|
||||
- ZBX_TLSPSKFILE=/var/lib/zabbix/enc/zabbix.psk
|
||||
- ZBX_TLSPSKIDENTITY=proxy1
|
||||
EOL
|
||||
SHELL
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user