From 01fb2314376db7a4bea4aa0a0dd2a6c9a5cdd1c5 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Mon, 8 Jan 2024 23:01:43 +0100 Subject: [PATCH] Vagrant definition for manual tests --- client/CHANGELOG.md | 2 ++ client/Vagrantfile | 49 +++++++++++++++++++++++++++++ client/vagrant.yml | 76 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 client/Vagrantfile create mode 100644 client/vagrant.yml diff --git a/client/CHANGELOG.md b/client/CHANGELOG.md index 43cd327..1e112a7 100644 --- a/client/CHANGELOG.md +++ b/client/CHANGELOG.md @@ -13,6 +13,8 @@ The **patch** part changes is incremented if multiple releases happen the same m ### Added +* Vagrant definition for manual tests + ### Changed * split functions into libraries diff --git a/client/Vagrantfile b/client/Vagrantfile new file mode 100644 index 0000000..de3337a --- /dev/null +++ b/client/Vagrantfile @@ -0,0 +1,49 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Load ~/.VagrantFile if exist, permit local config provider +vagrantfile = File.join(Dir.home, ".VagrantFile") +load File.expand_path(vagrantfile) if File.exist?(vagrantfile) + +Vagrant.configure("2") do |config| + # Run "vagrant rsync-auto" to sync after each change + config.vm.synced_folder ".", "/vagrant", type: "rsync", disabled: true + config.vm.synced_folder "bin", "/usr/local/bin", type: "rsync" + config.vm.synced_folder "lib", "/usr/local/lib/evobackup", type: "rsync" + + config.ssh.shell = "/bin/sh" + + config.vm.provider :libvirt do |libvirt| + # libvirt.storage :file, :size => '10G', :device => 'vdb' + libvirt.memory = 1024 + libvirt.cpus = 1 + end + + config_script = <<~SCRIPT + set -e + sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/; s/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \ + echo 'LANG="fr_FR.UTF-8"'>/etc/default/locale && \ + dpkg-reconfigure --frontend=noninteractive locales && \ + update-locale LANG=fr_FR.UTF-8 + exit 0 + SCRIPT + + [ + {version: "buster"}, + {version: "bullseye"}, + {version: "bookworm"} + ].each do |i| + config.vm.define(i[:version].to_s) do |node| + node.vm.hostname = "evobackup-#{i[:version]}" + node.vm.box = "debian/#{i[:version]}64" + + node.vm.provision "config", type: "shell", inline: config_script + + node.vm.provision :ansible do |ansible| + ansible.playbook = "vagrant.yml" + end + + end + end + +end diff --git a/client/vagrant.yml b/client/vagrant.yml new file mode 100644 index 0000000..39647a5 --- /dev/null +++ b/client/vagrant.yml @@ -0,0 +1,76 @@ +# To be used through "vagrant up" or "vagrant provision". +--- +- hosts: bookworm,bullseye,buster + gather_facts: yes + become: yes + + vars_files: + - '~/GIT/evolix-private/vars/evolinux-secrets.yml' + + vars: + evolinux_hostname: "localhost" + evolinux_domain: "localdomain.tld" + evomaintenance_alert_email: "evomaintenance-{{ evolinux_hostname }}@evolix.fr" + evomaintenance_install_vendor: True + client_number: "XXX" + monitoring_mode: "everytime" + evocheck_force_install: "local" + evoadmin_host: "evoadmin.{{ evolinux_hostname }}.evolix.eu" + evoadmin_contact_email: root@localhost + postfix_slow_transport_include: True + + evolinux_ssh_allow_current_user: True + + minifirewall_additional_trusted_ips: ["192.168.0.0/16", "10.0.0.0/8"] + minifirewall_http_sites: ["0.0.0.0/0"] + + packweb_enable_evoadmin_vhost: True + packweb_phpmyadmin_suffix: "uE34swx9" + + evolinux_apt_include: True + evolinux_etcgit_include: True + evolinux_hostname_include: True + evolinux_kernel_include: True + evolinux_fstab_include: True + evolinux_packages_include: True + evolinux_system_include: True + evolinux_evomaintenance_include: True + evolinux_ssh_include: True + evolinux_users_include: False + evolinux_root_include: True + evolinux_postfix_include: True + evolinux_logs_include: True + evolinux_default_www_include: True + evolinux_hardware_include: True + evolinux_provider_online_include: False + evolinux_provider_orange_fce_include: False + evolinux_log2mail_include: True + evolinux_minifirewall_include: True + evolinux_munin_include: True + evolinux_nagios_nrpe_include: True + evolinux_fail2ban_include: False + mysql_custom_datadir: '/home/mysql' + mysql_custom_tmpdir: '/home/tmpmysql' + mysql_custom_logdir: '/home/mysql-logs' + # evolinux_apt_public_sources: False + apt_upgrade: True + + # TODO Try to to make it work without the following line + # packweb_multiphp_versions: + # - php74 + # - php82 + + # autosysadmin_config: + # repair_http: "on" + # repair_mysql: off + # repair_all: 'off' + + roles: + - mysql + # - evolinux-base + # # - evolinux-users + # - ./ansible/roles/autosysadmin-agent + # - packweb-apache + # # - redis + # - { role: redis, redis_instance_name: foo, redis_port: 6380 } + # - { role: redis, redis_instance_name: bar, redis_port: 6381 }