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-clientrecipe to all nodes and sets the default sources used for all policies.polices/db.rb–dbpolicy to create a Postgres database server. This applies thevandelay-postgresrecipe.policies/web.rb–webpolicy to create an Apache web server. This applies thevandelay-httpdrecipe.
Each policy has a corresponding lockfile.
policies/db.lock.json– Lockfile for thedbpolicy.policies/web.lock.json– Lockfile for thewebpolicy.
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 communityhttpdcookbook.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 thedbpolicy. Usespsqlto confirm the database is operational.test/integration/web/web_spec.rb– Tests for thewebpolicy. Usescurlto 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.