Switches Vagrant box from Ubuntu to Debian 10, installs Firefox ESR, renames role

This commit is contained in:
Jan Beilicke 2021-04-20 21:39:29 +02:00
parent 1f799e612d
commit c32aafabd0
6 changed files with 43 additions and 47 deletions

View file

@ -115,4 +115,6 @@ Install the Vagrant plugin `vagrant-vbguest`:
``` ```
vagrant plugin install vagrant-vbguest vagrant plugin install vagrant-vbguest
``` ```
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.

13
Vagrantfile vendored
View file

@ -6,7 +6,10 @@ require 'etc'
Vagrant.configure(2) do |config| 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 # The currently only supported provider is Virtualbox
# You will have to install Virtualbox from https://www.virtualbox.org # 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 # 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"] 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 # 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"] #vbox.customize ["storagectl", :id, "--name", "SATA Controller", "--hostiocache", "on"]
# Default: The VM is hosted on an SSD. # 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): # 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.verbose = "vvv"
ansible.compatibility_mode = "2.0" ansible.compatibility_mode = "2.0"
ansible.install_mode = "pip" 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.playbook = "provisioning/playbook.yml"
#ansible.inventory_path = "provisioning/inventory" #ansible.inventory_path = "provisioning/inventory"
ansible.galaxy_role_file = "provisioning/requirements.yml" ansible.galaxy_role_file = "provisioning/requirements.yml"
ansible.galaxy_roles_path = "provisioning/roles" ansible.galaxy_roles_path = "provisioning/roles"
ansible.become = true ansible.become = true
ansible.extra_vars = {
virtualbox_host_version: "6.1.18"
}
end end
end end

View file

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

View file

@ -25,6 +25,17 @@
changed_when: false changed_when: false
tasks: 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 - name: Install Ansible
raw: test -e /usr/local/bin/ansible || pip3 install ansible={{ ansible_version }} raw: test -e /usr/local/bin/ansible || pip3 install ansible={{ ansible_version }}
changed_when: false changed_when: false
@ -64,8 +75,8 @@
- name: Install browsers - name: Install browsers
apt: apt:
pkg: pkg:
- firefox - firefox-esr
- chromium-browser - chromium
register: browsers_installed register: browsers_installed
- name: Reboot system - name: Reboot system
@ -76,4 +87,4 @@
- jotbe.common - jotbe.common
- geerlingguy.pip - geerlingguy.pip
- geerlingguy.docker - geerlingguy.docker
- jotbe.dev-tools - jotbe.dev_tools

View file

@ -6,7 +6,7 @@
src: https://git.jotbe.io/jotbe/ansible-role-common.git src: https://git.jotbe.io/jotbe/ansible-role-common.git
scm: git scm: git
- name: jotbe.dev-tools - name: jotbe.dev_tools
src: https://git.jotbe.io/jotbe/ansible-role-dev-tools.git src: https://git.jotbe.io/jotbe/ansible-role-dev-tools.git
scm: git scm: git

View file

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