From 76d7f3f923ab2cb93cd4662e9e814124d0af3de1 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Oct 16 2018 10:41:07 +0000 Subject: [PATCH 1/2] Fix: add two additional patches for change_host_name logic * https://github.com/hashicorp/vagrant/commit/11b0d58fa081cd9a27c272244a0d119acc81f32e * https://github.com/hashicorp/vagrant/commit/1797798760eb72d6b02724f75bc54dd83815e986 The functionality was not backported fully so vagrant crashed on hostname change. https://bugzilla.redhat.com/show_bug.cgi?id=1624068 --- diff --git a/vagrant-2.1.6-update-restart-logic-in-redhat.patch b/vagrant-2.1.6-update-restart-logic-in-redhat.patch index 94ec982..1457a96 100644 --- a/vagrant-2.1.6-update-restart-logic-in-redhat.patch +++ b/vagrant-2.1.6-update-restart-logic-in-redhat.patch @@ -550,3 +550,49 @@ index b4691d0fd4..d3a523c95b 100644 end let(:nm_yml) { "---\nnetwork:\n version: 2\n renderer: NetworkManager\n ethernets:\n eth1:\n dhcp4: true\n eth2:\n addresses:\n - 33.33.33.10/16\n gateway4: 33.33.0.1\n" } + +From 1797798760eb72d6b02724f75bc54dd83815e986 Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Fri, 28 Sep 2018 07:59:39 -0700 +Subject: [PATCH] Fix module name + +--- + plugins/guests/redhat/cap/change_host_name.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb +index 5da660df05..37c8912a80 100644 +--- a/plugins/guests/redhat/cap/change_host_name.rb ++++ b/plugins/guests/redhat/cap/change_host_name.rb +@@ -3,7 +3,7 @@ module GuestRedHat + module Cap + class ChangeHostName + +- extend Vagrant::Util::GuestInspection ++ extend Vagrant::Util::GuestInspection::Linux + + def self.change_host_name(machine, name) + comm = machine.communicate + +From 11b0d58fa081cd9a27c272244a0d119acc81f32e Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Mon, 1 Oct 2018 08:43:49 -0700 +Subject: [PATCH] Include communicator on call + +--- + plugins/guests/redhat/cap/change_host_name.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb +index 37c8912a80..5ceb63665a 100644 +--- a/plugins/guests/redhat/cap/change_host_name.rb ++++ b/plugins/guests/redhat/cap/change_host_name.rb +@@ -31,7 +31,7 @@ def self.change_host_name(machine, name) + + restart_command = "service network restart" + +- if systemd? ++ if systemd?(comm) + if systemd_networkd?(comm) + restart_command = "systemctl restart systemd-networkd.service" + elsif systemd_controlled?(comm, "NetworkManager.service") diff --git a/vagrant.spec b/vagrant.spec index 5b69b86..e9ade0a 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.1.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -29,6 +29,8 @@ Patch0: vagrant-2.1.5-fix-dependencies.patch # Update restart logic in redhat change_host_name cap # https://bugzilla.redhat.com/show_bug.cgi?id=1624068 # https://github.com/hashicorp/vagrant/pull/10223 +# https://github.com/hashicorp/vagrant/commit/11b0d58fa081cd9a27c272244a0d119acc81f32e +# https://github.com/hashicorp/vagrant/commit/1797798760eb72d6b02724f75bc54dd83815e986 Patch1: vagrant-2.1.6-update-restart-logic-in-redhat.patch Requires: ruby(release) @@ -321,6 +323,9 @@ end %changelog +* Thu Oct 11 2018 Pavel Valena - 2.1.5-2 +- Fix: two additional patches for change_host_name logic(rhbz#1624068) + * Wed Sep 19 2018 Pavel Valena - 2.1.5-1 - Update to Vagrant 2.1.5. - Update restart logic for redhat change_host_name cap(rhbz#1624068) From 548a38c88eda5c6c69e307775d4921238280f9da Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Oct 24 2018 11:06:44 +0000 Subject: [PATCH 2/2] Allow use of newer Childprocess gem also needs macro from rubygems-devel to edit vagrant.gemspec. --- diff --git a/vagrant.spec b/vagrant.spec index e9ade0a..88ec51d 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -57,6 +57,7 @@ Requires(pre): shadow-utils BuildRequires: bsdtar BuildRequires: ruby +BuildRequires: rubygems-devel BuildRequires: rubygem(listen) BuildRequires: rubygem(childprocess) BuildRequires: rubygem(hashicorp-checkpoint) @@ -108,6 +109,9 @@ Documentation for %{name}. %patch1 -p1 %build +%gemspec_remove_dep -s %{name}.gemspec -g childprocess '~> 0.5.0' +%gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 0.5.0' + gem build %{name}.gemspec gem install -V --local \ @@ -186,8 +190,7 @@ sed -i '/git/ s/^/#/' ../vagrant-spec/vagrant-spec.gemspec sed -i '/thor/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec sed -i '/rspec/ s/~>/>=/' ./vagrant.gemspec sed -i '/rspec/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec -# TODO: package newer childproccess -sed -i '/childprocess/ s/~>/<=/' ../vagrant-spec/vagrant-spec.gemspec +sed -i '/childprocess/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec #Insert new test dependencies sed -i '25 i\ spec.add_dependency "webmock"' ../vagrant-spec/vagrant-spec.gemspec