This cookbook automates the installation of:
- nginx server serving requests on port 8000
- serves content from the following repo: https://github.com/puppetlabs/exercise-webpage
It also:
- ensures that the required configuration is completed reliably
- is idempotent and does not repeat redundant tasks
This cookbook installs all of its dependencies via Berkshelf and the Chef supermarket
This cookbook supports the same platforms as the nginx and git cookbooks. (Debian and RHEL families)
Key | Type | Description | Default |
---|---|---|---|
['company-webapp']['port'] | string | Port for nginx to listen on | 8000 |
['company-webapp']['gitrepo'] | string | Location of the git repo | https://github.com/puppetlabs/exercise-webpage.git |
['company-webapp']['gitbranch'] | string | Which branch to deploy from | master |
['company-webapp']['docroot'] | string | Target directory to deploy website | /var/www/nginx/default |
['company-webapp']['index'] | string | What file names nginx should use as index | index.html index.htm |
Git
- install git and clone down this repository
VirtualBox
http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html
Vagrant
http://www.vagrantup.com/downloads.html
vagrant plugin install vagrant-berkshelf
Chef DK
https://downloads.chef.io/chef-dk/
PATH
ensure that /opt/chefdk/bin is before any other Chef items in your PATH variable
Get Rolling
cd company-webapp
kitchen converge # this will instantiate a new VM and converge it
point your workstation browser to http://localhost:8000
kitchen verify # this will run the serverspec tests
kitchen login # this will allow you to log in to the VM
Include company-webapp
in your node's Chef run_list
:
{
"run_list": [
"recipe[company-webapp::default]"
]
}
Author:: Jeremy J. Miller ([email protected])