Merge pull request #5315 from jimmidyson/non-existent-docker-group
provisioners/docker: only add user to docker group if docker group exists
This commit is contained in:
commit
734b0d6695
|
@ -7,7 +7,7 @@ module VagrantPlugins
|
||||||
ssh_info = machine.ssh_info
|
ssh_info = machine.ssh_info
|
||||||
|
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
if !comm.test("id -Gn | grep docker")
|
if comm.test("getent group docker") && !comm.test("id -Gn | grep docker")
|
||||||
comm.sudo("usermod -a -G docker #{ssh_info[:username]}")
|
comm.sudo("usermod -a -G docker #{ssh_info[:username]}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue