From cf27f2d7672cc3cdc470c962bb4e25d22c090127 Mon Sep 17 00:00:00 2001 From: Tom David--Broglio Date: Tue, 24 Oct 2023 12:23:08 +0200 Subject: [PATCH] config vm --- Vagrantfile | 70 ++++++++++++++++++++++++++ test/Vagrantfile | 126 +---------------------------------------------- test/vagrant.yml | 26 +++++----- 3 files changed, 85 insertions(+), 137 deletions(-) create mode 100644 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..cb9d9ff --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,70 @@ +# -*- 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 = "base" + + # 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" + + # 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 diff --git a/test/Vagrantfile b/test/Vagrantfile index 95b29dd..6c43741 100644 --- a/test/Vagrantfile +++ b/test/Vagrantfile @@ -5,7 +5,8 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.synced_folder "./vagrant_share/", "/vagrant", disabled: true - config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true + config.vm.network "forwarded_port", guest: 80, host: 8081, auto_correct: true + config.vm.network "forwarded_port", guest: 53, host: 53, auto_correct: true # config.vm.provider :virtualbox do |v| # v.memory = 1024 @@ -19,66 +20,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| libvirt.cpus = 1 end - # Bullseye - config.vm.define :bullseye do |node| - node.vm.hostname = "bullseye.evolix.net" - node.vm.box = "debian/bullseye64" - node.vm.provision :ansible do |ansible| - ansible.limit = "bullseye" - ansible.playbook = "vagrant.yml" - # ansible.tags = "mysql" - ansible.raw_arguments = [ - "-b", - "--ask-vault-pass", - # "--diff", - # "--step", - # "--syntax", - # "-vvv", - ] - ansible.extra_vars = { - ansible_python_interpreter: "/usr/bin/python3" - } - end - end - - # Buster - config.vm.define :buster do |node| - node.vm.hostname = "buster" - node.vm.box = "debian/buster64" - node.vm.provision :ansible do |ansible| - ansible.limit = "buster" - ansible.playbook = "vagrant.yml" - # ansible.tags = "mysql" - ansible.raw_arguments = [ - "-b", - "--ask-vault-pass", - # "--diff", - # "--step", - # "--syntax", - # "-vvv", - ] - end - end - - # Stretch - config.vm.define :stretch do |node| - node.vm.hostname = "stretch" - node.vm.box = "debian/stretch64" - node.vm.provision :ansible do |ansible| - ansible.limit = "stretch" - ansible.playbook = "vagrant.yml" - # ansible.tags = "mysql" - ansible.raw_arguments = [ - "-b", - "--ask-vault-pass", - # "--diff", - # "--step", - # "--syntax", - # "-vvv", - ] - end - end - # Jessie config.vm.define :jessie do |node| node.vm.hostname = "jessie" @@ -97,67 +38,4 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ] end end - - # Squeeze - config.vm.define :squeeze do |node| - node.vm.hostname = "squeeze" - node.vm.box = "debian/squeeze64" - node.vm.provision :ansible do |ansible| - ansible.limit = "squeeze" - ansible.playbook = "vagrant.yml" - # ansible.tags = "mysql" - ansible.raw_arguments = [ - "-b", - "--ask-vault-pass", - # "--diff", - # "--step", - # "--syntax", - # "-vvv", - ] - end - end - - - # # Stretch - # config.vm.define :mongo1 do |node| - # node.vm.synced_folder "./vagrant_share/", "/vagrant", disabled: false - # node.vm.hostname = "mongo1" - # node.vm.box = "debian/stretch64" - # node.vm.provision :ansible do |ansible| - # ansible.limit = "mongo1" - # ansible.playbook = "vagrant-mongo.yml" - # # ansible.tags = "mysql" - # ansible.raw_arguments = [ - # "-b", - # # "--ask-vault-pass", - # ] - # end - # end - # config.vm.define :mongo2 do |node| - # node.vm.hostname = "mongo2" - # node.vm.box = "debian/stretch64" - # node.vm.provision :ansible do |ansible| - # ansible.limit = "mongo2" - # ansible.playbook = "vagrant-mongo.yml" - # # ansible.tags = "mysql" - # ansible.raw_arguments = [ - # "-b", - # # "--ask-vault-pass", - # ] - # end - # end - # config.vm.define :mongo3 do |node| - # node.vm.hostname = "mongo3" - # node.vm.box = "debian/stretch64" - # node.vm.provision :ansible do |ansible| - # ansible.limit = "mongo3" - # ansible.playbook = "vagrant-mongo.yml" - # # ansible.tags = "mysql" - # ansible.raw_arguments = [ - # "-b", - # # "--ask-vault-pass", - # ] - # end - # end - end diff --git a/test/vagrant.yml b/test/vagrant.yml index 2e80924..6578cef 100644 --- a/test/vagrant.yml +++ b/test/vagrant.yml @@ -56,15 +56,15 @@ mysql_custom_logdir: '/home/mysql-logs' # evolinux_apt_public_sources: False apt_upgrade: True - lxc_containers: - - name: php56 - release: jessie - - name: php70 - release: stretch - - name: php73 - release: buster - - name: php74 - release: bullseye + # lxc_containers: + # - name: php56 + # release: jessie + # - name: php70 + # release: stretch + # - name: php73 + # release: buster + # - name: php74 + # release: bullseye # evolinux_apt_public_sources: False # pre_tasks: @@ -73,11 +73,11 @@ # var: hostvars[inventory_hostname] roles: - - bullseye-detect + # - bullseye-detect # - aws-tuning # - apt - - evolinux-base - - evolinux-users + # - evolinux-base + # - evolinux-users # - { role: del-user, username: "gcolpart" } # - metricbeat # - { role: squid, squid_localproxy_enable: True } @@ -87,7 +87,7 @@ # - mysql-oracle # - percona # - postgresql - - packweb-apache + # - packweb-apache # - { role: packweb-apache, packweb_mysql_variant: "oracle" } # - { role: memcached, memcached_instance_name: "instance1" } # - { role: memcached, memcached_instance_name: "instance2", memcached_port: 11212 }