apt_repository 'docker' do
  uri node['u2i-jenkins']['apt']['repositories']['docker']['uri']
  distribution node['u2i-jenkins']['apt']['repositories']['docker']['distribution']
  components node['u2i-jenkins']['apt']['repositories']['docker']['components']
  key node['u2i-jenkins']['apt']['repositories']['docker']['key']
  keyserver node['u2i-jenkins']['apt']['repositories']['docker']['keyserver']
end

package 'docker-engine'

template '/etc/default/docker' do
  source 'etc/default/docker.erb'
  mode '0644'
  notifies :restart, 'service[docker]', :immediately
end

service 'docker' do
  action [:enable, :start]
end

group 'docker' do
  action :manage
  members [node['u2i-jenkins']['slave']['user']]
end
