{"action":"created","comment":{"url":"https://api.github.com/repos/ranjib/chef-lxc/pulls/comments/36679003","id":36679003,"diff_hunk":"@@ -0,0 +1,66 @@\n+# -*- mode: ruby -*-\n+# vi: set ft=ruby :\n+\n+Vagrant.configure(2) do |config|\n+  config.vm.box = \"ubuntu/trusty64\"\n+\n+  # Create a private network, which allows host-only access to the machine\n+  # using a specific IP.\n+  # config.vm.network \"private_network\", ip: \"192.168.33.10\"\n+\n+  config.vm.synced_folder '.', '/test'\n+\n+  config.vm.provision \"shell\", privileged: true, inline: <<-SHELL\n+    apt-get update\n+    apt-get install -y \\\n+      ruby2.0 \\\n+      ruby2.0-dev \\\n+      git \\\n+      make \\\n+      gcc \\\n+      lxc \\\n+      libcap2 \\\n+      libapparmor1 \\\n+      libselinux1 \\\n+      libseccomp2 \\\n+      libgnutls28 \\\n+      python3-dev \\\n+      lxc \\\n+      lxc-dev \\\n+\n+    gem2.0 install bundler\n+  SHELL\n+\n+  lxc_config = <<-CONFIG\n+    lxc.network.type = veth\n+    lxc.network.link = lxcbr0\n+    lxc.network.flags = up\n+    lxc.network.hwaddr = 00:16:3e:xx:xx:xx\n+    lxc.id_map = u 0 100000 65536\n+    lxc.id_map = g 0 100000 65536\n+  CONFIG\n+\n+  lxc_usernet = 'vagrant veth lxcbr0 10'\n+  lxc_conf = 'lxc.lxcpath = /home/vagrant/.local/share/lxc'\n+\n+  config.vm.provision \"shell\", privileged: false, inline: <<-SHELL\n+    mkdir -p /home/vagrant/.config/lxc /home/vagrant/.local/share/lxc /home/vagrant/.cache/lxc\n+    echo \"#{lxc_config}\" | tee /home/vagrant/.config/lxc/default.conf\n+    echo \"#{lxc_usernet}\" | sudo tee /etc/lxc/lxc-usernet\n+    echo \"#{lxc_usernet}\" | tee /home/vagrant/.config/lxc/lxc.conf\n+  SHELL\n+\n+  config.vm.provision 'shell', inline: <<-SHELL\n+    cd /test\n+    # don't put the bundle in the mounted directory -- too slow :)\n+    bundle package --all --path=/test-vendor/cache\n+    bundle install --path=/test-vendor/bundle --local\n+  SHELL\n+\n+  config.vm.provision 'shell', inline: <<-SHELL\n+    if [ ! -e /home/vagrant/lxc-configured ]; then\n+      touch /home/vagrant/lxc-configured\n+      sudo reboot\n+    fi\n+  SHELL\n+end","path":"Vagrantfile","position":66,"original_position":66,"commit_id":"fdc6e5d1240ed6774409413edfe9a68f7d83f2ab","original_commit_id":"fdc6e5d1240ed6774409413edfe9a68f7d83f2ab","user":{"login":"margueritepd","id":12139316,"avatar_url":"https://avatars.githubusercontent.com/u/12139316?v=3","gravatar_id":"","url":"https://api.github.com/users/margueritepd","html_url":"https://github.com/margueritepd","followers_url":"https://api.github.com/users/margueritepd/followers","following_url":"https://api.github.com/users/margueritepd/following{/other_user}","gists_url":"https://api.github.com/users/margueritepd/gists{/gist_id}","starred_url":"https://api.github.com/users/margueritepd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margueritepd/subscriptions","organizations_url":"https://api.github.com/users/margueritepd/orgs","repos_url":"https://api.github.com/users/margueritepd/repos","events_url":"https://api.github.com/users/margueritepd/events{/privacy}","received_events_url":"https://api.github.com/users/margueritepd/received_events","type":"User","site_admin":false},"body":"@ranjib I'll remove it. Would be nice to have support for non-ubuntu or non-lxc users to run unit tests, though. It took me quite a while to come up with an environment that would do it.","created_at":"2015-08-10T20:18:43Z","updated_at":"2015-08-10T20:18:43Z","html_url":"https://github.com/ranjib/chef-lxc/pull/13#discussion_r36679003","pull_request_url":"https://api.github.com/repos/ranjib/chef-lxc/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/ranjib/chef-lxc/pulls/comments/36679003"},"html":{"href":"https://github.com/ranjib/chef-lxc/pull/13#discussion_r36679003"},"pull_request":{"href":"https://api.github.com/repos/ranjib/chef-lxc/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/ranjib/chef-lxc/pulls/13","id":42028016,"html_url":"https://github.com/ranjib/chef-lxc/pull/13","diff_url":"https://github.com/ranjib/chef-lxc/pull/13.diff","patch_url":"https://github.com/ranjib/chef-lxc/pull/13.patch","issue_url":"https://api.github.com/repos/ranjib/chef-lxc/issues/13","number":13,"state":"open","locked":false,"title":"Let knife helper update single entries in a data bag item","user":{"login":"margueritepd","id":12139316,"avatar_url":"https://avatars.githubusercontent.com/u/12139316?v=3","gravatar_id":"","url":"https://api.github.com/users/margueritepd","html_url":"https://github.com/margueritepd","followers_url":"https://api.github.com/users/margueritepd/followers","following_url":"https://api.github.com/users/margueritepd/following{/other_user}","gists_url":"https://api.github.com/users/margueritepd/gists{/gist_id}","starred_url":"https://api.github.com/users/margueritepd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margueritepd/subscriptions","organizations_url":"https://api.github.com/users/margueritepd/orgs","repos_url":"https://api.github.com/users/margueritepd/repos","events_url":"https://api.github.com/users/margueritepd/events{/privacy}","received_events_url":"https://api.github.com/users/margueritepd/received_events","type":"User","site_admin":false},"body":"- this is not very concurrency safe\r\n- any ideas on how to improve my unit tests would be great!\r\n- I'm thinking that since knife-helper has nothing to do with lxc, maybe it should be its own gem or something. But I don't know what that would look like...\r\n\r\nIf you like the idea of a vagrantfile, I can add info to the README","created_at":"2015-08-10T14:48:40Z","updated_at":"2015-08-10T20:18:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6820c21804f26f6caea9c2dbcbc8db4e6094872","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ranjib/chef-lxc/pulls/13/commits","review_comments_url":"https://api.github.com/repos/ranjib/chef-lxc/pulls/13/comments","review_comment_url":"https://api.github.com/repos/ranjib/chef-lxc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ranjib/chef-lxc/issues/13/comments","statuses_url":"https://api.github.com/repos/ranjib/chef-lxc/statuses/fdc6e5d1240ed6774409413edfe9a68f7d83f2ab","head":{"label":"margueritepd:update-data-bag-item","ref":"update-data-bag-item","sha":"fdc6e5d1240ed6774409413edfe9a68f7d83f2ab","user":{"login":"margueritepd","id":12139316,"avatar_url":"https://avatars.githubusercontent.com/u/12139316?v=3","gravatar_id":"","url":"https://api.github.com/users/margueritepd","html_url":"https://github.com/margueritepd","followers_url":"https://api.github.com/users/margueritepd/followers","following_url":"https://api.github.com/users/margueritepd/following{/other_user}","gists_url":"https://api.github.com/users/margueritepd/gists{/gist_id}","starred_url":"https://api.github.com/users/margueritepd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margueritepd/subscriptions","organizations_url":"https://api.github.com/users/margueritepd/orgs","repos_url":"https://api.github.com/users/margueritepd/repos","events_url":"https://api.github.com/users/margueritepd/events{/privacy}","received_events_url":"https://api.github.com/users/margueritepd/received_events","type":"User","site_admin":false},"repo":{"id":40403911,"name":"chef-lxc","full_name":"margueritepd/chef-lxc","owner":{"login":"margueritepd","id":12139316,"avatar_url":"https://avatars.githubusercontent.com/u/12139316?v=3","gravatar_id":"","url":"https://api.github.com/users/margueritepd","html_url":"https://github.com/margueritepd","followers_url":"https://api.github.com/users/margueritepd/followers","following_url":"https://api.github.com/users/margueritepd/following{/other_user}","gists_url":"https://api.github.com/users/margueritepd/gists{/gist_id}","starred_url":"https://api.github.com/users/margueritepd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margueritepd/subscriptions","organizations_url":"https://api.github.com/users/margueritepd/orgs","repos_url":"https://api.github.com/users/margueritepd/repos","events_url":"https://api.github.com/users/margueritepd/events{/privacy}","received_events_url":"https://api.github.com/users/margueritepd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/margueritepd/chef-lxc","description":"Build LXC using Chef","fork":true,"url":"https://api.github.com/repos/margueritepd/chef-lxc","forks_url":"https://api.github.com/repos/margueritepd/chef-lxc/forks","keys_url":"https://api.github.com/repos/margueritepd/chef-lxc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/margueritepd/chef-lxc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/margueritepd/chef-lxc/teams","hooks_url":"https://api.github.com/repos/margueritepd/chef-lxc/hooks","issue_events_url":"https://api.github.com/repos/margueritepd/chef-lxc/issues/events{/number}","events_url":"https://api.github.com/repos/margueritepd/chef-lxc/events","assignees_url":"https://api.github.com/repos/margueritepd/chef-lxc/assignees{/user}","branches_url":"https://api.github.com/repos/margueritepd/chef-lxc/branches{/branch}","tags_url":"https://api.github.com/repos/margueritepd/chef-lxc/tags","blobs_url":"https://api.github.com/repos/margueritepd/chef-lxc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/margueritepd/chef-lxc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/margueritepd/chef-lxc/git/refs{/sha}","trees_url":"https://api.github.com/repos/margueritepd/chef-lxc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/margueritepd/chef-lxc/statuses/{sha}","languages_url":"https://api.github.com/repos/margueritepd/chef-lxc/languages","stargazers_url":"https://api.github.com/repos/margueritepd/chef-lxc/stargazers","contributors_url":"https://api.github.com/repos/margueritepd/chef-lxc/contributors","subscribers_url":"https://api.github.com/repos/margueritepd/chef-lxc/subscribers","subscription_url":"https://api.github.com/repos/margueritepd/chef-lxc/subscription","commits_url":"https://api.github.com/repos/margueritepd/chef-lxc/commits{/sha}","git_commits_url":"https://api.github.com/repos/margueritepd/chef-lxc/git/commits{/sha}","comments_url":"https://api.github.com/repos/margueritepd/chef-lxc/comments{/number}","issue_comment_url":"https://api.github.com/repos/margueritepd/chef-lxc/issues/comments{/number}","contents_url":"https://api.github.com/repos/margueritepd/chef-lxc/contents/{+path}","compare_url":"https://api.github.com/repos/margueritepd/chef-lxc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/margueritepd/chef-lxc/merges","archive_url":"https://api.github.com/repos/margueritepd/chef-lxc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/margueritepd/chef-lxc/downloads","issues_url":"https://api.github.com/repos/margueritepd/chef-lxc/issues{/number}","pulls_url":"https://api.github.com/repos/margueritepd/chef-lxc/pulls{/number}","milestones_url":"https://api.github.com/repos/margueritepd/chef-lxc/milestones{/number}","notifications_url":"https://api.github.com/repos/margueritepd/chef-lxc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/margueritepd/chef-lxc/labels{/name}","releases_url":"https://api.github.com/repos/margueritepd/chef-lxc/releases{/id}","created_at":"2015-08-08T13:35:57Z","updated_at":"2015-08-08T13:35:58Z","pushed_at":"2015-08-10T14:48:10Z","git_url":"git://github.com/margueritepd/chef-lxc.git","ssh_url":"git@github.com:margueritepd/chef-lxc.git","clone_url":"https://github.com/margueritepd/chef-lxc.git","svn_url":"https://github.com/margueritepd/chef-lxc","homepage":"","size":119,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ranjib:master","ref":"master","sha":"39441665463cd1cce449544e5412689675f08da9","user":{"login":"ranjib","id":316306,"avatar_url":"https://avatars.githubusercontent.com/u/316306?v=3","gravatar_id":"","url":"https://api.github.com/users/ranjib","html_url":"https://github.com/ranjib","followers_url":"https://api.github.com/users/ranjib/followers","following_url":"https://api.github.com/users/ranjib/following{/other_user}","gists_url":"https://api.github.com/users/ranjib/gists{/gist_id}","starred_url":"https://api.github.com/users/ranjib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ranjib/subscriptions","organizations_url":"https://api.github.com/users/ranjib/orgs","repos_url":"https://api.github.com/users/ranjib/repos","events_url":"https://api.github.com/users/ranjib/events{/privacy}","received_events_url":"https://api.github.com/users/ranjib/received_events","type":"User","site_admin":false},"repo":{"id":16353732,"name":"chef-lxc","full_name":"ranjib/chef-lxc","owner":{"login":"ranjib","id":316306,"avatar_url":"https://avatars.githubusercontent.com/u/316306?v=3","gravatar_id":"","url":"https://api.github.com/users/ranjib","html_url":"https://github.com/ranjib","followers_url":"https://api.github.com/users/ranjib/followers","following_url":"https://api.github.com/users/ranjib/following{/other_user}","gists_url":"https://api.github.com/users/ranjib/gists{/gist_id}","starred_url":"https://api.github.com/users/ranjib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ranjib/subscriptions","organizations_url":"https://api.github.com/users/ranjib/orgs","repos_url":"https://api.github.com/users/ranjib/repos","events_url":"https://api.github.com/users/ranjib/events{/privacy}","received_events_url":"https://api.github.com/users/ranjib/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ranjib/chef-lxc","description":"Build LXC using Chef","fork":false,"url":"https://api.github.com/repos/ranjib/chef-lxc","forks_url":"https://api.github.com/repos/ranjib/chef-lxc/forks","keys_url":"https://api.github.com/repos/ranjib/chef-lxc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ranjib/chef-lxc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ranjib/chef-lxc/teams","hooks_url":"https://api.github.com/repos/ranjib/chef-lxc/hooks","issue_events_url":"https://api.github.com/repos/ranjib/chef-lxc/issues/events{/number}","events_url":"https://api.github.com/repos/ranjib/chef-lxc/events","assignees_url":"https://api.github.com/repos/ranjib/chef-lxc/assignees{/user}","branches_url":"https://api.github.com/repos/ranjib/chef-lxc/branches{/branch}","tags_url":"https://api.github.com/repos/ranjib/chef-lxc/tags","blobs_url":"https://api.github.com/repos/ranjib/chef-lxc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ranjib/chef-lxc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ranjib/chef-lxc/git/refs{/sha}","trees_url":"https://api.github.com/repos/ranjib/chef-lxc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ranjib/chef-lxc/statuses/{sha}","languages_url":"https://api.github.com/repos/ranjib/chef-lxc/languages","stargazers_url":"https://api.github.com/repos/ranjib/chef-lxc/stargazers","contributors_url":"https://api.github.com/repos/ranjib/chef-lxc/contributors","subscribers_url":"https://api.github.com/repos/ranjib/chef-lxc/subscribers","subscription_url":"https://api.github.com/repos/ranjib/chef-lxc/subscription","commits_url":"https://api.github.com/repos/ranjib/chef-lxc/commits{/sha}","git_commits_url":"https://api.github.com/repos/ranjib/chef-lxc/git/commits{/sha}","comments_url":"https://api.github.com/repos/ranjib/chef-lxc/comments{/number}","issue_comment_url":"https://api.github.com/repos/ranjib/chef-lxc/issues/comments{/number}","contents_url":"https://api.github.com/repos/ranjib/chef-lxc/contents/{+path}","compare_url":"https://api.github.com/repos/ranjib/chef-lxc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ranjib/chef-lxc/merges","archive_url":"https://api.github.com/repos/ranjib/chef-lxc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ranjib/chef-lxc/downloads","issues_url":"https://api.github.com/repos/ranjib/chef-lxc/issues{/number}","pulls_url":"https://api.github.com/repos/ranjib/chef-lxc/pulls{/number}","milestones_url":"https://api.github.com/repos/ranjib/chef-lxc/milestones{/number}","notifications_url":"https://api.github.com/repos/ranjib/chef-lxc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ranjib/chef-lxc/labels{/name}","releases_url":"https://api.github.com/repos/ranjib/chef-lxc/releases{/id}","created_at":"2014-01-29T18:16:08Z","updated_at":"2015-05-27T19:06:34Z","pushed_at":"2015-08-10T14:48:40Z","git_url":"git://github.com/ranjib/chef-lxc.git","ssh_url":"git@github.com:ranjib/chef-lxc.git","clone_url":"https://github.com/ranjib/chef-lxc.git","svn_url":"https://github.com/ranjib/chef-lxc","homepage":"","size":363,"stargazers_count":8,"watchers_count":8,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ranjib/chef-lxc/pulls/13"},"html":{"href":"https://github.com/ranjib/chef-lxc/pull/13"},"issue":{"href":"https://api.github.com/repos/ranjib/chef-lxc/issues/13"},"comments":{"href":"https://api.github.com/repos/ranjib/chef-lxc/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/ranjib/chef-lxc/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/ranjib/chef-lxc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ranjib/chef-lxc/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/ranjib/chef-lxc/statuses/fdc6e5d1240ed6774409413edfe9a68f7d83f2ab"}}}}