While there run `openssl req -newkey rsa:2048 -sha256 -nodes -keyout bmo-web.vm-key.pem -x509 -days 365 -out bmo-web.vm.pem`.
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`.
+
+Create NAT Switch with IP address of 192.168.3.1/24
+
+.. 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
+
+Install DHCP Servor for Windows
+
+- http://www.dhcpserver.de/cms/
+- Configure to serve IP addresses to the NAT Switch network above.
+- Set the IP range to be 100-254
+
+Install Vagrant for Windows
+
+Install Git for Windows
+
+Set some environment variables to use for Vagrant
+
+.. code-block:: powershell
+
+ [System.Environment]::SetEnvironmentVariable('HYPERV', '1')
+
+Update hosts file in Windows
+
+- Press the Windows key.
+- Type `notepad` in the search field.
+- In the search results, select `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``
+
+.. code-block:: bash
+
+ 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
+using ``vagrant ssh web -c 'start_morbo'``. In your browser go to: ``http://bmo-web.vm``.
+
Making Changes and Seeing them
------------------------------
Provided you have `Mojolicious`_ installed:
.. code-block:: bash
+
perl auth-test-app daemon
Then just browse to `localhost:3000`_ to test creating API keys.
``vagrant reload``. With docker, only the default 'Test' option is supported.
'Test' option (Default for Docker)
-~~~~~~~~~~~~~~~~~~~~~~~
+----------------------------------
With this option, all mail will be appended to a ``mailer.testfile``.
- Using vagrant, run ``vagrant ssh web`` and then navigate to ``/vagrant/data/mailer.testfile``.
'Sendmail' option (Default for Vagrant)
-~~~~~~~~~~~~~~~~~
+---------------------------------------
This option is useful if you want to preview email using a real mail client.
An imap server is running on bmo-web.vm on port 143 and you can connect to it with
DB_IP = ENV.fetch "BMO_DB_IP", '192.168.3.42'
WEB_IP = ENV.fetch "BMO_WEB_IP", '192.168.3.43'
+GATEWAY_IP = ENV.fetch "GATEWAY_IP", '192.168.3.1'
+DNS_IP = ENV.fetch "DNS_IP", '8.8.8.8'
DB_HOSTNAME = ENV.fetch "BMO_DB_HOST", 'bmo-db.vm'
WEB_HOSTNAME = ENV.fetch "BMO_WEB_HOST", 'bmo-web.vm'
DB_PORT = ENV.fetch "BMO_DB_PORT", 2221
WEB_PORT = ENV.fetch "BMO_WEB_PORT", 2222
-DB_MEM = ENV.fetch "BMO_DB_MEM", 512
+DB_MEM = ENV.fetch "BMO_DB_MEM", 512
WEB_MEM = ENV.fetch "BMO_WEB_MEM", 2048
-DB_CPU = ENV.fetch "BMO_DB_CPU", 1
+DB_CPU = ENV.fetch "BMO_DB_CPU", 1
WEB_CPU = ENV.fetch "BMO_WEB_CPU", 2
+HYPERV = ENV.fetch "HYPERV", 0
# this is for centos 6 / el 6
VENDOR_BUNDLE_URL = ENV.fetch "BMO_BUNDLE_URL",
WEB_HOSTNAME: WEB_HOSTNAME,
DB_HOSTNAME: DB_HOSTNAME,
VENDOR_BUNDLE_URL: VENDOR_BUNDLE_URL,
+ GATEWAY_IP: GATEWAY_IP,
+ DNS_IP: DNS_IP,
+ HYPERV: HYPERV
}
end
guest: 22,
auto_correct: true
-
web.vm.synced_folder '.', '/vagrant', type: 'rsync', rsync__args: RSYNC_ARGS
web.vm.provider 'virtualbox' do |v|
- hosts: db
become: true
tasks:
+ - name: Add an Ethernet alias with static IP configuration (hyperv only)
+ template:
+ src: hyperv-static-ip-db.j2
+ dest: /etc/sysconfig/network-scripts/ifcfg-eth0:0
+ mode: 0644
+ when: HYPERV == 1
+
+ - name: Restart network service for interface eth0:0
+ service:
+ name: network
+ state: restarted
+ args: eth0:0
+ when: HYPERV == 1
+
- name: fetch ius-release.rpm
get_url:
url: https://moz-devservices-bmocartons.s3.amazonaws.com/third-party/ius-release.rpm
- name: create bugs_bmo
shell: |-
mysqladmin -u root create bugs_bmo
- mysql -u root -e 'GRANT ALL ON bugs_bmo.* TO bugs@"{{WEB_IP}}" IDENTIFIED BY "bugs"'
+ mysql -u root -e "GRANT ALL ON bugs_bmo.* TO 'bugs'@'%' IDENTIFIED BY 'bugs'"
when: bugs_bmo is failed
- hosts: web
become: true
tasks:
+ - name: Add an Ethernet alias with static IP configuration (hyperv only)
+ template:
+ src: hyperv-static-ip-web.j2
+ dest: /etc/sysconfig/network-scripts/ifcfg-eth0:0
+ mode: 0644
+ when: HYPERV == 1
+
+ - name: Restart network service for interface eth0:0 (hyperv only)
+ service:
+ name: network
+ state: restarted
+ args: eth0:0
+ when: HYPERV == 1
+
- name: install web-specific packages
yum: name={{item}} state=present
with_items:
src: '{{VENDOR_BUNDLE_URL}}'
dest: /opt
remote_src: true
- when: opt_bmo|failed
+ when: opt_bmo is failed
- name: check /opt/bmo
shell: test -d /opt/bmo && test -f /opt/bmo/local/lib/perl5/Plack.pm
- when: opt_bmo|failed
+ when: opt_bmo is failed
- name: add local symlink
file: path=/vagrant/local src=/opt/bmo/local state=link force=true