Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit 3f6eb76

Browse files
committedJan 14, 2016
Implemented static value of forwarded SSH port to prevent necessity to reconfigure software accessing guest via SSH
1 parent d79ce9f commit 3f6eb76

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed
 

Diff for: ‎Vagrantfile

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ end
2626
config_data = Config.load
2727
magento_host_name = config_data['magento']['host_name']
2828
magento_ip_address = config_data['guest']['ip_address']
29+
forwarded_ssh_port = config_data['guest']['forwarded_ssh_port']
2930
guest_memory = config_data['guest']['memory']
3031

3132
# NFS will be used for *nix and OSX hosts, if not disabled explicitly in config
@@ -87,5 +88,7 @@ Vagrant.configure(VAGRANT_API_VERSION) do |config|
8788
config.vm.define magento_host_name do |node|
8889
node.vm.hostname = magento_host_name
8990
node.vm.network :private_network, ip: magento_ip_address
91+
node.vm.network :forwarded_port, guest: 22, host: forwarded_ssh_port
9092
end
93+
config.ssh.guest_port = forwarded_ssh_port
9194
end

Diff for: ‎init_project.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ if [ ! -f "${vagrant_dir}/local.config/config.yaml" ]; then
1515
cp "${config_path}.dist" ${config_path}
1616
fi
1717
random_ip=$(( ( RANDOM % 240 ) + 12 ))
18+
forwarded_ssh_port=$(( random_ip + 3000 ))
1819
sed -i.back "s|ip_address: \"192.168.10.2\"|ip_address: \"192.168.10.${random_ip}\"|g" "${config_path}"
1920
sed -i.back "s|host_name: \"magento2.vagrant2\"|host_name: \"magento2.vagrant${random_ip}\"|g" "${config_path}"
21+
sed -i.back "s|forwarded_ssh_port: 3000|forwarded_ssh_port: ${forwarded_ssh_port}|g" "${config_path}"
2022
rm -f "${config_path}.back"
2123

2224
# Clean up the project before initialization if "-f" option was specified
@@ -44,7 +46,6 @@ if [ ! -d ${magento_ce_dir} ]; then
4446
fi
4547
fi
4648

47-
4849
var_generation_dir="${magento_ce_dir}/var/generation"
4950
if [ ! -d ${var_generation_dir} ] ; then
5051
host_os=$(bash "${vagrant_dir}/scripts/host/shell/get_host_os.sh")

Diff for: ‎local.config/config.yaml.dist

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ guest:
77
# Default is 2Gb, around 3Gb is necessary to run functional tests
88
memory: 2048
99
ip_address: "192.168.10.2"
10+
forwarded_ssh_port: 3000
1011
environment:
1112
# If set to 0, PHP 5 will be installed
1213
use_php7: 1

0 commit comments

Comments
 (0)