From 91606a016c14e172b0847018e387de2813fb4942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 27 Jun 2023 10:20:04 +0200 Subject: [PATCH 01/41] v 1.0 --- changelog.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 changelog.md diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..28f4d3c --- /dev/null +++ b/changelog.md @@ -0,0 +1,11 @@ +# CHANGELOG + +## 1.0 +Elkészült az első Vagrantfile, benne a kötelező 3 sorral, egy CentOS 7 OS-t indítva. +Kommentek nélkül így néz ki: +```yaml +Vagrant.configure("2") do |config| + config.vm.box = "centos/7" +end +``` +Erről írtam egy cikket [itt](https://msandor.hu/vagrant-teszt-kornyezet-villamgyorsan/). From 6276b6467f83ac3fb5d877ab6dfb6855cc15f286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 27 Jun 2023 10:21:05 +0200 Subject: [PATCH 02/41] v 1.0 --- Vagrantfile | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..559cb0f --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,77 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure("2") do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + # Every Vagrant development environment requires a box. You can search for + # boxes at https://vagrantcloud.com/search. + config.vm.box = "centos/7" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + # NOTE: This will enable public access to the opened port + # config.vm.network "forwarded_port", guest: 80, host: 8080 + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine and only allow access + # via 127.0.0.1 to disable public access + # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + # config.vm.network "private_network", ip: "192.168.33.10" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "../data", "/vagrant_data" + + # Disable the default share of the current code directory. Doing this + # provides improved isolation between the vagrant box and your host + # by making sure your Vagrantfile isn't accessable to the vagrant box. + # If you use this you may want to enable additional shared subfolders as + # shown above. + # config.vm.synced_folder ".", "/vagrant", disabled: true + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + # config.vm.provider "virtualbox" do |vb| + # # Display the VirtualBox GUI when booting the machine + # vb.gui = true + # + # # Customize the amount of memory on the VM: + # vb.memory = "1024" + # end + # + # View the documentation for the provider you are using for more + # information on available options. + + # Enable provisioning with a shell script. Additional provisioners such as + # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the + # documentation for more information about their specific syntax and use. + # config.vm.provision "shell", inline: <<-SHELL + # apt-get update + # apt-get install -y apache2 + # SHELL +end From 4f2931e18b842a47ebbeb8364db432b0cd962037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 27 Jun 2023 13:11:17 +0200 Subject: [PATCH 03/41] v 2.0 --- Vagrantfile | 85 +++++++---------------------------------------------- 1 file changed, 11 insertions(+), 74 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 559cb0f..09a4aed 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,77 +1,14 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# All Vagrant configuration is done below. The "2" in Vagrant.configure -# configures the configuration version (we support older styles for -# backwards compatibility). Please don't change it unless you know what -# you're doing. Vagrant.configure("2") do |config| - # The most common configuration options are documented and commented below. - # For a complete reference, please see the online documentation at - # https://docs.vagrantup.com. - - # Every Vagrant development environment requires a box. You can search for - # boxes at https://vagrantcloud.com/search. config.vm.box = "centos/7" - - # Disable automatic box update checking. If you disable this, then - # boxes will only be checked for updates when the user runs - # `vagrant box outdated`. This is not recommended. - # config.vm.box_check_update = false - - # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine. In the example below, - # accessing "localhost:8080" will access port 80 on the guest machine. - # NOTE: This will enable public access to the opened port - # config.vm.network "forwarded_port", guest: 80, host: 8080 - - # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine and only allow access - # via 127.0.0.1 to disable public access - # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" - - # Create a private network, which allows host-only access to the machine - # using a specific IP. - # config.vm.network "private_network", ip: "192.168.33.10" - - # Create a public network, which generally matched to bridged network. - # Bridged networks make the machine appear as another physical device on - # your network. - # config.vm.network "public_network" - - # Share an additional folder to the guest VM. The first argument is - # the path on the host to the actual folder. The second argument is - # the path on the guest to mount the folder. And the optional third - # argument is a set of non-required options. - # config.vm.synced_folder "../data", "/vagrant_data" - - # Disable the default share of the current code directory. Doing this - # provides improved isolation between the vagrant box and your host - # by making sure your Vagrantfile isn't accessable to the vagrant box. - # If you use this you may want to enable additional shared subfolders as - # shown above. - # config.vm.synced_folder ".", "/vagrant", disabled: true - - # Provider-specific configuration so you can fine-tune various - # backing providers for Vagrant. These expose provider-specific options. - # Example for VirtualBox: - # - # config.vm.provider "virtualbox" do |vb| - # # Display the VirtualBox GUI when booting the machine - # vb.gui = true - # - # # Customize the amount of memory on the VM: - # vb.memory = "1024" - # end - # - # View the documentation for the provider you are using for more - # information on available options. - - # Enable provisioning with a shell script. Additional provisioners such as - # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the - # documentation for more information about their specific syntax and use. - # config.vm.provision "shell", inline: <<-SHELL - # apt-get update - # apt-get install -y apache2 - # SHELL + #config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" + config.vm.network "private_network", ip: "192.168.56.2" + config.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + config.vm.provision "shell", inline: <<-SHELL + yum install mc epel-release httpd net-tools -y + yum update -y --skip-broken + systemctl enable --now httpd + SHELL end From 4be2e95a63f66df86308300054a52a7a1e6218d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 27 Jun 2023 13:16:55 +0200 Subject: [PATCH 04/41] v 2.0 --- changelog.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/changelog.md b/changelog.md index 28f4d3c..c7a5644 100644 --- a/changelog.md +++ b/changelog.md @@ -9,3 +9,23 @@ Vagrant.configure("2") do |config| end ``` Erről írtam egy cikket [itt](https://msandor.hu/vagrant-teszt-kornyezet-villamgyorsan/). + +## 2.0 +Több lépésben jutottunk el a 2.0-s Vagrantfile-hoz, bővült az erőforrás (cpu, mem), kapott dedikált hálókártyát, és telepítéskor lefuttat pár parancsot is. +Kommentek nélkül így néz ki: +```yaml +Vagrant.configure("2") do |config| + config.vm.box = "centos/7" + config.vm.network "private_network", ip: "192.168.56.2" + config.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + config.vm.provision "shell", inline: <<-SHELL + yum install mc epel-release httpd net-tools -y + yum update -y --skip-broken + systemctl enable --now httpd + SHELL +end +``` +Erről is írtam egy cikket [itt](https://msandor.hu/lepjunk-szintet-a-vagranttal/). From d45520f4aa0805c3f95a87bfae5248261c8349c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 27 Jun 2023 13:21:04 +0200 Subject: [PATCH 05/41] =?UTF-8?q?forr=C3=A1sk=C3=B3d=20sz=C3=ADnez=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index c7a5644..945b7d9 100644 --- a/changelog.md +++ b/changelog.md @@ -3,7 +3,7 @@ ## 1.0 Elkészült az első Vagrantfile, benne a kötelező 3 sorral, egy CentOS 7 OS-t indítva. Kommentek nélkül így néz ki: -```yaml +```json Vagrant.configure("2") do |config| config.vm.box = "centos/7" end @@ -13,7 +13,7 @@ Erről írtam egy cikket [itt](https://msandor.hu/vagrant-teszt-kornyezet-villam ## 2.0 Több lépésben jutottunk el a 2.0-s Vagrantfile-hoz, bővült az erőforrás (cpu, mem), kapott dedikált hálókártyát, és telepítéskor lefuttat pár parancsot is. Kommentek nélkül így néz ki: -```yaml +```json Vagrant.configure("2") do |config| config.vm.box = "centos/7" config.vm.network "private_network", ip: "192.168.56.2" From 165835571f56d6cde71f23d0f9289fdb2b900611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 27 Jun 2023 14:03:05 +0200 Subject: [PATCH 06/41] =?UTF-8?q?forr=C3=A1sk=C3=B3d=20sz=C3=ADnez=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 945b7d9..a6a13e4 100644 --- a/changelog.md +++ b/changelog.md @@ -3,7 +3,7 @@ ## 1.0 Elkészült az első Vagrantfile, benne a kötelező 3 sorral, egy CentOS 7 OS-t indítva. Kommentek nélkül így néz ki: -```json +```ruby Vagrant.configure("2") do |config| config.vm.box = "centos/7" end @@ -13,7 +13,7 @@ Erről írtam egy cikket [itt](https://msandor.hu/vagrant-teszt-kornyezet-villam ## 2.0 Több lépésben jutottunk el a 2.0-s Vagrantfile-hoz, bővült az erőforrás (cpu, mem), kapott dedikált hálókártyát, és telepítéskor lefuttat pár parancsot is. Kommentek nélkül így néz ki: -```json +```ruby Vagrant.configure("2") do |config| config.vm.box = "centos/7" config.vm.network "private_network", ip: "192.168.56.2" From dc2faa20ff0c9351cdbfa8c2b4bc6321ed18459e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 27 Jun 2023 19:27:11 +0200 Subject: [PATCH 07/41] v 3.0 --- Vagrantfile | 75 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 11 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 09a4aed..356d932 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,14 +1,67 @@ Vagrant.configure("2") do |config| - config.vm.box = "centos/7" - #config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" - config.vm.network "private_network", ip: "192.168.56.2" - config.vm.provider "virtualbox" do |vb| - vb.memory = "1024" - vb.cpus = 2 + + config.vm.define "vm1" do |vm1| + vm1.vm.network "private_network", ip: "192.168.56.2" + vm1.vm.box = "centos/7" + vm1.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + vm1.vm.provision "shell", inline: <<-SHELL + yum install mc epel-release httpd net-tools -y + yum update -y + systemctl enable --now httpd + echo "vm1" > /etc/hostname + hostname -F /etc/hostname + SHELL end - config.vm.provision "shell", inline: <<-SHELL - yum install mc epel-release httpd net-tools -y - yum update -y --skip-broken - systemctl enable --now httpd - SHELL + + config.vm.define "vm2" do |vm2| + vm2.vm.network "private_network", ip: "192.168.56.3" + vm2.vm.box = "almalinux/8" + vm2.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + vm2.vm.provision "shell", inline: <<-SHELL + dnf install mc epel-release httpd net-tools -y + dnf update -y + systemctl enable --now httpd + echo "vm2" > /etc/hostname + hostname -F /etc/hostname + SHELL + end + + config.vm.define "vm3" do |vm3| + vm3.vm.network "private_network", ip: "192.168.56.4" + vm3.vm.box = "ubuntu/jammy64" + vm3.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + vm3.vm.provision "shell", inline: <<-SHELL + apt-get update && apt-get upgrade -y + apt-get install mc apache2 -y + apt-get clean + echo "vm3" > /etc/hostname + hostname -F /etc/hostname + SHELL + end + + config.vm.define "vm4" do |vm4| + vm4.vm.network "private_network", ip: "192.168.56.5" + vm4.vm.box = "debian/bullseye64" + vm4.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + vm4.vm.provision "shell", inline: <<-SHELL + apt-get update && apt-get upgrade -y + apt-get clean + apt-get install mc apache2 -y + echo "vm4" > /etc/hostname + hostname -F /etc/hostname + SHELL + end + end From 771749088fee47c206f406b13577d60f737e6185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 27 Jun 2023 19:30:43 +0200 Subject: [PATCH 08/41] v 3.0 --- changelog.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/changelog.md b/changelog.md index a6a13e4..bac118b 100644 --- a/changelog.md +++ b/changelog.md @@ -29,3 +29,77 @@ Vagrant.configure("2") do |config| end ``` Erről is írtam egy cikket [itt](https://msandor.hu/lepjunk-szintet-a-vagranttal/). + +## 3.0 +Egy nagy ugrással eljutottunk a 3.0-s Vagrantfile-hoz, hozzáadtam még 3 másik operációs rendszert is +Kommentek nélkül így néz ki: +```ruby +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.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + vm1.vm.provision "shell", inline: <<-SHELL + yum install mc epel-release httpd net-tools -y + yum update -y + systemctl enable --now httpd + echo "vm1" > /etc/hostname + hostname -F /etc/hostname + SHELL + end + + config.vm.define "vm2" do |vm2| + vm2.vm.network "private_network", ip: "192.168.56.3" + vm2.vm.box = "almalinux/8" + vm2.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + vm2.vm.provision "shell", inline: <<-SHELL + dnf install mc epel-release httpd net-tools -y + dnf update -y + systemctl enable --now httpd + echo "vm2" > /etc/hostname + hostname -F /etc/hostname + SHELL + end + + config.vm.define "vm3" do |vm3| + vm3.vm.network "private_network", ip: "192.168.56.4" + vm3.vm.box = "ubuntu/jammy64" + vm3.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + vm3.vm.provision "shell", inline: <<-SHELL + apt-get update && apt-get upgrade -y + apt-get install mc apache2 -y + apt-get clean + echo "vm3" > /etc/hostname + hostname -F /etc/hostname + SHELL + end + + config.vm.define "vm4" do |vm4| + vm4.vm.network "private_network", ip: "192.168.56.5" + vm4.vm.box = "debian/bullseye64" + vm4.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + vm4.vm.provision "shell", inline: <<-SHELL + apt-get update && apt-get upgrade -y + apt-get clean + apt-get install mc apache2 -y + echo "vm4" > /etc/hostname + hostname -F /etc/hostname + SHELL + end + +end +``` +Erről is írtam egy cikket [itt](https://msandor.hu/vagrant-jojjon-a-labor/). From 06a964dfb2783c0d93b349d710d9bc7a1fa02455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Tue, 27 Jun 2023 23:06:06 +0200 Subject: [PATCH 09/41] =?UTF-8?q?els=C5=91=20nekifut=C3=A1s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6faeb42..c3a6a0b 100644 --- a/README.md +++ b/README.md @@ -1 +1,4 @@ -## Feltöltés alatt... \ No newline at end of file +## Mit találsz ebben a publikus repóban? +Készítettem egy egyszerű ansible playbookot, ami 4 különböző operációs rendszerrel is kompatibilis. +A másik csavar, hogy a teszteléshez szükséges 4 virtuális gépet automatizálva hozom létre a Vagrant segítségével. +A Vagrantról írtam több cikket is a [honlapomon](https://msandor.hu/category/vagrant/). From 57ffbe0c2c0d91d7c26c7716237bd94b8162fe91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Wed, 28 Jun 2023 17:06:08 +0200 Subject: [PATCH 10/41] first upload --- ansible.cfg | 17 +++++++++++++++++ inventory/inventory.yml | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 ansible.cfg create mode 100644 inventory/inventory.yml diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..47ae8e4 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,17 @@ +[defaults] +host_key_checking = False +inventory = ./inventory/inventory.yml +log_path = log/ansible.log +timeout = 5 +deprecation_warnings = False +command_warnings = False +interpreter_python = auto_legacy_silent + +ansible_managed = This file is managed by Ansible, all changes will be lost! PLEASE DO NOT EDIT!%n + template: {file} + date: %Y.%m.%d. %H:%M:%S + user: {uid} + host: {host} + +[ssh_connection] +scp_if_ssh=True diff --git a/inventory/inventory.yml b/inventory/inventory.yml new file mode 100644 index 0000000..5b59a09 --- /dev/null +++ b/inventory/inventory.yml @@ -0,0 +1,21 @@ +--- +all: + hosts: + localhost: + children: + servers: + vars: + ansible_ssh_user: vagrant + hosts: + vm1: + ansible_host: 192.168.56.2 + ansible_ssh_private_key_file: .vagrant/machines/vm1/virtualbox/private_key + vm2: + ansible_host: 192.168.56.3 + ansible_ssh_private_key_file: .vagrant/machines/vm2/virtualbox/private_key + vm3: + ansible_host: 192.168.56.4 + ansible_ssh_private_key_file: .vagrant/machines/vm3/virtualbox/private_key + vm4: + ansible_host: 192.168.56.5 + ansible_ssh_private_key_file: .vagrant/machines/vm4/virtualbox/private_key From 7438bee704cd8841b9feaa76e427b4d32ac4973f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Wed, 28 Jun 2023 17:07:18 +0200 Subject: [PATCH 11/41] + log mappa --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 40dec64..4c04c22 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,4 @@ .vagrant/ # Log files (if you are creating logs in debug mode, uncomment this) -# *.log - +*.log From 49e028902e68025121a34baf401531531883522d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Wed, 28 Jun 2023 22:55:25 +0200 Subject: [PATCH 12/41] v 4.0 --- changelog.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/changelog.md b/changelog.md index bac118b..879f850 100644 --- a/changelog.md +++ b/changelog.md @@ -103,3 +103,11 @@ Vagrant.configure("2") do |config| end ``` Erről is írtam egy cikket [itt](https://msandor.hu/vagrant-jojjon-a-labor/). + +## 4.0 +Elkészült az első cikkem `Ansible` témában. +Csak az alapok, pár könnyen megérthető példával. +Létrehoztam a hozzá tartozó mappákat. +És a két legfontosabb fájlt (ansible.cfg, inventory.yml) feltöltöttem a legszükségesebb adatokkal. + +Erről írtam egy cikket [itt](https://msandor.hu/ansible-az-alapok-bemutatasa-egyszeru-peldakkal/). From 2a995fd4a8b39d990aa31d9c44efa2c652ebfa78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Thu, 29 Jun 2023 21:23:51 +0200 Subject: [PATCH 13/41] timeout 5 -> 60 --- ansible.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible.cfg b/ansible.cfg index 47ae8e4..a3adc21 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -2,7 +2,7 @@ host_key_checking = False inventory = ./inventory/inventory.yml log_path = log/ansible.log -timeout = 5 +timeout = 60 deprecation_warnings = False command_warnings = False interpreter_python = auto_legacy_silent From f56c899da5b9cac555437c04338b29780e6c088d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Thu, 29 Jun 2023 21:28:49 +0200 Subject: [PATCH 14/41] first upload --- inventory/group_vars/all.yml | 4 ++ playbook/install-zabbix-agent.yml | 66 +++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 inventory/group_vars/all.yml create mode 100644 playbook/install-zabbix-agent.yml diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml new file mode 100644 index 0000000..81100c4 --- /dev/null +++ b/inventory/group_vars/all.yml @@ -0,0 +1,4 @@ +ZBXSERVER: '192.168.5.250' +ZBXLOGFILESIZE: '50' +ZBXAGENTPORT: '10050' +ZBXLISTENIP: '0.0.0.0' diff --git a/playbook/install-zabbix-agent.yml b/playbook/install-zabbix-agent.yml new file mode 100644 index 0000000..a7b436d --- /dev/null +++ b/playbook/install-zabbix-agent.yml @@ -0,0 +1,66 @@ +--- +- hosts: all + become: true + tasks: + + - name: Zabbix Agent telepítése [Red Hat family] + yum: + name: zabbix-agent + state: latest + update_cache: yes + when: + - ansible_os_family == "RedHat" + + - name: Zabbix Agent telepítése [Debian family] + apt: + name: zabbix-agent + state: latest + update_cache: yes + when: + - ansible_os_family == "Debian" + + - name: Zabbix Agent konfigurálása [CentOS] + lineinfile: + path: '/etc/zabbix_agentd.conf' + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + state: present + backup: yes + with_items: + - {regexp: '^\s*#?\s*Server\s*=', line: 'Server={{ ZBXSERVER }}'} + - {regexp: '^\s*#?\s*Hostname\s*=', line: 'Hostname={{ inventory_hostname_short }}'} + - {regexp: '^\s*#?\s*LogFileSize\s*=', line: 'LogFileSize={{ ZBXLOGFILESIZE }}'} + - {regexp: '^\s*#?\s*ListenPort\s*=', line: 'ListenPort={{ ZBXAGENTPORT }}'} + - {regexp: '^\s*#?\s*ListenIP\s*=', line: 'ListenIP={{ ZBXLISTENIP }}'} + notify: + - restart zabbix-agent + when: + - ansible_distribution == "CentOS" + + - name: Zabbix Agent konfigurálása [Debian family] + lineinfile: + path: '/etc/zabbix/zabbix_agentd.conf' + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + state: present + backup: yes + with_items: + - {regexp: '^\s*#?\s*Server\s*=', line: 'Server={{ ZBXSERVER }}'} + - {regexp: '^\s*#?\s*Hostname\s*=', line: 'Hostname={{ inventory_hostname_short }}'} + - {regexp: '^\s*#?\s*LogFileSize\s*=', line: 'LogFileSize={{ ZBXLOGFILESIZE }}'} + - {regexp: '^\s*#?\s*ListenPort\s*=', line: 'ListenPort={{ ZBXAGENTPORT }}'} + - {regexp: '^\s*#?\s*ListenIP\s*=', line: 'ListenIP={{ ZBXLISTENIP }}'} + notify: + - restart zabbix-agent + when: + - ansible_os_family == "Debian" + + - name: Zabbix Agent engedélyezése és elindítása + service: + name: zabbix-agent + enabled: yes + state: started + + handlers: + - name: restart zabbix-agent + service: name=zabbix-agent state=restarted From 46add55de5943182a68a1070be18c964fbbb0771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Thu, 29 Jun 2023 21:35:10 +0200 Subject: [PATCH 15/41] v 5.0 --- changelog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changelog.md b/changelog.md index 879f850..e148a58 100644 --- a/changelog.md +++ b/changelog.md @@ -111,3 +111,10 @@ Létrehoztam a hozzá tartozó mappákat. És a két legfontosabb fájlt (ansible.cfg, inventory.yml) feltöltöttem a legszükségesebb adatokkal. Erről írtam egy cikket [itt](https://msandor.hu/ansible-az-alapok-bemutatasa-egyszeru-peldakkal/). + +## 5.0 +Elkészült a második cikkem `Ansible` témában. +Készítettem egy playbookot, ami a 4 vm-re feltelepíti a zabbix-agentet, valamint beállít 5 paramétert. +Ez két új fájlt jelent: playbook/install-zabbix-agent.yml, inventory/group_vars/all.yml + +Erről írtam egy cikket [itt](https://msandor.hu/ansible-irjunk-playbookot/). From fd12041df7739ac61cd47dc20152cd22b181a4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Fri, 30 Jun 2023 21:25:21 +0200 Subject: [PATCH 16/41] =?UTF-8?q?bugfix:=20nem=20futott=20r=C3=A1=20az=20A?= =?UTF-8?q?lmaLinuxra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playbook/install-zabbix-agent.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbook/install-zabbix-agent.yml b/playbook/install-zabbix-agent.yml index a7b436d..1caa282 100644 --- a/playbook/install-zabbix-agent.yml +++ b/playbook/install-zabbix-agent.yml @@ -19,7 +19,7 @@ when: - ansible_os_family == "Debian" - - name: Zabbix Agent konfigurálása [CentOS] + - name: Zabbix Agent konfigurálása [Red Hat family] lineinfile: path: '/etc/zabbix_agentd.conf' regexp: "{{ item.regexp }}" @@ -35,7 +35,7 @@ notify: - restart zabbix-agent when: - - ansible_distribution == "CentOS" + - ansible_os_family == "RedHat" - name: Zabbix Agent konfigurálása [Debian family] lineinfile: From 9f549c4076554431c9b0f2ce90517d3a00426c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sat, 1 Jul 2023 12:49:46 +0200 Subject: [PATCH 17/41] v 6.0 --- inventory/inventory.yml | 14 ++++++++ playbook/install-zabbix-agent.yml | 60 ++----------------------------- 2 files changed, 17 insertions(+), 57 deletions(-) diff --git a/inventory/inventory.yml b/inventory/inventory.yml index 5b59a09..8b02597 100644 --- a/inventory/inventory.yml +++ b/inventory/inventory.yml @@ -19,3 +19,17 @@ all: vm4: ansible_host: 192.168.56.5 ansible_ssh_private_key_file: .vagrant/machines/vm4/virtualbox/private_key + redhat: + vars: + ZBXDIR: '/etc' + ZBXLOGDIR: 'zabbix' + hosts: + vm1: + vm2: + debian: + vars: + ZBXDIR: '/etc/zabbix' + ZBXLOGDIR: 'zabbix-agent' + hosts: + vm3: + vm4: diff --git a/playbook/install-zabbix-agent.yml b/playbook/install-zabbix-agent.yml index 1caa282..9eb8ee4 100644 --- a/playbook/install-zabbix-agent.yml +++ b/playbook/install-zabbix-agent.yml @@ -3,63 +3,9 @@ become: true tasks: - - name: Zabbix Agent telepítése [Red Hat family] - yum: - name: zabbix-agent - state: latest - update_cache: yes - when: - - ansible_os_family == "RedHat" - - - name: Zabbix Agent telepítése [Debian family] - apt: - name: zabbix-agent - state: latest - update_cache: yes - when: - - ansible_os_family == "Debian" - - - name: Zabbix Agent konfigurálása [Red Hat family] - lineinfile: - path: '/etc/zabbix_agentd.conf' - regexp: "{{ item.regexp }}" - line: "{{ item.line }}" - state: present - backup: yes - with_items: - - {regexp: '^\s*#?\s*Server\s*=', line: 'Server={{ ZBXSERVER }}'} - - {regexp: '^\s*#?\s*Hostname\s*=', line: 'Hostname={{ inventory_hostname_short }}'} - - {regexp: '^\s*#?\s*LogFileSize\s*=', line: 'LogFileSize={{ ZBXLOGFILESIZE }}'} - - {regexp: '^\s*#?\s*ListenPort\s*=', line: 'ListenPort={{ ZBXAGENTPORT }}'} - - {regexp: '^\s*#?\s*ListenIP\s*=', line: 'ListenIP={{ ZBXLISTENIP }}'} - notify: - - restart zabbix-agent - when: - - ansible_os_family == "RedHat" - - - name: Zabbix Agent konfigurálása [Debian family] - lineinfile: - path: '/etc/zabbix/zabbix_agentd.conf' - regexp: "{{ item.regexp }}" - line: "{{ item.line }}" - state: present - backup: yes - with_items: - - {regexp: '^\s*#?\s*Server\s*=', line: 'Server={{ ZBXSERVER }}'} - - {regexp: '^\s*#?\s*Hostname\s*=', line: 'Hostname={{ inventory_hostname_short }}'} - - {regexp: '^\s*#?\s*LogFileSize\s*=', line: 'LogFileSize={{ ZBXLOGFILESIZE }}'} - - {regexp: '^\s*#?\s*ListenPort\s*=', line: 'ListenPort={{ ZBXAGENTPORT }}'} - - {regexp: '^\s*#?\s*ListenIP\s*=', line: 'ListenIP={{ ZBXLISTENIP }}'} - notify: - - restart zabbix-agent - when: - - ansible_os_family == "Debian" - - - name: Zabbix Agent engedélyezése és elindítása - service: - name: zabbix-agent - enabled: yes - state: started + - include: ~/git/ansible_vagrant/tasks/install-zabbix_agent.yml + - include: ~/git/ansible_vagrant/tasks/configure-zabbix_agent.yml + - include: ~/git/ansible_vagrant/tasks/service-zabbix_agent.yml handlers: - name: restart zabbix-agent From 16ab5250a159be0ed6c8f38b3ceb050924b84d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sat, 1 Jul 2023 12:50:13 +0200 Subject: [PATCH 18/41] first upload --- tasks/configure-zabbix_agent.yml | 6 ++++++ tasks/install-zabbix_agent.yml | 17 +++++++++++++++++ tasks/service-zabbix_agent.yml | 6 ++++++ templates/zabbix_agentd.conf.j2 | 12 ++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 tasks/configure-zabbix_agent.yml create mode 100644 tasks/install-zabbix_agent.yml create mode 100644 tasks/service-zabbix_agent.yml create mode 100644 templates/zabbix_agentd.conf.j2 diff --git a/tasks/configure-zabbix_agent.yml b/tasks/configure-zabbix_agent.yml new file mode 100644 index 0000000..ad80ddb --- /dev/null +++ b/tasks/configure-zabbix_agent.yml @@ -0,0 +1,6 @@ +--- +- name: Zabbix Agent konfigurálása + diff: yes + template: src=~/git/ansible_vagrant/templates/zabbix_agentd.conf.j2 dest={{ ZBXDIR }}/zabbix_agentd.conf backup=yes + notify: + - restart zabbix-agent diff --git a/tasks/install-zabbix_agent.yml b/tasks/install-zabbix_agent.yml new file mode 100644 index 0000000..2a413f2 --- /dev/null +++ b/tasks/install-zabbix_agent.yml @@ -0,0 +1,17 @@ +--- +- name: Zabbix Agent telepítése [Red Hat family] + yum: + name: zabbix-agent + state: latest + update_cache: yes + when: + - ansible_os_family == "RedHat" + +- name: Zabbix Agent telepítése [Debian family] + apt: + name: zabbix-agent + state: latest + update_cache: yes + when: + - ansible_os_family == "Debian" + diff --git a/tasks/service-zabbix_agent.yml b/tasks/service-zabbix_agent.yml new file mode 100644 index 0000000..fff3917 --- /dev/null +++ b/tasks/service-zabbix_agent.yml @@ -0,0 +1,6 @@ +--- +- name: Zabbix Agent engedélyezése és elindítása + service: + name: zabbix-agent + enabled: yes + state: started diff --git a/templates/zabbix_agentd.conf.j2 b/templates/zabbix_agentd.conf.j2 new file mode 100644 index 0000000..917c910 --- /dev/null +++ b/templates/zabbix_agentd.conf.j2 @@ -0,0 +1,12 @@ +################################################################################ +{{ ansible_managed | comment }} +################################################################################ + +PidFile=/run/zabbix/zabbix_agentd.pid +LogFile=/var/log/{{ ZBXLOGDIR }}/zabbix_agentd.log +LogFileSize={{ ZBXLOGFILESIZE }} +Server={{ ZBXSERVER }} +ListenPort={{ ZBXAGENTPORT }} +ListenIP={{ ZBXLISTENIP }} +ServerActive=127.0.0.1 +Hostname={{ inventory_hostname_short}} From 2ddf5340b79b464e7a42641db20770ce4a941ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Fri, 28 Jul 2023 19:50:18 +0200 Subject: [PATCH 19/41] V6.0 --- README.md | 3 ++- changelog.md | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c3a6a0b..fc63669 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ## Mit találsz ebben a publikus repóban? -Készítettem egy egyszerű ansible playbookot, ami 4 különböző operációs rendszerrel is kompatibilis. +Készítettem egy egyszerű ansible playbookot, ami 4 különböző operációs rendszerrel (CentOS 7, Alma Linux 8, Ubuntu 22.04, Debian 11) is kompatibilis. A másik csavar, hogy a teszteléshez szükséges 4 virtuális gépet automatizálva hozom létre a Vagrant segítségével. A Vagrantról írtam több cikket is a [honlapomon](https://msandor.hu/category/vagrant/). +A playbook feltelepíti és bekonfigurálja a zabbix-agent-eket. diff --git a/changelog.md b/changelog.md index e148a58..527d734 100644 --- a/changelog.md +++ b/changelog.md @@ -118,3 +118,9 @@ Készítettem egy playbookot, ami a 4 vm-re feltelepíti a zabbix-agentet, valam Ez két új fájlt jelent: playbook/install-zabbix-agent.yml, inventory/group_vars/all.yml Erről írtam egy cikket [itt](https://msandor.hu/ansible-irjunk-playbookot/). + +## 6.0 +Elkészült a harmadik cikkem `Ansible` témában. +Eljutottunk a playbook egy szebb formájához, könnyebb átlátni, bővíteni a jövőben. + +Erről írtam egy cikket [itt](https://msandor.hu/ansible-mire-jo-a-template//). From 8ca7f03b24954a70f72977a38dbdad8bc9ef7a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Fri, 28 Jul 2023 21:34:41 +0200 Subject: [PATCH 20/41] =?UTF-8?q?ZBXSERVERIP=20=C3=A1t=C3=A1ll=C3=ADt?= =?UTF-8?q?=C3=A1sa=20a=20dem=C3=B3=20k=C3=B6rnyezetre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory/group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index 81100c4..7110f23 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -1,4 +1,4 @@ -ZBXSERVER: '192.168.5.250' +ZBXSERVER: '192.168.56.7' ZBXLOGFILESIZE: '50' ZBXAGENTPORT: '10050' ZBXLISTENIP: '0.0.0.0' From f134f0c307f77b37d53b9cd74024d3d7c70a0951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sat, 29 Jul 2023 09:53:48 +0200 Subject: [PATCH 21/41] =?UTF-8?q?cs=C3=B6kken=C5=91=20sorrendbe=20=C3=A1ll?= =?UTF-8?q?=C3=ADt=C3=A1s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 99 ++++++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/changelog.md b/changelog.md index 527d734..23f0ec8 100644 --- a/changelog.md +++ b/changelog.md @@ -1,37 +1,35 @@ # CHANGELOG -## 1.0 -Elkészült az első Vagrantfile, benne a kötelező 3 sorral, egy CentOS 7 OS-t indítva. -Kommentek nélkül így néz ki: -```ruby -Vagrant.configure("2") do |config| - config.vm.box = "centos/7" -end -``` -Erről írtam egy cikket [itt](https://msandor.hu/vagrant-teszt-kornyezet-villamgyorsan/). +## 6.0 +Elkészült a harmadik cikkem `Ansible` témában. -## 2.0 -Több lépésben jutottunk el a 2.0-s Vagrantfile-hoz, bővült az erőforrás (cpu, mem), kapott dedikált hálókártyát, és telepítéskor lefuttat pár parancsot is. -Kommentek nélkül így néz ki: -```ruby -Vagrant.configure("2") do |config| - config.vm.box = "centos/7" - config.vm.network "private_network", ip: "192.168.56.2" - config.vm.provider "virtualbox" do |vb| - vb.memory = "1024" - vb.cpus = 2 - end - config.vm.provision "shell", inline: <<-SHELL - yum install mc epel-release httpd net-tools -y - yum update -y --skip-broken - systemctl enable --now httpd - SHELL -end -``` -Erről is írtam egy cikket [itt](https://msandor.hu/lepjunk-szintet-a-vagranttal/). +Eljutottunk a playbook egy szebb formájához, könnyebb átlátni, bővíteni a jövőben. + +Erről írtam egy cikket [itt](https://msandor.hu/ansible-mire-jo-a-template//). + +## 5.0 +Elkészült a második cikkem `Ansible` témában. + +Készítettem egy playbookot, ami a 4 vm-re feltelepíti a zabbix-agentet, valamint beállít 5 paramétert. + +Ez két új fájlt jelent: playbook/install-zabbix-agent.yml, inventory/group_vars/all.yml + +Erről írtam egy cikket [itt](https://msandor.hu/ansible-irjunk-playbookot/). + +## 4.0 +Elkészült az első cikkem `Ansible` témában. + +Csak az alapok, pár könnyen megérthető példával. + +Létrehoztam a hozzá tartozó mappákat. + +És a két legfontosabb fájlt (ansible.cfg, inventory.yml) feltöltöttem a legszükségesebb adatokkal. + +Erről írtam egy cikket [itt](https://msandor.hu/ansible-az-alapok-bemutatasa-egyszeru-peldakkal/). ## 3.0 Egy nagy ugrással eljutottunk a 3.0-s Vagrantfile-hoz, hozzáadtam még 3 másik operációs rendszert is + Kommentek nélkül így néz ki: ```ruby Vagrant.configure("2") do |config| @@ -104,23 +102,34 @@ end ``` Erről is írtam egy cikket [itt](https://msandor.hu/vagrant-jojjon-a-labor/). -## 4.0 -Elkészült az első cikkem `Ansible` témában. -Csak az alapok, pár könnyen megérthető példával. -Létrehoztam a hozzá tartozó mappákat. -És a két legfontosabb fájlt (ansible.cfg, inventory.yml) feltöltöttem a legszükségesebb adatokkal. +## 2.0 +Több lépésben jutottunk el a 2.0-s Vagrantfile-hoz, bővült az erőforrás (cpu, mem), kapott dedikált hálókártyát, és telepítéskor lefuttat pár parancsot is. -Erről írtam egy cikket [itt](https://msandor.hu/ansible-az-alapok-bemutatasa-egyszeru-peldakkal/). +Kommentek nélkül így néz ki: +```ruby +Vagrant.configure("2") do |config| + config.vm.box = "centos/7" + config.vm.network "private_network", ip: "192.168.56.2" + config.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.cpus = 2 + end + config.vm.provision "shell", inline: <<-SHELL + yum install mc epel-release httpd net-tools -y + yum update -y --skip-broken + systemctl enable --now httpd + SHELL +end +``` +Erről is írtam egy cikket [itt](https://msandor.hu/lepjunk-szintet-a-vagranttal/). -## 5.0 -Elkészült a második cikkem `Ansible` témában. -Készítettem egy playbookot, ami a 4 vm-re feltelepíti a zabbix-agentet, valamint beállít 5 paramétert. -Ez két új fájlt jelent: playbook/install-zabbix-agent.yml, inventory/group_vars/all.yml +## 1.0 +Elkészült az első Vagrantfile, benne a kötelező 3 sorral, egy CentOS 7 OS-t indítva. -Erről írtam egy cikket [itt](https://msandor.hu/ansible-irjunk-playbookot/). - -## 6.0 -Elkészült a harmadik cikkem `Ansible` témában. -Eljutottunk a playbook egy szebb formájához, könnyebb átlátni, bővíteni a jövőben. - -Erről írtam egy cikket [itt](https://msandor.hu/ansible-mire-jo-a-template//). +Kommentek nélkül így néz ki: +```ruby +Vagrant.configure("2") do |config| + config.vm.box = "centos/7" +end +``` +Erről írtam egy cikket [itt](https://msandor.hu/vagrant-teszt-kornyezet-villamgyorsan/). From 8cf2a98c675e472bbfe9c82d957ba78b60b320a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sat, 29 Jul 2023 09:58:01 +0200 Subject: [PATCH 22/41] V7.0 --- changelog.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 23f0ec8..1e6fd3f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,11 +1,19 @@ # CHANGELOG +## 7.0 +Elkészült az első két cikkem `zabbix-server` témában. + +A létrehozott demó környezetnek más lett a zabbix-server IP címe, így azt az egy paramétert megváltoztattam az inventory/group_vars/all.yml fájlvan: +192.168.5.250 --> 192.168.56.7 + +Erről írtam két cikket [itt 1.](https://msandor.hu/zabbix-szerver-az-alapok/) és [itt. 2.](https://msandor.hu/zabbix-server-meruljunk-el-az-agent-beallitasokba/). + ## 6.0 Elkészült a harmadik cikkem `Ansible` témában. Eljutottunk a playbook egy szebb formájához, könnyebb átlátni, bővíteni a jövőben. -Erről írtam egy cikket [itt](https://msandor.hu/ansible-mire-jo-a-template//). +Erről írtam egy cikket [itt](https://msandor.hu/ansible-mire-jo-a-template/). ## 5.0 Elkészült a második cikkem `Ansible` témában. From 12e7ac94b97131d09fcbafd68ee8622d0200ddec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sat, 29 Jul 2023 09:59:24 +0200 Subject: [PATCH 23/41] =?UTF-8?q?+=20kiemel=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 1e6fd3f..6234da3 100644 --- a/changelog.md +++ b/changelog.md @@ -4,7 +4,7 @@ Elkészült az első két cikkem `zabbix-server` témában. A létrehozott demó környezetnek más lett a zabbix-server IP címe, így azt az egy paramétert megváltoztattam az inventory/group_vars/all.yml fájlvan: -192.168.5.250 --> 192.168.56.7 +`192.168.5.250 --> 192.168.56.7` Erről írtam két cikket [itt 1.](https://msandor.hu/zabbix-szerver-az-alapok/) és [itt. 2.](https://msandor.hu/zabbix-server-meruljunk-el-az-agent-beallitasokba/). From 32b96dec9ac3b30ac16b0e14d704581063f57efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sat, 29 Jul 2023 09:59:59 +0200 Subject: [PATCH 24/41] - felesleges . --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 6234da3..be5fe37 100644 --- a/changelog.md +++ b/changelog.md @@ -6,7 +6,7 @@ Elkészült az első két cikkem `zabbix-server` témában. A létrehozott demó környezetnek más lett a zabbix-server IP címe, így azt az egy paramétert megváltoztattam az inventory/group_vars/all.yml fájlvan: `192.168.5.250 --> 192.168.56.7` -Erről írtam két cikket [itt 1.](https://msandor.hu/zabbix-szerver-az-alapok/) és [itt. 2.](https://msandor.hu/zabbix-server-meruljunk-el-az-agent-beallitasokba/). +Erről írtam két cikket [itt 1.](https://msandor.hu/zabbix-szerver-az-alapok/) és [itt 2.](https://msandor.hu/zabbix-server-meruljunk-el-az-agent-beallitasokba/). ## 6.0 Elkészült a harmadik cikkem `Ansible` témában. From a08192d0f696f9b18a22e7b167fa4d8ace5b4506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sat, 29 Jul 2023 13:51:00 +0200 Subject: [PATCH 25/41] =?UTF-8?q?+=20PSK=20be=C3=A1ll=C3=ADt=C3=A1sok=20az?= =?UTF-8?q?=20agenthez?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory/inventory.yml | 4 ++++ tasks/configure-zabbix_agent.yml | 6 ++++++ templates/zabbix_agentd.conf.j2 | 7 +++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/inventory/inventory.yml b/inventory/inventory.yml index 8b02597..39125e5 100644 --- a/inventory/inventory.yml +++ b/inventory/inventory.yml @@ -10,15 +10,19 @@ all: vm1: ansible_host: 192.168.56.2 ansible_ssh_private_key_file: .vagrant/machines/vm1/virtualbox/private_key + psk_key: 00fcb3f04e646dd9186717bb43f96aa829d01d497ea31254ca72a1ebe568aa96 vm2: ansible_host: 192.168.56.3 ansible_ssh_private_key_file: .vagrant/machines/vm2/virtualbox/private_key + psk_key: 2009df4793fbd2f4afd351b825e43e4a2463524fd64fd08c27c9e353f085c94f vm3: ansible_host: 192.168.56.4 ansible_ssh_private_key_file: .vagrant/machines/vm3/virtualbox/private_key + psk_key: 182e39bb63953f682347f717359a24621556d83516c54fff00e86dd8e9d89b45 vm4: ansible_host: 192.168.56.5 ansible_ssh_private_key_file: .vagrant/machines/vm4/virtualbox/private_key + psk_key: d8f5c88673de18afdde646ed3590fbe36d2951b9cfe8fac56e8b722115e791ee redhat: vars: ZBXDIR: '/etc' diff --git a/tasks/configure-zabbix_agent.yml b/tasks/configure-zabbix_agent.yml index ad80ddb..2b105ee 100644 --- a/tasks/configure-zabbix_agent.yml +++ b/tasks/configure-zabbix_agent.yml @@ -4,3 +4,9 @@ template: src=~/git/ansible_vagrant/templates/zabbix_agentd.conf.j2 dest={{ ZBXDIR }}/zabbix_agentd.conf backup=yes notify: - restart zabbix-agent + +- name: Zabbix Agent PSK fájl létrehozása + diff: yes + template: src=~/git/ansible_vagrant/templates/zabbix.psk.j2 dest={{ ZBXDIR }}/zabbix.psk backup=yes owner=zabbix group=zabbix mode=0640 + notify: + - restart zabbix-agent diff --git a/templates/zabbix_agentd.conf.j2 b/templates/zabbix_agentd.conf.j2 index 917c910..5aa2396 100644 --- a/templates/zabbix_agentd.conf.j2 +++ b/templates/zabbix_agentd.conf.j2 @@ -8,5 +8,8 @@ LogFileSize={{ ZBXLOGFILESIZE }} Server={{ ZBXSERVER }} ListenPort={{ ZBXAGENTPORT }} ListenIP={{ ZBXLISTENIP }} -ServerActive=127.0.0.1 -Hostname={{ inventory_hostname_short}} +Hostname={{ inventory_hostname_short }} +TLSConnect=psk +TLSAccept=psk +TLSPSKFile={{ ZBXDIR }}/zabbix.psk +TLSPSKIdentity={{ inventory_hostname_short }} From 8139391cf0694b0c1a1c1e5b9c9d6015b1d9bd26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sat, 29 Jul 2023 13:51:33 +0200 Subject: [PATCH 26/41] first upload --- templates/zabbix.psk.j2 | 1 + 1 file changed, 1 insertion(+) create mode 100644 templates/zabbix.psk.j2 diff --git a/templates/zabbix.psk.j2 b/templates/zabbix.psk.j2 new file mode 100644 index 0000000..16246d6 --- /dev/null +++ b/templates/zabbix.psk.j2 @@ -0,0 +1 @@ +{{ psk_key }} From 3def0645ab43d3b1a296e4e1f32c92d1f1571aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sat, 29 Jul 2023 13:52:51 +0200 Subject: [PATCH 27/41] add PSK comment --- changelog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index be5fe37..5946db5 100644 --- a/changelog.md +++ b/changelog.md @@ -6,7 +6,9 @@ Elkészült az első két cikkem `zabbix-server` témában. A létrehozott demó környezetnek más lett a zabbix-server IP címe, így azt az egy paramétert megváltoztattam az inventory/group_vars/all.yml fájlvan: `192.168.5.250 --> 192.168.56.7` -Erről írtam két cikket [itt 1.](https://msandor.hu/zabbix-szerver-az-alapok/) és [itt 2.](https://msandor.hu/zabbix-server-meruljunk-el-az-agent-beallitasokba/). +Valamint megkapta a titkosított kommunikációhoz (`PSK`) szükséges bővítéseket. + +Erről írtam két cikket [itt 1.](https://msandor.hu/zabbix-szerver-az-alapok/) és [itt 2.](https://msandor.hu/zabbix-server-meruljunk-el-az-agent-beallitasokban/). ## 6.0 Elkészült a harmadik cikkem `Ansible` témában. From f44b9127d810afe40a41b78e282bf4b167001773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 18:49:56 +0200 Subject: [PATCH 28/41] vcpu 2 -> 1 --- Vagrantfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 356d932..337d944 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,7 +5,7 @@ Vagrant.configure("2") do |config| vm1.vm.box = "centos/7" vm1.vm.provider "virtualbox" do |vb| vb.memory = "1024" - vb.cpus = 2 + vb.cpus = 1 end vm1.vm.provision "shell", inline: <<-SHELL yum install mc epel-release httpd net-tools -y @@ -21,7 +21,7 @@ Vagrant.configure("2") do |config| vm2.vm.box = "almalinux/8" vm2.vm.provider "virtualbox" do |vb| vb.memory = "1024" - vb.cpus = 2 + vb.cpus = 1 end vm2.vm.provision "shell", inline: <<-SHELL dnf install mc epel-release httpd net-tools -y @@ -37,7 +37,7 @@ Vagrant.configure("2") do |config| vm3.vm.box = "ubuntu/jammy64" vm3.vm.provider "virtualbox" do |vb| vb.memory = "1024" - vb.cpus = 2 + vb.cpus = 1 end vm3.vm.provision "shell", inline: <<-SHELL apt-get update && apt-get upgrade -y @@ -53,7 +53,7 @@ Vagrant.configure("2") do |config| vm4.vm.box = "debian/bullseye64" vm4.vm.provider "virtualbox" do |vb| vb.memory = "1024" - vb.cpus = 2 + vb.cpus = 1 end vm4.vm.provision "shell", inline: <<-SHELL apt-get update && apt-get upgrade -y From 2575922a0145e9026f2db7552c0a1245e8051b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 18:50:23 +0200 Subject: [PATCH 29/41] delete ZBXDIR --- inventory/inventory.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/inventory/inventory.yml b/inventory/inventory.yml index 39125e5..2ca11fa 100644 --- a/inventory/inventory.yml +++ b/inventory/inventory.yml @@ -25,14 +25,12 @@ all: psk_key: d8f5c88673de18afdde646ed3590fbe36d2951b9cfe8fac56e8b722115e791ee redhat: vars: - ZBXDIR: '/etc' ZBXLOGDIR: 'zabbix' hosts: vm1: vm2: debian: vars: - ZBXDIR: '/etc/zabbix' ZBXLOGDIR: 'zabbix-agent' hosts: vm3: From c49d41715de02d27e40202601c18039a65b47478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 18:50:52 +0200 Subject: [PATCH 30/41] delete ZBXDIR --- tasks/configure-zabbix_agent.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/configure-zabbix_agent.yml b/tasks/configure-zabbix_agent.yml index 2b105ee..8bf36d8 100644 --- a/tasks/configure-zabbix_agent.yml +++ b/tasks/configure-zabbix_agent.yml @@ -1,12 +1,12 @@ --- - name: Zabbix Agent konfigurálása diff: yes - template: src=~/git/ansible_vagrant/templates/zabbix_agentd.conf.j2 dest={{ ZBXDIR }}/zabbix_agentd.conf backup=yes + template: src=~/git/ansible_vagrant/templates/zabbix_agentd.conf.j2 dest=/etc/zabbix/zabbix_agentd.conf backup=yes notify: - restart zabbix-agent - name: Zabbix Agent PSK fájl létrehozása diff: yes - template: src=~/git/ansible_vagrant/templates/zabbix.psk.j2 dest={{ ZBXDIR }}/zabbix.psk backup=yes owner=zabbix group=zabbix mode=0640 + template: src=~/git/ansible_vagrant/templates/zabbix.psk.j2 dest=/etc/zabbix/zabbix.psk backup=yes owner=zabbix group=zabbix mode=0640 notify: - restart zabbix-agent From 44d0cf8c60ac9953d167d242c5171128c8720b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 18:51:07 +0200 Subject: [PATCH 31/41] delete ZBXDIR --- templates/zabbix_agentd.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zabbix_agentd.conf.j2 b/templates/zabbix_agentd.conf.j2 index 5aa2396..c0df8a0 100644 --- a/templates/zabbix_agentd.conf.j2 +++ b/templates/zabbix_agentd.conf.j2 @@ -11,5 +11,5 @@ ListenIP={{ ZBXLISTENIP }} Hostname={{ inventory_hostname_short }} TLSConnect=psk TLSAccept=psk -TLSPSKFile={{ ZBXDIR }}/zabbix.psk +TLSPSKFile=/etc/zabbix/zabbix.psk TLSPSKIdentity={{ inventory_hostname_short }} From 9f0584db5928b22219aee088cc33d408376d8663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 18:52:30 +0200 Subject: [PATCH 32/41] add install-zabbix-repo.yml --- playbook/install-zabbix-agent.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbook/install-zabbix-agent.yml b/playbook/install-zabbix-agent.yml index 9eb8ee4..ec8102e 100644 --- a/playbook/install-zabbix-agent.yml +++ b/playbook/install-zabbix-agent.yml @@ -3,6 +3,7 @@ become: true tasks: + - include: ~/git/ansible_vagrant/tasks/install-zabbix-repo.yml - include: ~/git/ansible_vagrant/tasks/install-zabbix_agent.yml - include: ~/git/ansible_vagrant/tasks/configure-zabbix_agent.yml - include: ~/git/ansible_vagrant/tasks/service-zabbix_agent.yml From f3f19d06f70b71d4086232d2ed9e18bd7fb9f556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 18:53:06 +0200 Subject: [PATCH 33/41] =?UTF-8?q?=C3=BCres=20sor=20t=C3=B6r=C3=B6lve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/install-zabbix_agent.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/install-zabbix_agent.yml b/tasks/install-zabbix_agent.yml index 2a413f2..9424735 100644 --- a/tasks/install-zabbix_agent.yml +++ b/tasks/install-zabbix_agent.yml @@ -14,4 +14,3 @@ update_cache: yes when: - ansible_os_family == "Debian" - From 4d0c45f6c2a6451e0d8b2810f4ab6726fe620f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 18:53:23 +0200 Subject: [PATCH 34/41] first upload --- tasks/install-zabbix-repo.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tasks/install-zabbix-repo.yml diff --git a/tasks/install-zabbix-repo.yml b/tasks/install-zabbix-repo.yml new file mode 100644 index 0000000..2f56dbe --- /dev/null +++ b/tasks/install-zabbix-repo.yml @@ -0,0 +1,23 @@ +--- +- name: Zabbix repó hozzáadása [Red Hat family] + yum: + name: https://repo.zabbix.com/zabbix/6.4/rhel/{{ ansible_distribution_major_version }}/x86_64/zabbix-release-6.4-1.el{{ ansible_distribution_major_version }}.noarch.rpm + state: present + disable_gpg_check: yes + validate_certs: no + when: + - ansible_os_family == "RedHat" + +- name: Zabbix repó hozzáadása [Debian] + apt: + deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian{{ ansible_distribution_version }}_all.deb + state: present + when: + - ansible_distribution == "Debian" + +- name: Zabbix repó hozzáadása [Ubuntu] + apt: + deb: https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu{{ ansible_distribution_version }}_all.deb + state: present + when: + - ansible_distribution == "Ubuntu" From 30b629ea532779f5ac98577f0a0da5af39b1ef90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 19:20:45 +0200 Subject: [PATCH 35/41] delete ZBXLOGDIR --- inventory/inventory.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/inventory/inventory.yml b/inventory/inventory.yml index 2ca11fa..a7dc547 100644 --- a/inventory/inventory.yml +++ b/inventory/inventory.yml @@ -23,15 +23,3 @@ all: ansible_host: 192.168.56.5 ansible_ssh_private_key_file: .vagrant/machines/vm4/virtualbox/private_key psk_key: d8f5c88673de18afdde646ed3590fbe36d2951b9cfe8fac56e8b722115e791ee - redhat: - vars: - ZBXLOGDIR: 'zabbix' - hosts: - vm1: - vm2: - debian: - vars: - ZBXLOGDIR: 'zabbix-agent' - hosts: - vm3: - vm4: From f482ff085db0d6a9ddea969f172df2110a5bf831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 19:21:02 +0200 Subject: [PATCH 36/41] delete ZBXLOGDIR --- templates/zabbix_agentd.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zabbix_agentd.conf.j2 b/templates/zabbix_agentd.conf.j2 index c0df8a0..005f190 100644 --- a/templates/zabbix_agentd.conf.j2 +++ b/templates/zabbix_agentd.conf.j2 @@ -3,7 +3,7 @@ ################################################################################ PidFile=/run/zabbix/zabbix_agentd.pid -LogFile=/var/log/{{ ZBXLOGDIR }}/zabbix_agentd.log +LogFile=/var/log/zabbix/zabbix_agentd.log LogFileSize={{ ZBXLOGFILESIZE }} Server={{ ZBXSERVER }} ListenPort={{ ZBXAGENTPORT }} From 159905623dadb18456e1cd51b0e88b19a188803b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 21:26:21 +0200 Subject: [PATCH 37/41] memory 1024 -> 512 --- Vagrantfile | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 337d944..3c73ae5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,7 +4,7 @@ Vagrant.configure("2") do |config| vm1.vm.network "private_network", ip: "192.168.56.2" vm1.vm.box = "centos/7" vm1.vm.provider "virtualbox" do |vb| - vb.memory = "1024" + vb.memory = "512" vb.cpus = 1 end vm1.vm.provision "shell", inline: <<-SHELL @@ -20,7 +20,7 @@ Vagrant.configure("2") do |config| vm2.vm.network "private_network", ip: "192.168.56.3" vm2.vm.box = "almalinux/8" vm2.vm.provider "virtualbox" do |vb| - vb.memory = "1024" + vb.memory = "512" vb.cpus = 1 end vm2.vm.provision "shell", inline: <<-SHELL @@ -36,7 +36,7 @@ Vagrant.configure("2") do |config| vm3.vm.network "private_network", ip: "192.168.56.4" vm3.vm.box = "ubuntu/jammy64" vm3.vm.provider "virtualbox" do |vb| - vb.memory = "1024" + vb.memory = "512" vb.cpus = 1 end vm3.vm.provision "shell", inline: <<-SHELL @@ -52,7 +52,7 @@ Vagrant.configure("2") do |config| vm4.vm.network "private_network", ip: "192.168.56.5" vm4.vm.box = "debian/bullseye64" vm4.vm.provider "virtualbox" do |vb| - vb.memory = "1024" + vb.memory = "512" vb.cpus = 1 end vm4.vm.provision "shell", inline: <<-SHELL @@ -64,4 +64,20 @@ Vagrant.configure("2") do |config| SHELL end + config.vm.define "zbxsrv" do |zbxsrv| + zbxsrv.vm.network "private_network", ip: "192.168.56.6" + zbxsrv.vm.box = "centos/7" + zbxsrv.vm.provider "virtualbox" do |vb| + vb.memory = "512" + vb.cpus = 1 + end + zbxsrv.vm.provision "shell", inline: <<-SHELL + yum install mc epel-release httpd net-tools -y + yum update -y + systemctl enable --now httpd + echo "zbxsrv" > /etc/hostname + hostname -F /etc/hostname + SHELL + end + end From c8197036e14dd2340fcb4e92d773ab7d9ed6acd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 21:26:50 +0200 Subject: [PATCH 38/41] v8.0 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fc63669..b4c193a 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ Készítettem egy egyszerű ansible playbookot, ami 4 különböző operációs A másik csavar, hogy a teszteléshez szükséges 4 virtuális gépet automatizálva hozom létre a Vagrant segítségével. A Vagrantról írtam több cikket is a [honlapomon](https://msandor.hu/category/vagrant/). A playbook feltelepíti és bekonfigurálja a zabbix-agent-eket. + +A frissített verzió már egy `zbxsrv` nevű szervert is létrehoz, egyelőre még kézzel kell rá feltelepíteni a dockert és a zabbix-serverhez szükséges docker-compose.yml-t. From af49e8b722534c68bf50e19c32f5dc09a3a9c6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 21:27:01 +0200 Subject: [PATCH 39/41] v8.0 --- changelog.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/changelog.md b/changelog.md index 5946db5..61d0799 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,14 @@ # CHANGELOG +## 8.0 +Történt némi átalakítás: + * a hivatalos zabbix repóból telepítem fel az agenteket + * ennek köszönhetően már nem kell bizonyos változókat (ZBXDIR, ZBXLOGDIR) külön kezelni inventory szinten + * a zabbix-servernek létrehoztam egy dedikált szervert (zbxsrv) + * mivel végesek a laptopom erőforrásai, és az agenteken kívül csak egy apache webszerver fut a demó szervereken (még az első lecke miatt), ezért megfeleztem a VCPU és memória értékeket + +Erről írtam egy cikket [itt]() + ## 7.0 Elkészült az első két cikkem `zabbix-server` témában. From 13e0676fddfa4e567353043cc8fa640c80f6dba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 21:27:36 +0200 Subject: [PATCH 40/41] add zbxsrv vars --- inventory/inventory.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inventory/inventory.yml b/inventory/inventory.yml index a7dc547..296f4bc 100644 --- a/inventory/inventory.yml +++ b/inventory/inventory.yml @@ -23,3 +23,9 @@ all: ansible_host: 192.168.56.5 ansible_ssh_private_key_file: .vagrant/machines/vm4/virtualbox/private_key psk_key: d8f5c88673de18afdde646ed3590fbe36d2951b9cfe8fac56e8b722115e791ee + zbxsrv: + ansible_host: 192.168.56.6 + ansible_ssh_private_key_file: .vagrant/machines/zbxsrv/virtualbox/private_key + psk_key: 2d0d1ed6caf68a65088ff9e8f04c07c274ddf636293dcaf852da7383d0b92e29 + ZBXLISTENIP: 172.17.0.1 + ZBXSERVER: 192.168.151.2 From f248b0a07cf52f85848ec4d47b30de348526f5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rkus=20S=C3=A1ndor?= Date: Sun, 30 Jul 2023 21:28:11 +0200 Subject: [PATCH 41/41] ZBXSERVER 192.168.56.7 -> 192.168.56.6 --- inventory/group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index 7110f23..25a2072 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -1,4 +1,4 @@ -ZBXSERVER: '192.168.56.7' +ZBXSERVER: '192.168.56.6' ZBXLOGFILESIZE: '50' ZBXAGENTPORT: '10050' ZBXLISTENIP: '0.0.0.0'