Skip to content

A Chef cookbook to setup nginx with an example web page.

Notifications You must be signed in to change notification settings

shinka81/nginx_example

Repository files navigation

nginx_example

Build Status

Description

A simple Chef cookbook to deploy an example web page using nginx. Nginx will be listening on port 8000 by default.

Cookbook attributes

Key Type Description Default
default['nginx_example']['nginx']['port'] Integer What port nginx will listen on. 8000
default['nginx_example']['remote_files']['www'] Hash Contains 1 or more hashes of remote web pages that will be downloaded and loaded with nginx. A valid hash must contain the following keys: 'uri', 'path', and 'file_name'. 'example' (see below)

Example hash structure:

default['nginx_example']['remote_files']['www']['example']['uri'] = 'https://raw.githubusercontent.com/puppetlabs/exercise-webpage/master/index.html'
default['nginx_example']['remote_files']['www']['example']['path'] = '/'
default['nginx_example']['remote_files']['www']['example']['file_name'] = 'example.html'

Cookbook Dependencies

Requirements

  • Chef 12+

Platform(s)

  • Tested on Centos 6.5 . Should also work on RHEL or Fedora with similar versions.

Usage

Apply the default recipe to the run list.

Testing

This cookbook uses berkshelf, test-kitchen, and vagrant to perform integration test. This cookbook also uses chefspec to perform unit tests. rubocop and foodcritic are used to perform linting tests.

To perform integration tests, install testing dependencies and run the automated tests. Execute:

bundle install
berks install
kitchen test

To perform unit tests, install testing dependencies and run the automated tests. Execute:

bundle install --without kitchen
bundle exec rake

Information on the latest build can also be found by clicking the travis-ci badge near the top of this README.

About

A Chef cookbook to setup nginx with an example web page.

Resources

Stars

Watchers

Forks

Packages

No packages published