How to override templates in custom Chef recipes?
If you want to override a template that Scalarium uses in your custom Chef recipe you just need to supply the template in the correct folder structure. Scalarium/Chef will then automatically choose your template over the one that Scalarium uses by default. The standard Scalarium cookbooks are available at http://github.com/scalarium/cookbooks.
If for example you need a specially patched MySQL configuration in place, you can just supply your own version of my.cnf in your cookbooks.
Scalarium uses a Chef cookbook named mysql to create /etc/mysql/my.cnf. You can find the template in
/root/scalarium-agent/cookbooks/mysql/templates/default/my.cnf.erb
If you want to override it, just create a custom cookbook with the same name and the same template, e.g.
mysql/
templates/
default/
my.cnf.erb
This way Scalarium will choose your template during the execution of the Scalarium cookbooks.
Please not that this way you can only override templates, not recipes.
The same can be done e.g. for database.yml:
rails/
templates/
default/
database.yml.erb
For HAProxy this would look like this:
haproxy/
templates/
default/
haproxy.cfg.erb
If you want to change the vhost definition in Apache for your Rails applications :
passenger_apache2/
templates/
default/
web_app.conf.erb
Please not that this way you can only override templates, not recipes.
-
FAQ
-
Applications
-
Basics
-
Custom Instance Setup
-
Deployment
-
Security
-
Auto Healing
-
Tutorials
- Tutorial: Customizing your Scalarium Cloud using Chef
- Customizing your Scalarium Cloud using Chef: The Scalarium Lifecycle System
- Customizing your Scalarium Cloud using Chef: Cooking with Chef
- Customizing your Scalarium Cloud using Chef: Writing a Cookbook to set up Redis
- Customizing your Scalarium Cloud using Chef: Configuring Custom Cookbooks
- View all (4 more)
-
Load Based Auto Scaling
-
Time Based Auto Scaling
-
API