Skip to content

Commit d781865

Browse files
committed
Move plugin builds on libvirt to Fedora 35
This is the last version of Fedora that provided a ruby 2.7 package. Unable to make snap builds work due to either dynamic linker errors, or apparmor violations. Unable to disable apparmor enforcement since the rules come in via snap, but #include <> stuff from global scope, and the include paths aren't compatible. Unable to unload apparmor module since Ubuntu appears to have it built directly into kernel. Stopping the apparmor service only stops ability to update rules, but doesn't disable the already-configured ones from breaking builds. A "sudo BUNDLE_SILENCE_ROOT_WARNING=true bundle install" is required in the VM since some gems build native extensions, and those aren't installed or detected properly by the subsequenct "bundle exec rake build".
1 parent dfeaf4c commit d781865

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

tools/vagrant-plugin-builder/Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Vagrant.configure("2") do |config|
1313
end
1414

1515
config.vm.provider "libvirt" do |lv, override|
16-
override.vm.box = "generic/ubuntu2204" # 1804 does not have virtiofs support.
16+
override.vm.box = "generic/fedora35" # Fedora stopped supporting Ruby 2.7 after version 35.
1717
lv.qemu_use_session = false # required for virtiofs.
1818
lv.memory = 2 * 1024
1919
lv.cpus = 2

tools/vagrant-plugin-builder/ruby_development_provision.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,27 @@
1212
retries: 20
1313
delay: 10
1414
become: true
15+
when: ansible_facts["os_family"] == "Debian"
1516

1617
- name: Install apt packages
1718
apt:
1819
name: ["build-essential"]
1920
update_cache: yes
2021
# 1 hour
2122
cache_valid_time: 3600
22-
become: yes
23+
become: true
24+
when: ansible_facts["os_family"] == "Debian"
2325

2426
- name: Add user 'vagrant' to group 'vboxsf'
25-
become: yes
27+
become: true
2628
user:
2729
name: vagrant
2830
groups: vboxsf
2931
append: yes
3032
when: ansible_facts["virtualization_type"] == "virtualbox"
3133

3234
- name: Mount shared folder
33-
become: yes
35+
become: true
3436
mount:
3537
path: /mnt/packer-mikrotik
3638
src: packer-mikrotik
@@ -39,14 +41,24 @@
3941
state: mounted
4042
when: ansible_facts["virtualization_type"] == "virtualbox"
4143

44+
- name: Ensure Ruby 2.7 build enviromment is present
45+
become: true
46+
ansible.builtin.dnf:
47+
name: "{{ item }}"
48+
loop:
49+
- "@ruby:2.7"
50+
- ruby-devel
51+
when: ansible_facts["os_family"] == "RedHat"
52+
4253
- name: Install Ruby snap
54+
become: true
4355
# community.general.snap:
4456
# (fails since we are using ansible_local provisioner and it installs old Ansible version)
4557
snap:
4658
name: ruby
4759
channel: 2.7/stable # otherwise 3.1.2 is installed and vagrant 2.2.20.dev depends on (>= 2.6, < 3.1)
4860
classic: yes
49-
become: yes
61+
when: ansible_facts["os_family"] == "Debian"
5062

5163
# Not installing since rvm.ruby fails
5264
# - name: Install roles from Ansible Galaxy

vagrant-plugins-routeros/Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ source "https://rubygems.org"
33
gemspec
44

55
group :development do
6-
gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
6+
gem "vagrant", git: "https://github.com/hashicorp/vagrant.git"
77
end
88

99
# group :plugins do
1010
# gem "vagrant-routeros", path: "."
11-
# end
11+
# end

0 commit comments

Comments
 (0)