2013-11-26 21:48:51 +00:00
|
|
|
module VagrantPlugins
|
2014-03-26 23:32:31 +00:00
|
|
|
module DockerProvisioner
|
2013-11-26 21:48:51 +00:00
|
|
|
module Cap
|
2013-12-14 00:32:15 +00:00
|
|
|
module Linux
|
2013-11-26 21:48:51 +00:00
|
|
|
module DockerConfigureVagrantUser
|
|
|
|
def self.docker_configure_vagrant_user(machine)
|
2014-01-16 18:34:08 +00:00
|
|
|
ssh_info = machine.ssh_info
|
|
|
|
|
|
|
|
machine.communicate.tap do |comm|
|
2015-02-10 18:11:39 +00:00
|
|
|
if comm.test("getent group docker") && !comm.test("id -Gn | grep docker")
|
2014-01-16 18:34:08 +00:00
|
|
|
comm.sudo("usermod -a -G docker #{ssh_info[:username]}")
|
|
|
|
end
|
|
|
|
end
|
2013-11-26 21:48:51 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|