Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

lukassup/httpd-cookbook

Repository files navigation

httpd

A demo Chef cookbook that sets up Apache httpd on a CentOS machine.

The cookbook includes three recipes:

  • recipe[httpd::default] — installs and starts only the core httpd stuff. No HTTPS will be available.
  • recipe[httpd::ssl] — meant to be used after the default recipe. Installs mod_ssl, places a certificate from a data bag item and a private key from a Chef Vault item. By default it retrieves the certficate from an item named #{node.name} (server hostname) inside the certificates data bag. It fetches the private key from a Chef Vault item named #{node.name} (server hostname) from the data bag private_keys.
  • recipe[httpd::remove] — ensures that everything created by default and ssl recipes are removed.

Test Kitchen / InSpec tests

There are three Test Kitchen scenarios tested with InSpec:

  • default: default recipe (without HTTPS)
  • https: default + ssl recipes
  • remove: provisions the https scenario and uninstalls everything afterwards

See it run:

$ chef exec kitchen test default
$ chef exec kitchen test https
$ chef exec kitchen test remove

ChefSpec tests

$ chef exec rspec

Releases

No releases published

Packages

No packages published