--- /dev/null
+berkshelf-api-server-ya CHANGELOG
+=================================
+
+This file is used to list changes made in each version of the berkshelf-api-server-ya cookbook.
+
+0.1.0
+-----
+- [your_name] - Initial release of berkshelf-api-server-ya
+
+- - -
+Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.
+
+The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.
--- /dev/null
+berkshelf-api-server-ya Cookbook
+================================
+TODO: Enter the cookbook description here.
+
+e.g.
+This cookbook makes your favorite breakfast sandwich.
+
+Requirements
+------------
+TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
+
+e.g.
+#### packages
+- `toaster` - berkshelf-api-server-ya needs toaster to brown your bagel.
+
+Attributes
+----------
+TODO: List your cookbook attributes here.
+
+e.g.
+#### berkshelf-api-server-ya::default
+<table>
+ <tr>
+ <th>Key</th>
+ <th>Type</th>
+ <th>Description</th>
+ <th>Default</th>
+ </tr>
+ <tr>
+ <td><tt>['berkshelf-api-server-ya']['bacon']</tt></td>
+ <td>Boolean</td>
+ <td>whether to include bacon</td>
+ <td><tt>true</tt></td>
+ </tr>
+</table>
+
+Usage
+-----
+#### berkshelf-api-server-ya::default
+TODO: Write usage instructions for each cookbook.
+
+e.g.
+Just include `berkshelf-api-server-ya` in your node's `run_list`:
+
+```json
+{
+ "name":"my_node",
+ "run_list": [
+ "recipe[berkshelf-api-server-ya]"
+ ]
+}
+```
+
+Contributing
+------------
+TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
+
+e.g.
+1. Fork the repository on Github
+2. Create a named feature branch (like `add_component_x`)
+3. Write your change
+4. Write tests for your change (if applicable)
+5. Run the tests, ensuring they all pass
+6. Submit a Pull Request using Github
+
+License and Authors
+-------------------
+Authors: TODO: List authors
--- /dev/null
+#
+# Cookbook Name:: berkshelf-api-server
+# Attributes:: default
+#
+# Copyright 2015, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+default[:berkshelf_api][:app_host] = '0.0.0.0'
+default[:berkshelf_api][:proxy][:ssl] = false
+default[:berkshelf_api][:proxy][:ssl_certificate] = ''
+default[:berkshelf_api][:proxy][:ssl_certificate_key] = ''
+
--- /dev/null
+name 'berkshelf-api-server-ya'
+maintainer 'whitestar'
+maintainer_email ''
+license 'Apache 2.0'
+description 'Installs/Configures berkshelf-api-server-ya'
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version '0.1.0'
+
+depends 'berkshelf-api-server', '>=2.1.1'
+
--- /dev/null
+#
+# Cookbook Name:: berkshelf-api-server-ya
+# Recipe:: default
+#
+# Copyright 2015, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe 'berkshelf-api-server::app'
+
+begin
+ r = resources(:runit_service => 'berks-api')
+ r.cookbook 'berkshelf-api-server-ya'
+end
+
--- /dev/null
+#
+# Cookbook Name:: berkshelf-api-server-ya
+# Recipe:: default
+#
+# Copyright 2015, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "berkshelf-api-server-ya::app"
+include_recipe "berkshelf-api-server-ya::http_proxy"
+
--- /dev/null
+#
+# Cookbook Name:: berkshelf-api-server-ya
+# Recipe:: default
+#
+# Copyright 2015, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe 'berkshelf-api-server::http_proxy'
+
+begin
+ res = resources(:template => "#{node[:nginx][:dir]}/sites-available/berks-api")
+ res.cookbook 'berkshelf-api-server-ya'
+end
+
--- /dev/null
+upstream berks_api {
+ server <%= node[:berkshelf_api][:app_host] %>:<%= node[:berkshelf_api][:port] %> fail_timeout=0;
+}
+
+server {
+ listen <%= node[:berkshelf_api][:proxy_port] %>;
+ server_name <%= node[:berkshelf_api][:host] %>;
+
+<% if node[:berkshelf_api][:proxy][:ssl] then -%>
+ ssl on;
+ ssl_certificate <%= node[:berkshelf_api][:proxy][:ssl_certificate] %>;
+ ssl_certificate_key <%= node[:berkshelf_api][:proxy][:ssl_certificate_key] %>;
+
+<% end -%>
+ location / {
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $http_host;
+ proxy_redirect off;
+ if (!-f $request_filename) {
+ proxy_pass http://berks_api;
+ break;
+ }
+ }
+}
--- /dev/null
+#!/bin/sh
+exec svlogd -tt ./main
--- /dev/null
+#!/bin/sh
+
+export PATH=/opt/chef/embedded/bin:$PATH
+export HOME=<%= node[:berkshelf_api][:deploy_path] %>
+cd $HOME
+
+exec 2>&1
+exec chpst -u <%= node[:berkshelf_api][:owner] %> bundle exec bin/berks-api -h <%= node[:berkshelf_api][:app_host] %> -p <%= node[:berkshelf_api][:port] %> -c <%= node[:berkshelf_api][:config_path] %>
description 'Berkshelf dependency API server'
run_list(
- 'recipe[berkshelf-api-server::default]',
+ 'recipe[berkshelf-api-server-ya::default]',
)
#env_run_lists()
],
'build_interval' => 180.0
},
+ 'app_host' => '127.0.0.1',
'host' => "gpm00.#{Grid::DOMAIN}",
'port' => 26200,
'proxy_port' => 6280,
+ 'proxy' => {
+ 'ssl' => true,
+ 'ssl_certificate' => '/etc/pki/tls/certs/01gpm00_server.crt',
+ 'ssl_certificate_key' => '/etc/pki/tls/private/01gpm00_server.key',
+ }
},
'ganglia' => {
# gmond