From c32aafabd0d99406ebd21a0d66ea22a89b57b93d Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Tue, 20 Apr 2021 21:39:29 +0200 Subject: [PATCH] Switches Vagrant box from Ubuntu to Debian 10, installs Firefox ESR, renames role --- README.md | 4 +- Vagrantfile | 13 +++++-- provisioning/files/vbox-add-6.1.18.patch | 15 +++++++ provisioning/playbook.yml | 17 ++++++-- provisioning/requirements.yml | 2 +- .../roles/jotbe.dev-tools/tasks/main.yml | 39 ------------------- 6 files changed, 43 insertions(+), 47 deletions(-) create mode 100644 provisioning/files/vbox-add-6.1.18.patch delete mode 100644 provisioning/roles/jotbe.dev-tools/tasks/main.yml diff --git a/README.md b/README.md index 9eac59d..9c9e41b 100644 --- a/README.md +++ b/README.md @@ -115,4 +115,6 @@ Install the Vagrant plugin `vagrant-vbguest`: ``` vagrant plugin install vagrant-vbguest -``` \ No newline at end of file +``` + +Note: Be a bit careful, depending on the VBoxGuestAdditions version in the VM, [the `vagrant-vbguest` plugin may not work properly](https://github.com/dotless-de/vagrant-vbguest/issues/405), causing recurring builds of the guest additions on every boot and another reboot of the VM. For VBoxGuestAdditions v6.1.18, a corresponding patch will be installed automatically. \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile index fe06a4d..f330849 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,7 +6,10 @@ require 'etc' Vagrant.configure(2) do |config| - config.vm.box = "hashicorp/bionic64" + #config.vm.box = "hashicorp/bionic64" + config.vm.box = "generic/debian10" + + config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/" # The currently only supported provider is Virtualbox # You will have to install Virtualbox from https://www.virtualbox.org @@ -30,7 +33,7 @@ Vagrant.configure(2) do |config| # If your local network uses the same subnet as the default Virtualbox one (10.0.2.0/24), set a different one here vbox.customize ["modifyvm", :id, "--natnet1", "10.0.50.0/24"] # Attach a virtual DVD drive to be able to easily install the Virtualbox Guest Additions - vbox.customize ["storageattach", :id, "--storagectl", "IDE Controller", "--port", "0", "--device", "0", "--type", "dvddrive", "--medium", "emptydrive"] + vbox.customize ["storageattach", :id, "--storagectl", "IDE Controller", "--port", "1", "--device", "1", "--type", "dvddrive", "--medium", "emptydrive"] #vbox.customize ["storagectl", :id, "--name", "SATA Controller", "--hostiocache", "on"] # Default: The VM is hosted on an SSD. # Set to "off" if it is hosted on an HDD to enable performance optimizations for rotational drives (e.g. defragmentation): @@ -72,12 +75,16 @@ Vagrant.configure(2) do |config| #ansible.verbose = "vvv" ansible.compatibility_mode = "2.0" ansible.install_mode = "pip" - ansible.version = "2.10.3" + ansible.pip_install_cmd = "sudo apt install -y python3-distutils && curl https://bootstrap.pypa.io/get-pip.py | sudo python3" + ansible.version = "2.10.8" ansible.playbook = "provisioning/playbook.yml" #ansible.inventory_path = "provisioning/inventory" ansible.galaxy_role_file = "provisioning/requirements.yml" ansible.galaxy_roles_path = "provisioning/roles" ansible.become = true + ansible.extra_vars = { + virtualbox_host_version: "6.1.18" + } end end diff --git a/provisioning/files/vbox-add-6.1.18.patch b/provisioning/files/vbox-add-6.1.18.patch new file mode 100644 index 0000000..214a845 --- /dev/null +++ b/provisioning/files/vbox-add-6.1.18.patch @@ -0,0 +1,15 @@ +--- /opt/VBoxGuestAdditions-6.1.18/init/vboxadd 2021-03-16 04:06:15.928284593 +0000 ++++ /opt/VBoxGuestAdditions-6.1.18/init/vboxadd 2021-03-16 04:07:36.249727179 +0000 +@@ -499,9 +499,10 @@ + case "$no_udev" in 1) + sleep .5;; + esac +- $MODPROBE vboxsf > /dev/null 2>&1 || +- info "modprobe vboxsf failed" + } ++ # HACK ++ $MODPROBE vboxsf > /dev/null 2>&1 || ++ info "modprobe vboxsf failed" + case "$no_udev" in 1) + do_vboxguest_non_udev;; + esac \ No newline at end of file diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index fe5361b..9e5bd14 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -25,6 +25,17 @@ changed_when: false tasks: + - block: + - name: Provide VBoxGuestAdditions patch + copy: + src: files/vbox-add-6.1.18.patch + dest: /tmp/vbox-add-6.1.18.patch + + - name: Patch VBoxGuestAdditions + shell: "patch -s -N -u /opt/VBoxGuestAdditions-6.1.18/init/vboxadd -i /tmp/vbox-add-6.1.18.patch" + ignore_errors: yes + when: virtualbox_host_version | default("") == "6.1.18" + - name: Install Ansible raw: test -e /usr/local/bin/ansible || pip3 install ansible={{ ansible_version }} changed_when: false @@ -64,8 +75,8 @@ - name: Install browsers apt: pkg: - - firefox - - chromium-browser + - firefox-esr + - chromium register: browsers_installed - name: Reboot system @@ -76,4 +87,4 @@ - jotbe.common - geerlingguy.pip - geerlingguy.docker - - jotbe.dev-tools \ No newline at end of file + - jotbe.dev_tools \ No newline at end of file diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 83666ca..cc6397b 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -6,7 +6,7 @@ src: https://git.jotbe.io/jotbe/ansible-role-common.git scm: git -- name: jotbe.dev-tools +- name: jotbe.dev_tools src: https://git.jotbe.io/jotbe/ansible-role-dev-tools.git scm: git diff --git a/provisioning/roles/jotbe.dev-tools/tasks/main.yml b/provisioning/roles/jotbe.dev-tools/tasks/main.yml deleted file mode 100644 index 16a83f4..0000000 --- a/provisioning/roles/jotbe.dev-tools/tasks/main.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -# tasks file for jotbe.dev-tools - -- name: Add key for Sublime Text repo - apt_key: - url: https://download.sublimetext.com/sublimehq-pub.gpg - state: present - -- name: Add repository for Sublime Text - apt_repository: - repo: deb https://download.sublimetext.com/ apt/stable/ - state: present - -- name: Add key for VSCodium repo - apt_key: - url: https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg - state: present - -- name: Add repository for VSCodium - apt_repository: - repo: deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main - state: present - -- name: Update apt cache - apt: - update_cache: yes - cache_valid_time: 7200 - -- name: Install Sublime Text - apt: - pkg: - - sublime-text - register: sublime_text_installed - -- name: Install VSCodium - apt: - pkg: - - codium - register: vscodium_installed