Skip to content

Commit 2129199

Browse files
committed
Merge pull request #7 from maf23/role_refactor
Role refactor
2 parents aba833f + b682ef0 commit 2129199

5 files changed

+50
-4
lines changed

Diff for: recipes/application_server.rb

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Cookbook Name:: docker-registry
3+
# Recipe:: application_server
4+
# Author:: Raul E Rangel (<[email protected]>)
5+
#
6+
# Copyright 2014, Raul E Rangel
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
#
20+
21+
node.default['docker-registry']['application_server'] = true
22+
23+
include_recipe "docker-registry"

Diff for: recipes/default.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
end
128128

129129
gunicorn do
130-
only_if { node['roles'].include?('docker-registry_application_server') }
130+
only_if { node['docker-registry']['application_server'] }
131131

132132
requirements "requirements.txt"
133133
max_requests node['docker-registry']['max_requests']
@@ -141,7 +141,7 @@
141141
end
142142

143143
nginx_load_balancer do
144-
only_if { node['roles'].include?('docker-registry_load_balancer') }
144+
only_if { node['docker-registry']['load_balancer'] }
145145

146146
application_port node['docker-registry']['internal_port']
147147
application_server_role node['docker-registry']['application_server_role']

Diff for: recipes/load_balancer.rb

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Cookbook Name:: docker-registry
3+
# Recipe:: load_balancer
4+
# Author:: Raul E Rangel (<[email protected]>)
5+
#
6+
# Copyright 2014, Raul E Rangel
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
#
20+
21+
node.default['docker-registry']['load_balancer'] = true
22+
23+
include_recipe "docker-registry"

Diff for: roles/docker-registry_application_server.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"chef_type": "role",
1010
"run_list": [
11-
"recipe[docker-registry]"
11+
"recipe[docker-registry::application_server]"
1212
],
1313
"env_run_lists": {
1414
}

Diff for: roles/docker-registry_load_balancer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"chef_type": "role",
1717
"run_list": [
18-
"recipe[docker-registry]"
18+
"recipe[docker-registry::load_balancer]"
1919
],
2020
"env_run_lists": {
2121
}

0 commit comments

Comments
 (0)