{"id":1914,"date":"2015-10-28T09:58:35","date_gmt":"2015-10-28T14:58:35","guid":{"rendered":"http:\/\/www.kickflop.net\/blog\/?p=1914"},"modified":"2015-10-28T11:11:52","modified_gmt":"2015-10-28T16:11:52","slug":"using-test-kitchen-and-kitchen-vagrant-behind-an-http-proxy","status":"publish","type":"post","link":"https:\/\/www.kickflop.net\/blog\/2015\/10\/28\/using-test-kitchen-and-kitchen-vagrant-behind-an-http-proxy\/","title":{"rendered":"Using test-kitchen and kitchen-vagrant behind an HTTP proxy"},"content":{"rendered":"<p>Here&#8217;s what got us working with test-kitchen and kitchen-vagrant behind an HTTP proxy. Comments inline.<!--more--><\/p>\n<pre>\r\n---\r\ndriver:\r\n  name: vagrant\r\n  driver_config:\r\n    # Allows fetching boxes if required\r\n    http_proxy: http:\/\/yourproxy.example.com:80\r\n    https_proxy: https:\/\/yourproxy.example.com:80\r\n  # This vagrantfiles callout is needed because of\r\n  # https:\/\/github.com\/test-kitchen\/test-kitchen\/issues\/821\r\n  # You should check that issue to see if this is still required.\r\n  vagrantfiles:\r\n    - your-site-specific-vagrantfile-block.rb\r\n  network:\r\n    - [\"private_network\", {ip: \"192.168.1.2\"}]\r\n\r\nprovisioner:\r\n  name: chef_zero\r\n  # Allows fetching Omnibus Chef installer if required\r\n  http_proxy: http:\/\/yourproxy.example.com:80\r\n  https_proxy: http:\/\/yourproxy.example.com:80\r\n\r\nplatforms:\r\n  - name: centos-6.7\r\n\r\nsuites:\r\n  - name: default\r\n    run_list:\r\n      - recipe[things::default]\r\n    attributes:\r\n      chef-client:\r\n        # Allows your Chef run to fetch stuff it requires\r\n        config:\r\n          http_proxy: \"http:\/\/yourproxy.example.com:80\"\r\n          https_proxy: \"http:\/\/yourproxy.example.com:80\"\r\n<\/pre>\n<p>And finally <code>your-site-specific-vagrantfile-block.rb<\/code>, your custom Vagrantfile piece that is merged in via the <code>vagrantfiles<\/code> directive in your YAML file:<\/p>\n<pre>\r\nunless Vagrant.has_plugin?(\"vagrant-proxyconf\")\r\n  raise \"Missing required plugin 'vagrant-proxyconf', run `vagrant plugin install vagrant-proxyconf`\"\r\nend\r\n\r\nVagrant.configure(2) do |config|\r\n  # Allows busser gem and deps to be fetched as required\r\n  config.proxy.http     = \"#{ENV['http_proxy']}\"\r\n  config.proxy.https    = \"#{ENV['https_proxy']}\"\r\n  config.proxy.no_proxy = \"localhost,127.0.0.1\"\r\nend\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s what got us working with test-kitchen and kitchen-vagrant behind an HTTP proxy. Comments inline.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51,13,48,52],"tags":[],"class_list":["post-1914","post","type-post","status-publish","format-standard","hentry","category-devops","category-tips","category-unixlinux","category-yak-shave"],"_links":{"self":[{"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/posts\/1914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/comments?post=1914"}],"version-history":[{"count":3,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/posts\/1914\/revisions"}],"predecessor-version":[{"id":1917,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/posts\/1914\/revisions\/1917"}],"wp:attachment":[{"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/media?parent=1914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/categories?post=1914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kickflop.net\/blog\/wp-json\/wp\/v2\/tags?post=1914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}