From acebdef815ef48d586f7f30802591b842538d38a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 1 Aug 2023 14:50:47 +0200 Subject: [PATCH] =?UTF-8?q?OS=20csere=20a=20zbxsrv-n=C3=A9l,=20CentOS=207?= =?UTF-8?q?=20->=20Alma=20Linux=209=20/=20docker-compose.yml=20hozz=C3=A1a?= =?UTF-8?q?d=C3=A1sa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vagrantfile | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 4 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index d563467..b553a13 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,7 +2,7 @@ Vagrant.configure("2") do |config| config.vm.define "vm1" do |vm1| vm1.vm.network "private_network", ip: "192.168.56.2" - vm1.vm.box = "centos/7" + vm1.vm.box = "vshn/centos7" # nem hivatalos kiadás, de legalább nem 3 éves vm1.vm.provider "virtualbox" do |vb| vb.memory = "512" vb.cpus = 1 @@ -78,19 +78,92 @@ Vagrant.configure("2") do |config| config.vm.define "zbxsrv" do |zbxsrv| zbxsrv.vm.network "private_network", ip: "192.168.56.6" - zbxsrv.vm.box = "centos/7" + zbxsrv.vm.box = "almalinux/9" zbxsrv.vm.provider "virtualbox" do |vb| - vb.memory = "512" + vb.memory = "1024" vb.cpus = 1 end zbxsrv.vm.synced_folder ".", "/vagrant", disabled: true zbxsrv.vm.provision "shell", inline: <<-SHELL - yum install mc epel-release net-tools -y + yum install mc net-tools -y yum update -y echo "zbxsrv" > /etc/hostname hostname -F /etc/hostname echo "192.168.56.6 zbxsrv" >> /etc/hosts 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: + +services: + zabbix-server: + container_name: zabbix-server + image: zabbix/zabbix-server-mysql:alpine-6.4-latest + volumes: + - /etc/localtime:/etc/localtime:ro + ports: + - 10051:10051 + restart: always + environment: + - DB_SERVER_HOST=zabbix-db + - DB_SERVER_PORT=3306 + - MYSQL_DATABASE=zabbix + - MYSQL_USER=zabbix + - MYSQL_PASSWORD=P@G*LCxUAU96L5oq + - ZBX_STARTPINGERS=3 + - ZBX_LISTENPORT=10051 + networks: + customnetwork: + ipv4_address: 192.168.151.2 + + zabbix-web: + container_name: zabbix-web + image: zabbix/zabbix-web-apache-mysql:alpine-6.4-latest + volumes: + - /etc/localtime:/etc/localtime:ro + ports: + - 888:8080 + restart: always + environment: + - DB_SERVER_HOST=zabbix-db + - DB_SERVER_PORT=3306 + - MYSQL_DATABASE=zabbix + - MYSQL_USER=zabbix + - MYSQL_PASSWORD=P@G*LCxUAU96L5oq + - ZBX_SERVER_HOST=zabbix-server + - ZBX_SERVER_PORT=10051 + - ZBX_SERVER_NAME=zbxsrv + - PHP_TZ=Europe/Budapest + networks: + customnetwork: + ipv4_address: 192.168.151.3 + + zabbix-db: + container_name: zabbix-db + image: mariadb:10.6 + volumes: + - DB:/var/lib/mysql + - /etc/localtime:/etc/localtime:ro + command: mysqld --collation-server=utf8mb4_bin + restart: always + environment: + - MYSQL_ROOT_PASSWORD=xQdr0iORWI8ZEY1F + - MYSQL_DATABASE=zabbix + - MYSQL_USER=zabbix + - MYSQL_PASSWORD=P@G*LCxUAU96L5oq + networks: + customnetwork: + ipv4_address: 192.168.151.4 + +networks: + customnetwork: + ipam: + config: + - subnet: 192.168.151.0/24 +EOL SHELL end