teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

追記

2018/07/23 01:17

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -25,5 +25,110 @@
25
25
 
26
26
  接続できない理由が分かりません。
27
27
 
28
+
29
+ 以下、vagrantfileです。
30
+ ```
31
+ # -*- mode: ruby -*-
32
+ # vi: set ft=ruby :
33
+
34
+ ###########################################################################
35
+ # This configuration file is the starting point for understanding how the
36
+ # virtual machine is configured and provides a default provider that uses
37
+ # Virtualbox to provide virtualization. It also contains an *experimental*
38
+ # provider for using an AWS EC2 microinstance in the cloud. The AWS provider
39
+ # works but is a bit bleeding edge and incomplete from the standpoint of
40
+ # providing all of the functionality that it should at this time, so it should
41
+ # only be used by hackers who are comfortable working in the cloud. After
42
+ # filling in the necessary AWS credentials below use the --provider=aws
43
+ # option to use the AWS provider. See https://github.com/mitchellh/vagrant-aws
44
+ # for more details.
45
+ #
46
+ # See http://docs.vagrantup.com/v2/vagrantfile/index.html for additional
47
+ # details on Vagrantfile configuration in general.
48
+ ###########################################################################
49
+
50
+ Vagrant.configure("2") do |config|
51
+
52
+ # SSH forwarding: See https://help.github.com/articles/using-ssh-agent-forwarding
53
+ config.ssh.forward_agent = true
54
+
55
+ #########################################################################
56
+ # Virtualbox configuration - the default provider for running a local VM
57
+ #########################################################################
58
+
59
+ config.vm.provider :virtualbox do |vb, override|
60
+
61
+ # The Virtualbox image
62
+ override.vm.box = "precise64"
63
+ override.vm.box_url = "http://files.vagrantup.com/precise64.box"
64
+
65
+ # Port forwarding details
66
+
67
+ # Note: Unfortunately, port forwarding currently is not implemented for
68
+ # the AWS provider plugin, so you'll need to manually open them through the
69
+ # AWS console or with the EC2 CLI tools. (It would be possible to do it
70
+ # all through an additional Chef recipe that runs as part of MTSW2E, but
71
+ # just isn't implemented yet.) Only port 8888 is essential
72
+ # to initially access IPython Notebook and get started.
73
+
74
+ # IPython Notebook
75
+ override.vm.network :forwarded_port, host: 8888, guest: 8888
76
+
77
+ # Flask
78
+ override.vm.network :forwarded_port, host: 5000, guest: 5000
79
+
80
+ # MongoDB
81
+ override.vm.network :forwarded_port, host: 27017, guest: 27017
82
+ override.vm.network :forwarded_port, host: 27018, guest: 27018
83
+ override.vm.network :forwarded_port, host: 27019, guest: 27019
84
+ override.vm.network :forwarded_port, host: 28017, guest: 28017
85
+
86
+ # You can increase the default amount of memory used by your VM by
87
+ # adjusting this value below (in MB) and reprovisioning.
88
+ vb.customize ["modifyvm", :id, "--memory", "384"]
89
+ end
90
+
91
+ #########################################################################
92
+ # AWS configuration - an experimental provider for running this VM in the
93
+ # cloud. See https://github.com/mitchellh/vagrant-aws for configuration
94
+ # details. User specific values for your own environment are referenced
95
+ # here as MTSW_ environment variables that you could set (or hard code.)
96
+ #########################################################################
97
+
98
+ config.vm.provider :aws do |aws, override|
99
+ aws.access_key_id = ENV['MTSW_AWS_ACCESS_KEY_ID']
100
+ aws.secret_access_key = ENV['MTSW_AWS_SECRET_ACCESS_KEY']
101
+ aws.keypair_name = ENV['MTSW_KEYPAIR_NAME']
102
+
103
+ # A Precise64 Ubuntu image that will run as a microinstance in the
104
+ # region specified
105
+ aws.ami = "ami-fb68f8cb"
106
+ aws.region = "us-west-2"
107
+ aws.instance_type = "t1.micro"
108
+
109
+ override.vm.box = "aws"
110
+ override.ssh.username = "ubuntu"
111
+ override.ssh.private_key_path = ENV['MTSW_KEYPAIR_PATH']
112
+
113
+ # "vagrant plugin install omnibus" to get Chef-Solo on vanilla AMI
114
+ override.omnibus.chef_version = "11.6.0"
115
+ end
116
+
117
+ # Chef-Solo provisioning
118
+ config.vm.provision :chef_solo do |chef|
119
+ chef.log_level = :debug
120
+ chef.cookbooks_path = "deploy/cookbooks"
121
+ chef.json = {
122
+ :answer => "42",
123
+ }
124
+ chef.run_list = [
125
+ "recipe[mtsw2e::default]"
126
+ ]
127
+ end
128
+
129
+ end
130
+
131
+ ```
132
+
28
133
  ### 補足情報(FW/ツールのバージョンなど)
29
134
  同書の付録Aに基づいvirtual box(5.2.16),vagrant(2.1.2_x86_64)をダウンロード、インストールしました。