This (mono-)repository serves as an example for working with the YoloVer workflow.
This Chef repository will deploy Apache and PostgreSQL for a hypothetical Vandelay Industries.
The major centerpiece of the repo are the Policyfiles.
policies/_base.rb
– Shared base policy for all servers. This applies thechef-client
recipe to all nodes and sets the default sources used for all policies.polices/db.rb
–db
policy to create a Postgres database server. This applies thevandelay-postgres
recipe.policies/web.rb
–web
policy to create an Apache web server. This applies thevandelay-httpd
recipe.
Each policy has a corresponding lockfile.
policies/db.lock.json
– Lockfile for thedb
policy.policies/web.lock.json
– Lockfile for theweb
policy.
As this is at least in part a mono-repo layout, we have an old school cookbooks/
folder containing our local cookbooks.
cookbooks/vandelay-httpd
– Wrapper cookbook around the communityhttpd
cookbook.cookbooks/vandelay-postgres
– Local cookbook to install PostgeSQL because we didn't want to use any of the community ones.
To verify that our policies are correct, we use InSpec tests.
test/integration/db/db_spec.rb
– Tests for thedb
policy. Usespsql
to confirm the database is operational.test/integration/web/web_spec.rb
– Tests for theweb
policy. Usescurl
to confirm the content of index page.
.kitchen.yml
– Test Kitchen configuration for integration tests of the policies.
Development sponsored by Bloomberg.
Copyright 2016, Noah Kantrowitz
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.