diff --git a/README.md b/README.md index 2309ee20ea..121a86d914 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ bind_uri | TCP URI docker should bind | String | nil container_cmd_timeout | container LWRP default cmd_timeout seconds | Fixnum | 60 container_init_type | Init type for docker containers (nil, "systemd", or "upstart") | NilClass or String | `node['docker']['init_type']` docker_daemon_timeout | Timeout to wait for the docker daemon to start in seconds | Fixnum | 10 +group_members | Manage docker group members | Array of Strings | [] http_proxy | HTTP_PROXY environment variable | String | nil image_cmd_timeout | image LWRP default cmd_timeout seconds | Fixnum | 300 init_type | Init type for docker ("systemd", "sysv", or "upstart") | String | auto-detected (see attributes/default.rb) @@ -97,6 +98,7 @@ url | Repository URL for docker source | String | "https://github.com/dotcloud/d * `recipe[docker::binary]` Installs Docker binary * `recipe[docker::cgroups]` Installs/configures default platform Control Groups support * `recipe[docker::devmapper]` Installs/Configures Device Mapper +* `recipe[docker::group]` Installs/Configures docker group * `recipe[docker::lxc]` Installs/configures default platform LXC support * `recipe[docker::package]` Installs Docker via package * `recipe[docker::source]` Installs Docker via source diff --git a/attributes/default.rb b/attributes/default.rb index f0da4e81f2..dec765a46d 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -12,6 +12,7 @@ default['docker']['bind_uri'] = nil default['docker']['container_cmd_timeout'] = 60 default['docker']['docker_daemon_timeout'] = 10 +default['docker']['group_members'] = [] default['docker']['http_proxy'] = nil default['docker']['image_cmd_timeout'] = 300 default['docker']['registry_cmd_timeout'] = 60 diff --git a/metadata.rb b/metadata.rb index 7ec242cc94..4e16a9880f 100644 --- a/metadata.rb +++ b/metadata.rb @@ -10,6 +10,7 @@ recipe 'docker::binary', 'Installs Docker binary' recipe 'docker::cgroups', 'Installs/configures default platform Control Groups support' recipe 'docker::devmapper', 'Installs/Configures Device Mapper' +recipe 'docker::group', 'Installs/Configures docker group' recipe 'docker::lxc', 'Installs/configures default platform LXC support' recipe 'docker::package', 'Installs Docker via package' recipe 'docker::source', 'Installs Docker via source' diff --git a/recipes/default.rb b/recipes/default.rb index d88d38987f..d4478259c9 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -23,4 +23,5 @@ end include_recipe "docker::#{node['docker']['install_type']}" +include_recipe 'docker::group' unless node['docker']['group_members'].empty? include_recipe "docker::#{node['docker']['init_type']}" diff --git a/recipes/group.rb b/recipes/group.rb new file mode 100644 index 0000000000..0075db81f0 --- /dev/null +++ b/recipes/group.rb @@ -0,0 +1,4 @@ +group 'docker' do + members node['docker']['group_members'] + action [:create, :manage] +end