RightScale's cookbook for application server management.
This is an abstract cookbook that defines the recipes and interface to
application provider cookbooks. It is not a standalone cookbook and must be
used in conjunction with an application provider cookbook (i.e.
app_php
, app_tomcat
, app_passenger
, app_django
or a user created
application provider).
More detailed information can be found in the descriptions for each recipe in
the cookbook. app::*
.
- Requires a VM launched from a RightScale managed RightImage
- Requires a corresponding app provider cookbook
Please see metadata.rb
file for the latest dependencies.
sys_firewall
rightscale
repo
app_php
app_passenger
app_tomcat
app_django
There are no known limitations.
In order to use App resource, you must create corresponding providers in your
app server cookbook. For examples, see app_passenger
, app_php
, app_django
or app_tomcat
cookbooks.
You must define app attributes which will be used in the initialized
app[default]
resource.
Required attributes:
node[:app][:provider] = "app_passenger"
Recommended:
node[:app][:destination]
node[:app][:port]
node[:app][:root]
node[:app][:database_name]
node[:app][:database_user]
node[:app][:database_password]
node[:app][:database_server_fqdn]
node[:app][:db_adapter]
node[:app][:user]
node[:app][:group]
More detailed descriptions of these attribute variables is located in the resource file's description.
- Add the
app_*::default
recipe prior to theapp::default
recipe to define the provider. - Add the default recipe to tag your server as an appserver. This is used by servers (like databases) to identify their clients.
- Add desired
app::do_*
recipes to your application server ServerTemplate. - Develop corresponding providers in your application server's cookbook.
- Define required and recommended attributes in your application server's cookbook attributes file.
This cookbook can only be used in conjunction with cookbooks that contain
Lightweight Providers which implement the 'app' interface. See the RightScale
app_php
cookbook for an example.
Note: app[default]
resource uses the "persist true" flag, which allows you to
save the created resource and its attributes in memory for future use.
This cookbook contains recipes that are required to connect your instance to RightScale's "Load Balancer" ServerTemplates:
do_loadbalancers_allow
do_loadbalancers_deny
request_loadbalancer_allow
request_loadbalancer_deny
For more info please see: Load Balancer Setups.
node[:app][:provider]
- Set a default provider.node[:app][:port]
- Set a default port to listen on. Default: 8000node[:app][:ip]
- IP to listen on. Default: First private IPnode[:app][:user]
- Application server user. Required for changing owner of created project dirs.node[:app][:group]
- Application server group. Required for changing owner of created project dirs.
app_add_listen_port
Adds a port to the apache listen 'ports.conf' file and node attribute.
Create node[:apache][:listen_ports]
- array of strings for the web server to
listen on.
This definition created specifically for the apache2
cookbook at this time.
app_add_listen_port php_port
Created to convert vhost names into an array from a comma-separated list.
Parameters
vhost_list(Sting)::
Comma-separated list of virtual hosts.
Returns
Array::
Array of vhosts
This cookbook provides the abstract app
resource, which will act as
an "interface" for corresponding Lightweight app_* providers.
This includes app_php
, app_tomcat
, app_passenger
and app_django
cookbooks. Each of them contains an implementation of the corresponding app__*
Lightweight Provider which can be called using this resource.
To avoid unexpected failures, the Provider persisted in this cookbook will act as a cap if there is no other app_ Light Weight Provider implementation.
For more information about Lightweight Resources and Providers (LWRPs), please see: Lightweight Resources and Providers (LWRP).
All actions declared in this resource are intended to act as templates to typical application server setup operations.
:install
- Install packages required for application server setup.:setup_vhost
- Action designed to set up APP LWRP with common parameters required for apache vhost file.:start
- Action designed to set up a user defined start sequence for the application server.:stop
- Action designed to set up a user defined stop sequence for the application server.:restart
- Action designed to set up a user defined restart sequence for the application server.:reload
- Action designed to set up a user defined reload sequence for the application server.:code_update
- Action designed to perform project source code update/download.:setup_db_connection
- Action designed to perform database configuration file creation.:setup_monitoring
- Action designed to set up and install required monitoring software.
packages
- Set of installed packagesroot
- Application rootport
- Application portdestination
- The path on the instance where the application code will be placeddatabase_name
- Name of the required databasedatabase_user
- Database userdatabase_password
- Database passworddatabase_server_fqdn
- Database server's fully qualified domain name (FQDN)user
- App usergroup
- Group the app user belongs to
Below are a few basic examples. More detailed examples of this resource use can
be found in the do_*
and setup_*
recipes in the cookbook.
app "default" do
persist true
provider node[:app][:provider]
packages node[:app][:packages]
action :install
end
app "default" do
database_name node[:app][:database_name]
database_user node[:app][:database_user]
database_password node[:app][:database_password]
database_server_fqdn node[:app][:database_server_fqdn]
action :setup_db_connection
end
app "default" do
root node[:app][:root]
port node[:app][:port].to_i
action :setup_vhost
end
Copyright RightScale, Inc. All rights reserved. All access and use subject to the RightScale Terms of Service available at http://www.rightscale.com/terms.php and, if applicable, other agreements such as a RightScale Master Subscription Agreement.