]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - Update Vagrant docs and config to improve Windows Hyper-V support
authordklawren <dklawren@users.noreply.github.com>
Tue, 14 Jan 2020 17:34:40 +0000 (12:34 -0500)
committerGitHub <noreply@github.com>
Tue, 14 Jan 2020 17:34:40 +0000 (12:34 -0500)
README.rst
Vagrantfile
vagrant_support/checksetup.yml
vagrant_support/playbook.yml

index f82a43cd111b4bc13a3a9fc612da67e80d4c9f01..c2aa78e1ab0b5d0b2ea5868588cd3a7b89fa306f 100644 (file)
@@ -76,62 +76,77 @@ Restart morbo and you should now be able to visit https://bmo-web.vm.
 Vagrant and Windows Hyper-Vagrant
 ---------------------------------
 
-Enable hyperv support in Windows 10
-
-- Right click on the Windows button and select ‘Apps and Features’.
-- Select Turn Windows Features on or off.
-- Select Hyper-V and click OK.
-- May need to reboot.
-
 Run PowerShell as Administrator
 
 - Press the Windows key.
 - Type `powershell` in the search field.
-- In the search results, select `Run as administrator`.
+- RIght click on the Powershell icon and choose `Run as administrator`.
 
-Create NAT Switch with IP address of 192.168.3.1/24
+Enable hyperv support in Windows 10
 
 .. code-block:: powershell
 
-  New-VMSwitch -SwitchName “VagrantSwitch” -SwitchType Internal
-  New-NetIPAddress -IPAddress 192.168.3.1 -PrefixLength 24 -InterfaceAlias “vEthernet (VagrantSwitch)”
-  New-NetNAT -Name “NATNetwork” -InternalIPInterfaceAddressPrefix 192.168.3.0/24
+  Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
 
-Install DHCP Servor for Windows
+- You may need to reboot to finish the installation.
 
-- http://www.dhcpserver.de/cms/
-- Configure to serve IP addresses to the NAT Switch network above.
-- Set the IP range to be 100-254
+Create NAT Switch with IP address of 192.168.3.1/24
 
-Install Vagrant for Windows
+.. code-block:: powershell
 
-Install Git for Windows
+  New-VMSwitch -SwitchName “VagrantNAT” -SwitchType Internal
+  New-NetIPAddress -IPAddress 192.168.3.1 -PrefixLength 24 -InterfaceAlias “vEthernet (VagrantNAT)”
+  New-NetNAT -Name “VagrantNAT” -InternalIPInterfaceAddressPrefix 192.168.3.0/24
+
+Install DHCP Server for Windows
+
+- http://www.dhcpserver.de/cms/download
+- Download and extract the latest version of DHCP Server.
+- Double-click  ``dhcpwiz.exe`` to start the configuration utility.
+- Select ``VagrantNAT`` that was created above as the network interface.
+- Click Next and Skip configuring File and Name Service protocols.
+- Set the IP-Pool range to be 100-254.
+- Select the Advanced button to configure extra settings.
+- Add ``8.8.8.8`` as a DNS Server.
+- Add ``192.168.3.1`` as a Gateway and Select OK.
+- Click Next.
+- Make sure Overwrite existing file is checked and click Write INI file.
+- Click Next and then Finish.
+- Double-click  ``dhcpsrv.exe`` to start the DHCP server.
+- Continue to run as a system tray appliction.
 
-Set some environment variables to use for Vagrant
+Install Vagrant for Windows
 
-.. code-block:: powershell
+- Install version 2.2.6 or higher due to bugs in older versions.
+- https://www.vagrantup.com/downloads.html
 
-  [System.Environment]::SetEnvironmentVariable('HYPERV', '1')
+Install Git for Windows if not already installed.
+
+- https://git-scm.com/download/win
 
-Update hosts file in Windows
+Update hosts file in Windows to allow accessing the webserver by hostname.
 
 - Press the Windows key.
 - Type `notepad` in the search field.
-- In the search results, select `Run as administrator`.
+- Right click the Notepad icon and choose `Run as administrator`.
 - From Notepad, open the following file: ``C:\Windows\System32\Drivers\etc\hosts``.
 - Add ``192.168.3.43 bmo-web.vm`` to the end of the file.
 - Select File > Save to save your changes.
 
-Git clone BMO repo ``git clone https://github.com/mozilla-bteam/bmo bmo``
+Still in Powershell as Administrator, set an environment variable to use for Vagrantfile.
+Then clone the BMO Github repo and start the Vagrant instances.
 
-.. code-block:: bash
+.. code-block:: powershell
 
+  [System.Environment]::SetEnvironmentVariable('HYPERV', '1')
+  git clone https://github.com/mozilla-bteam/bmo bmo
   cd bmo
   vagrant up --provider hyperv
 
-When requested (twice), select the NAT Switch that was created earlier. You will need to atart the mojo server to access BMO from the browser
+You will need to atart the mojo server to access BMO from the browser
 using ``vagrant ssh web -c 'start_morbo'``. In your browser go to: ``http://bmo-web.vm``.
 
+
 Making Changes and Seeing them
 ------------------------------
 
index d0a6084766a25f90b8db27f33a032a04843b63a5..d45d31adb360e57603cd70680d1288521e5f58a8 100644 (file)
@@ -112,6 +112,10 @@ Vagrant.configure('2') do |config|
       v.vmx['numvcpus'] = DB_CPU
       v.linked_clone = false
     end
+
+    db.vm.provider "hyperv" do |hv|
+      db.vm.network "private_network", bridge: "VagrantNAT"
+    end
   end
 
   config.vm.define 'web', primary: true do |web|
@@ -148,5 +152,9 @@ Vagrant.configure('2') do |config|
       v.vmx['memsize'] = WEB_MEM
       v.vmx['numvcpus'] = WEB_CPU
     end
+
+    web.vm.provider "hyperv" do |hv|
+      web.vm.network "private_network", bridge: "VagrantNAT"
+    end
   end
 end
index 455986148f33122448bdceef9153be88c09b79c9..1cfd8c8cfeec059f72ccc7fcd9524fd5259b5222 100644 (file)
 - name: fix owner of /data
   file: path=/data state=directory owner=vagrant group=apache recurse=yes
 
+- name: Force Mojolicious (FIXME)
+  cpanm:
+    executable: /usr/local/bin/cpanm
+    locallib: /vagrant/local
+    name: https://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-8.23.tar.gz
+    notest: True
+
+- name: Update a few CPAN Modules (FIXME)
+  cpanm:
+    executable: /usr/local/bin/cpanm
+    locallib: /vagrant/local
+    name: "{{ item.name }}"
+    version: "{{ item.version }}"
+    notest: True
+  with_items:
+    - { name: 'Mojolicious::Plugin::OAuth2::Server', version: '0.44' }
+    - { name: 'Type::Tiny', version: '1.004004' }
+
 - name: run checksetup
   become: false
   shell: sg apache -c '/usr/local/bin/bmo-checksetup --no-templates'
index 28bab99248d12bfd12b7b490a038b98b0cdf56a0..482998f9e24c283497c94aab4a5de034e8c62f48 100644 (file)
         src: hyperv-static-ip-db.j2
         dest: /etc/sysconfig/network-scripts/ifcfg-eth0:0
         mode: 0644
-      when: HYPERV == 1
+      when: HYPERV == '1'
 
     - name: Restart network service for interface eth0:0
       service:
         name: network
         state: restarted
         args: eth0:0
-      when: HYPERV == 1
+      when: HYPERV == '1'
 
     - name: fetch ius-release.rpm
       get_url:
         src: hyperv-static-ip-web.j2
         dest: /etc/sysconfig/network-scripts/ifcfg-eth0:0
         mode: 0644
-      when: HYPERV == 1
+      when: HYPERV == '1'
 
     - name: Restart network service for interface eth0:0 (hyperv only)
       service:
         name: network
         state: restarted
         args: eth0:0
-      when: HYPERV == 1
+      when: HYPERV == '1'
 
     - name: install web-specific packages
       yum: name={{item}} state=present