Skip to content

Commit

Permalink
Remove default attributes ['config']['owner'] and ['config']['group']
Browse files Browse the repository at this point in the history
These attributes are redundant in the default.rb attribute file since they cause
a confusion about what are default values of `owner` and `group` params
of `counsul_config` resource.

Due to Poise inversion options, the node's attribute will always have a precedence.
They are designed to be used by cookbook end-users in their wrapper cookbooks.

We already have default values defined in the resource itself, so we can
remove default attributes without any effect.
  • Loading branch information
legal90 committed May 30, 2017
1 parent eebc129 commit dfe2945
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .kitchen.dokken.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ suites:
consul:
config: &default-config
owner: root
group: consul
bootstrap: true
server: true
datacenter: FortMeade
Expand Down
1 change: 0 additions & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ suites:
consul:
config: &default-config
owner: root
group: consul
ui: true
bootstrap: true
server: true
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ end
```

### Security
The default recipe makes the Consul configuration writable by the consul service user to avoid breaking existing implementations. You can make this more secure by setting the `node['consul']['config']` attribute to `root`, or set the `owner` property of `consul_config` explicitly:
The default recipe makes the Consul configuration writable by the consul service
user to avoid breaking existing implementations. You can make this more secure
by setting the `node['consul']['config']['owner']` attribute to `root`, or set
the `owner` property of `consul_config` explicitly:

```ruby
# attributes file
Expand Down
2 changes: 0 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
default['consul']['service_group'] = 'consul'
default['consul']['create_service_user'] = true

default['consul']['config']['owner'] = 'consul'
default['consul']['config']['group'] = 'consul'
default['consul']['config']['path'] = join_path config_prefix_path, 'consul.json'
default['consul']['config']['data_dir'] = data_path
default['consul']['config']['ca_file'] = join_path config_prefix_path, 'ssl', 'CA', 'ca.crt'
Expand Down

0 comments on commit dfe2945

Please sign in to comment.