Vagrant definition for manual tests

This commit is contained in:
Jérémy Lecour 2024-01-08 23:01:43 +01:00 committed by Jérémy Lecour
parent 0f0b328f27
commit 01fb231437
Signed by: jlecour
SSH key fingerprint: SHA256:h+5LgHRKwN9lS0SsdVR5yZPeFlJE4Mt+8UtL4CcP8dY
3 changed files with 127 additions and 0 deletions

View file

@ -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

49
client/Vagrantfile vendored Normal file
View file

@ -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

76
client/vagrant.yml Normal file
View file

@ -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 }