Chef:Powerful Infrastructure Automation
上QQ阅读APP看书,第一时间看更新

Modeling a simple Python application

Here we will consider a web.py application that has two primary components: a web server and a database server. We will provision one host for each role, bootstrap them, and deploy the software onto our new hosts.

Our application stack will consist of the following:

  • web.py as our web framework
  • PostgreSQL for data storage
  • EC2 for virtual hosts

We want to define two primary roles that represent our web server and our database server. In addition, we will construct a baseline role for all our servers that will supply any common data we need such as user accounts, SSH keys, network configuration data, shells, common utilities, libraries, and so on.

We will need to find or write cookbooks for the following components we will use:

  • Python
  • supervisord
  • PostgreSQL
  • User accounts
  • Our custom web application