Only add user to docker group if docker group exists (doesn't in recent Fedora docker-io installs)
This commit is contained in:
parent
a755cf285a
commit
be2643d40d
|
@ -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