{"id":738,"date":"2014-06-02T00:26:26","date_gmt":"2014-06-01T15:26:26","guid":{"rendered":"http:\/\/1bed.allright.life\/?p=738"},"modified":"2020-04-19T00:23:54","modified_gmt":"2020-04-18T15:23:54","slug":"post-738","status":"publish","type":"post","link":"https:\/\/1bed.allright.life\/?p=738","title":{"rendered":"Fedora 20 \u3067 Vagrant \u3092\u8a66\u3057\u3066\u307f\u308b"},"content":{"rendered":"<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u3053\u306e 2 \u5e74\u3068\u3066\u3082\u3058\u3083\u306a\u3044\u3051\u3069\u8272\u3005\u8a66\u3059\u4f59\u88d5\u304c\u5fc3\u8eab\u5171\u306b\u306a\u304b\u3063\u305f\u3002\u4f55\u5ea6\u4f1a\u793e\u3092\u8f9e\u3081\u3088\u3046\u304b\u3068\u601d\u3063\u305f\u3053\u3068\u304b\u5224\u3089\u306a\u3044\u3002<\/p>\n<p>\u3053\u306e\u6b73\u306b\u306a\u3063\u3066\u3059\u308a\u6e1b\u3089\u3055\u308c\u308b\u306e\u306f\u30ad\u30c4\u30a4\u3002<br \/>\n\u6700\u8fd1\u3001\u3084\u3063\u3068\u5c11\u3057\u3060\u3051\u4f59\u88d5\u304c\u898b\u3048\u3066\u304d\u305f\u3002\u5468\u308a\u3067\u306f\u5f53\u305f\u308a\u524d\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u3066\u3044\u308b<br \/>\nvagrant \u3068 puppet \u3092\u89e6\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u307e\u305a\u5fc5\u8981\u306a\u306e\u306f VirtualBox \u3068 Vagrant\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f yum \u304b\u3089\u3067\u3082\u3001\u4e0b\u8a18\u516c\u5f0f\u30b5\u30a4\u30c8<br \/>\n\u3069\u3061\u3089\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3082\u3044\u3044\u3068\u601d\u3046\u3051\u3069\u3001yum \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n\u3067\u304d\u308b\u306e\u304c\u82e5\u5e72\u53e4\u3044\u306e\u3067\u3001\u516c\u5f0f\u30b5\u30a4\u30c8\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u3002<\/p>\n<h2>1. VirtualBox \u3068 Vagrant \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>ORACLE VirtualBox \u306e\u30b5\u30a4\u30c8\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads\">Virtual Box \u306f\u3053\u3063\u3061<\/a><\/li>\n<li><a href=\"http:\/\/www.vagrantup.com\/downloads\">Vagrant \u306f\u3053\u3063\u3061<\/a><\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h2>2. Vagrant \u3067\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u4f5c\u308b<\/h2>\n<p>Vagrant \u306f\u4eee\u60f3\u74b0\u5883\u306e\u81ea\u52d5\u69cb\u7bc9\u3001\u81ea\u52d5\u7834\u68c4\u304c\u3067\u304d\u308b\u3068\u5f8c\u8f29\u305f\u3061\u304b\u3089\u805e\u3044\u3066\u3044\u308b\u3002<br \/>\n\u3053\u308c\u306f\u697d\u3061\u3093\u3060\u306a\u30fc \u5168\u54e1\u306e\u74b0\u5883\u540c\u3058\u306b\u3068\u304b\u7c21\u5358\u306b\u3067\u304d\u305d\u3046\u3060\u3002<br \/>\n\u3061\u3087\u3063\u3068\u89e6\u3063\u305f\u611f\u3058\u3060\u3068\u3053\u3093\u306a\u611f\u3058\u306e\u7279\u5fb4\u304c\u3042\u308b\u306e\u304b\u306a\uff1f<\/p>\n<ul>\n<li>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3054\u3068\u306b\u4f7f\u3044\u5206\u3051\u308b<\/li>\n<li>\uff2f\uff33\u30a4\u30e1\u30fc\u30b8\u3092 box \u3068\u547c\u3076\u3089\u3057\u3044<\/li>\n<li>\u4e00\u5ea6 box<br \/>\n\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u3089\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u3066\u3001\u4f55\u5ea6\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u306a\u3044<br \/>\n\\~\/.vagrant.d\/ \u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u308b<\/li>\n<li>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c Windows \u3067\u3082 OK<\/li>\n<\/ul>\n<p>\u5f8c\u3067 Puppet \u3092\u8a66\u3057\u305f\u3044\u306e\u3067\u3001Puppet Labs \u304c\u914d\u5e03\u3057\u3066\u3044\u308b Ubuntu 13.10<br \/>\nServer \u3092\u4f7f\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<p><a href=\"http:\/\/puppet-vagrant-boxes.puppetlabs.com\/\">http:\/\/puppet-vagrant-boxes.puppetlabs.com\/<\/a> \u307e\u305a\u3001vagrant init \u3067<br \/>\nVagrantfile \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u3088\u3046\u3060\u3002<\/p>\n<pre><code class=\"language-bash\">$ vagrant init ub1310-puppet http:\/\/puppet-vagrant-boxes.puppetlabs.com\/ubuntu-1310-x64-virtualbox-puppet.box\nA `Vagrantfile` has been placed in this directory. You are now\nready to `vagrant up` your first virtual environment! Please read\nthe comments in the Vagrantfile as well as documentation on\n`vagrantup.com` for more information on using Vagrant.<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3067\u304d\u305f Vagrantfile \u304c\u3053\u3061\u3089<\/p>\n<pre><code class=\"language-ruby\"># -*- mode: ruby -*-\n# vi: set ft=ruby :\n\n# Vagrantfile API\/syntax version. Don&#039;t touch unless you know what you&#039;re doing!\nVAGRANTFILE_API_VERSION = &quot;2&quot;\n\nVagrant.configure(VAGRANTFILE_API_VERSION) do |config|\n  # All Vagrant configuration is done here. The most common configuration\n  # options are documented and commented below. For a complete reference,\n  # please see the online documentation at vagrantup.com.\n\n  # Every Vagrant virtual environment requires a box to build off of.\n  config.vm.box = &quot;ub1310-puppet&quot;\n\n  # The url from where the &#039;config.vm.box&#039; box will be fetched if it\n  # doesn&#039;t already exist on the user&#039;s system.\n  config.vm.box_url = &quot;http:\/\/puppet-vagrant-boxes.puppetlabs.com\/ubuntu-1310-x64-virtualbox-puppet.box&quot;\n\n  # Create a forwarded port mapping which allows access to a specific port\n  # within the machine from a port on the host machine. In the example below,\n  # accessing &quot;localhost:8080&quot; will access port 80 on the guest machine.\n  # config.vm.network &quot;forwarded_port&quot;, guest: 80, host: 8080\n\n  # Create a private network, which allows host-only access to the machine\n  # using a specific IP.\n  # config.vm.network &quot;private_network&quot;, ip: &quot;192.168.33.10&quot;\n\n  # Create a public network, which generally matched to bridged network.\n  # Bridged networks make the machine appear as another physical device on\n  # your network.\n  # config.vm.network &quot;public_network&quot;\n\n  # If true, then any SSH connections made will enable agent forwarding.\n  # Default value: false\n  # config.ssh.forward_agent = true\n\n  # Share an additional folder to the guest VM. The first argument is\n  # the path on the host to the actual folder. The second argument is\n  # the path on the guest to mount the folder. And the optional third\n  # argument is a set of non-required options.\n  # config.vm.synced_folder &quot;..\/data&quot;, &quot;\/vagrant_data&quot;\n\n  # Provider-specific configuration so you can fine-tune various\n  # backing providers for Vagrant. These expose provider-specific options.\n  # Example for VirtualBox:\n  #\n  # config.vm.provider &quot;virtualbox&quot; do |vb|\n  #   # Don&#039;t boot with headless mode\n  #   vb.gui = true\n  #\n  #   # Use VBoxManage to customize the VM. For example to change memory:\n  #   vb.customize [&quot;modifyvm&quot;, :id, &quot;--memory&quot;, &quot;1024&quot;]\n  # end\n  #\n  # View the documentation for the provider you&#039;re using for more\n  # information on available options.\n\n  # Enable provisioning with CFEngine. CFEngine Community packages are\n  # automatically installed. For example, configure the host as a\n  # policy server and optionally a policy file to run:\n  #\n  # config.vm.provision &quot;cfengine&quot; do |cf|\n  #   cf.am_policy_hub = true\n  #   # cf.run_file = &quot;motd.cf&quot;\n  # end\n  #\n  # You can also configure and bootstrap a client to an existing\n  # policy server:\n  #\n  # config.vm.provision &quot;cfengine&quot; do |cf|\n  #   cf.policy_server_address = &quot;10.0.2.15&quot;\n  # end\n\n  # Enable provisioning with Puppet stand alone.  Puppet manifests\n  # are contained in a directory path relative to this Vagrantfile.\n  # You will need to create the manifests directory and a manifest in\n  # the file default.pp in the manifests_path directory.\n  #\n  # config.vm.provision &quot;puppet&quot; do |puppet|\n  #   puppet.manifests_path = &quot;manifests&quot;\n  #   puppet.manifest_file  = &quot;site.pp&quot;\n  # end\n\n  # Enable provisioning with chef solo, specifying a cookbooks path, roles\n  # path, and data_bags path (all relative to this Vagrantfile), and adding\n  # some recipes and\/or roles.\n  #\n  # config.vm.provision &quot;chef_solo&quot; do |chef|\n  #   chef.cookbooks_path = &quot;..\/my-recipes\/cookbooks&quot;\n  #   chef.roles_path = &quot;..\/my-recipes\/roles&quot;\n  #   chef.data_bags_path = &quot;..\/my-recipes\/data_bags&quot;\n  #   chef.add_recipe &quot;mysql&quot;\n  #   chef.add_role &quot;web&quot;\n  #\n  #   # You may also specify custom JSON attributes:\n  #   chef.json = { mysql_password: &quot;foo&quot; }\n  # end\n\n  # Enable provisioning with chef server, specifying the chef server URL,\n  # and the path to the validation key (relative to this Vagrantfile).\n  #\n  # The Opscode Platform uses HTTPS. Substitute your organization for\n  # ORGNAME in the URL and validation key.\n  #\n  # If you have your own Chef Server, use the appropriate URL, which may be\n  # HTTP instead of HTTPS depending on your configuration. Also change the\n  # validation key to validation.pem.\n  #\n  # config.vm.provision &quot;chef_client&quot; do |chef|\n  #   chef.chef_server_url = &quot;https:\/\/api.opscode.com\/organizations\/ORGNAME&quot;\n  #   chef.validation_key_path = &quot;ORGNAME-validator.pem&quot;\n  # end\n  #\n  # If you&#039;re using the Opscode platform, your validator client is\n  # ORGNAME-validator, replacing ORGNAME with your organization name.\n  #\n  # If you have your own Chef Server, the default validation client name is\n  # chef-validator, unless you changed the configuration.\n  #\n  #   chef.validation_client_name = &quot;ORGNAME-validator&quot;\nend<\/code><\/pre>\n<p>\u4f7f\u7528\u3059\u308b box \u306e\u6307\u5b9a\u3092 vagrant init \u3067\u884c\u3063\u305f\u3089\u3001\u6b21\u306b box<br \/>\n\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3068\u4eee\u60f3\u30de\u30b7\u30f3\u4f5c\u6210\u3068\u8d77\u52d5\u3092\u884c\u3046\u306e\u304c vagrant up\u3002<\/p>\n<pre><code class=\"language-bash\">$ vagrant up\nBringing machine &#039;default&#039; up with &#039;virtualbox&#039; provider...\n==&gt; default: Box &#039;ub1310-puppet&#039; could not be found. Attempting to find and install...\n    default: Box Provider: virtualbox\n    default: Box Version: &gt;= 0\n==&gt; default: Adding box &#039;ub1310-puppet&#039; (v0) for provider: virtualbox\n    default: Downloading: http:\/\/puppet-vagrant-boxes.puppetlabs.com\/ubuntu-1310-x64-virtualbox-puppet.box\n==&gt; default: Successfully added box &#039;ub1310-puppet&#039; (v0) for &#039;virtualbox&#039;!\n==&gt; default: Importing base box &#039;ub1310-puppet&#039;...\n==&gt; default: Matching MAC address for NAT networking...\n==&gt; default: Setting the name of the VM: ub1310-puppet_default_1401608862255_31673\n==&gt; default: Clearing any previously set network interfaces...\n==&gt; default: Preparing network interfaces based on configuration...\n    default: Adapter 1: nat\n==&gt; default: Forwarding ports...\n    default: 22 =&gt; 2222 (adapter 1)\n==&gt; default: Booting VM...\n==&gt; default: Waiting for machine to boot. This may take a few minutes...\n    default: SSH address: 127.0.0.1:2222\n    default: SSH username: vagrant\n    default: SSH auth method: private key\n    default: Warning: Connection timeout. Retrying...\n    default: Warning: Connection timeout. Retrying...\n    default: Warning: Remote connection disconnect. Retrying...\n==&gt; default: Machine booted and ready!\n==&gt; default: Checking for guest additions in VM...\n==&gt; default: Mounting shared folders...\n    default: \/vagrant =&gt; \/home\/miyamiya\/vagrant\/ub1310-puppet<\/code><\/pre>\n<h2>3. Vagrant \u3067\u4f5c\u3063\u305f\u4eee\u60f3\u30de\u30b7\u30f3\u306b\u63a5\u7d9a\u3059\u308b<\/h2>\n<p>\u4f5c\u6210\u3057\u305f\u4eee\u60f3\u30de\u30b7\u30f3\u306b\u63a5\u7d9a\u3059\u308b\u306b\u306f vagrant ssh \u3068\u53e9\u304f\u3002<\/p>\n<pre><code class=\"language-bash\">$ vagrant ssh\nWelcome to Ubuntu 13.10 (GNU\/Linux 3.11.0-12-generic x86_64)\n\n * Documentation:  https:\/\/help.ubuntu.com\/\nLast login: Thu Jan 16 16:49:46 2014 from 10.0.2.2\nvagrant@ubuntu1310:~$<\/code><\/pre>\n<p>\u5b9f\u306f\u306a\u305c\u304b\u4e00\u56de\u76ee\u8d77\u52d5\u3057\u304d\u308c\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u505c\u6b62\u524a\u9664\u3092\u3057\u3066\u4f5c\u308a\u306a\u304a\u3057\u305f\u3002<\/p>\n<pre><code class=\"language-bash\">$ vagrant halt      # \u4eee\u60f3\u30de\u30b7\u30f3\u306e\u505c\u6b62\n$ vagrant destroy   # \u4eee\u60f3\u30de\u30b7\u30f3\u306e\u7834\u68c4\n$ vagrant up        # \u4eee\u60f3\u30de\u30b7\u30f3\u306e\u4f5c\u6210\u3068\u8d77\u52d5<\/code><\/pre>\n<p>\u3068\u308a\u3042\u3048\u305a\u3053\u3093\u306a\u3068\u3053\u304b\u306a\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/knowledge.sakura.ad.jp\/tech\/1552\/\">\u53c2\u8003\u30b5\u30a4\u30c8\uff1a\u4eee\u60f3\u74b0\u5883\u69cb\u7bc9\u30c4\u30fc\u30eb\u300cVagrant\u300d\u3067\u958b\u767a\u74b0\u5883\u3092\u4eee\u60f3\u30de\u30b7\u30f3\u4e0a\u306b\u81ea\u52d5\u4f5c\u6210\u3059\u308b<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u3053\u306e 2 \u5e74\u3068\u3066\u3082\u3058\u3083\u306a\u3044\u3051\u3069\u8272\u3005\u8a66\u3059\u4f59\u88d5\u304c\u5fc3\u8eab\u5171\u306b\u306a\u304b\u3063\u305f\u3002\u4f55\u5ea6\u4f1a\u793e\u3092\u8f9e\u3081\u3088\u3046\u304b\u3068\u601d\u3063\u305f\u3053\u3068\u304b\u5224\u3089\u306a\u3044\u3002 \u3053\u306e\u6b73\u306b\u306a\u3063\u3066\u3059\u308a\u6e1b\u3089\u3055\u308c\u308b\u306e\u306f\u30ad\u30c4\u30a4\u3002 \u6700\u8fd1\u3001\u3084\u3063\u3068\u5c11\u3057\u3060\u3051\u4f59\u88d5\u304c\u898b\u3048\u3066\u304d\u305f\u3002\u5468\u308a\u3067\u306f\u5f53\u305f\u308a\u524d\u306e\u3088\u3046 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,15],"tags":[56,55],"class_list":["post-738","post","type-post","status-publish","format-standard","hentry","category-linux","category-virtualization","tag-puppet","tag-vagrant"],"_links":{"self":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=738"}],"version-history":[{"count":20,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/738\/revisions"}],"predecessor-version":[{"id":3088,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/738\/revisions\/3088"}],"wp:attachment":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}