@@ -19,7 +19,7 @@ class ConsulConfig < Chef::Resource
19
19
20
20
# @!attribute owner
21
21
# @return [String]
22
- attribute ( :user , kind_of : String , default : 'consul' )
22
+ attribute ( :owner , kind_of : String , default : 'consul' )
23
23
24
24
# @!attribute group
25
25
# @return [String]
@@ -33,6 +33,10 @@ class ConsulConfig < Chef::Resource
33
33
# @return [String]
34
34
attribute ( :bag_item , kind_of : String , default : 'secrets' )
35
35
36
+ # @!attribute options
37
+ # @return [Hash]
38
+ attribute ( :options , option_collector : true )
39
+
36
40
# @see: http://www.consul.io/docs/agent/options.html
37
41
attribute ( :acl_datacenter , kind_of : String )
38
42
attribute ( :acl_default_policy , kind_of : String )
@@ -65,7 +69,7 @@ class ConsulConfig < Chef::Resource
65
69
attribute ( :node_name , kind_of : String )
66
70
attribute ( :ports , kind_of : [ Hash , Mash ] )
67
71
attribute ( :protocol , kind_of : String )
68
- attribute ( :recurser , kind_of : String )
72
+ attribute ( :recursor , kind_of : String )
69
73
attribute ( :retry_interval , kind_of : Integer )
70
74
attribute ( :server , equal_to : [ true , false ] , default : true )
71
75
attribute ( :server_name , kind_of : String )
@@ -87,7 +91,7 @@ def to_json
87
91
for_keeps << %i{ ca_file cert_file key_file } if tls?
88
92
config = to_hash . keep_if do |k , _ |
89
93
for_keeps . include? ( k . to_sym )
90
- end
94
+ end . merge ( options )
91
95
JSON . pretty_generate ( config , quirks_mode : true )
92
96
end
93
97
@@ -108,7 +112,7 @@ def tls?
108
112
file new_resource . ca_file do
109
113
content item [ 'ca_certificate' ]
110
114
mode '0644'
111
- owner new_resource . user
115
+ owner new_resource . owner
112
116
group new_resource . group
113
117
end
114
118
@@ -119,7 +123,7 @@ def tls?
119
123
file new_resource . cert_file do
120
124
content item [ 'certificate' ]
121
125
mode '0644'
122
- owner new_resource . user
126
+ owner new_resource . owner
123
127
group new_resource . group
124
128
end
125
129
@@ -131,7 +135,7 @@ def tls?
131
135
sensitive true
132
136
content item [ 'private_key' ]
133
137
mode '0640'
134
- owner new_resource . user
138
+ owner new_resource . owner
135
139
group new_resource . group
136
140
end
137
141
end
@@ -141,7 +145,7 @@ def tls?
141
145
end
142
146
143
147
file new_resource . path do
144
- owner new_resource . user
148
+ owner new_resource . owner
145
149
group new_resource . group
146
150
content new_resource . to_json
147
151
mode '0640'
0 commit comments