{"id":26,"date":"2010-04-02T12:31:04","date_gmt":"2010-04-02T12:31:04","guid":{"rendered":"http:\/\/blog.railsware.com\/?p=26"},"modified":"2021-08-16T15:25:30","modified_gmt":"2021-08-16T12:25:30","slug":"set-up-new-servers-with-sprinkle","status":"publish","type":"post","link":"https:\/\/railsware.com\/blog\/set-up-new-servers-with-sprinkle\/","title":{"rendered":"Set up new servers with Sprinkle"},"content":{"rendered":"\n<p>Automated&nbsp;set-up and maintenance&nbsp;of new servers is the only inexpensive and effective way to create new servers quickly and consistently.<br>Using automated scripts allows you to kill two birds with one stone:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Avoid possible mistakes by a system administrator (or whoever is setting up the server) and speed up routine tasks.<\/li><li>Avoid configuration inconsistency when setting up typical configurations for a&nbsp;new server (let&#8217;s say a new node in a cloud).<\/li><\/ol>\n\n\n\n<p>The most popular server set-up and provision tools are <a href=\"http:\/\/www.puppetlabs.com\/puppet\/introduction\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Puppet<\/a> and <a href=\"http:\/\/www.opscode.com\/chef\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Chef<\/a>. Both are really good tools but with major drawbacks. Puppet recipes are not easy to create, also both tools require a separate server for storing and managing recipes and maintenance work. It is a\u00a0fine solution when you have large infrastructure with tens\u00a0or hundreds of servers for the project, but borders on\u00a0overkill when you just want to set up a new staging server for\u00a0a project or create a new node once\u00a0every\u00a0few months.<\/p>\n\n\n\n<p>For\u00a0a more limited\u00a0infrastructure you need something easier and more straightforward, like <a href=\"http:\/\/www.capify.org\/index.php\/Capistrano\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Capistrano<\/a>, for application deployment.\u00a0Moreover, you&#8217;re\u00a0can use Capistrano not just for deployment but also for server provisioning as well (there is an available\u00a0tool called <a href=\"http:\/\/deprec.failmode.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Deprec<\/a> that\u00a0has a set of Capistrano tasks for setting up Ruby\/Rails servers).\u00a0It is not the\u00a0most elegant way, but it works.<\/p>\n\n\n\n<p>Fortunately, there is also\u00a0a tool called <a href=\"http:\/\/github.com\/crafterm\/sprinkle\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Sprinkle<\/a>,\u00a0which\u00a0is perhaps best described by its author:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Sprinkle is a software provisioning tool with which you can use to build remote servers, after the base operating system has been installed. For example, to install a Rails or Merb stack on a brand new slice directly after its been created.<\/p><p>Properties of packages such as their names, types, dependencies, etc., and what packages apply to what machines&nbsp;are described via a domain-specific language that Sprinkle executes (in fact one of the aims of Sprinkle is to define as concisely as possible a language for installing software).<\/p><\/blockquote>\n\n\n\n<p>Sprinkle is built on top of Capistrano, so it uses the same push approach. The tool provides clean and simple <acronym title=\"Domain Specific Language\">DSL<\/acronym> for defining recipes. It leverages Debian&#8217;s and Ubuntu&#8217;s APT packaging system, RubyGems,\u00a0and has\u00a0special syntax for installing unix applications from the source and adding some pre- and post-installation hooks. Also, it manages dependencies between your packages. Just\u00a0take a look at\u00a0Sprinkle recipe examples on its <a href=\"http:\/\/github.com\/crafterm\/sprinkle\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">website<\/a>.<\/p>\n\n\n\n<p>Our sprinkle recipes are used mostly for installing Ruby Enterprise Edition together with RubyGems, Nginx together with Passenger, SQL database (MySQL or PostgreSQL), SCM tool (Git or Mercurial), ImageMagick, different sysadmin tools, redis, memcached, etc. So we published most of the them\u00a0to public. You can check Railsware&#8217;s Sprinkle recipes at <a href=\"http:\/\/github.com\/railsware\/sprinkle_recipes\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a>.<\/p>\n\n\n\n<p>Setting up new server with Sprinkle and our recipes set is quite easy:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Get recipes code from GitHub.<\/li><li>Install Sprinkle: <em>sudo gem install sprinkle.<\/em><\/li><li>Set your server credentials in <em>deploy.rb.<\/em><\/li><li>Pick packages you want to install in <em>install.rb<\/em>. Add other packages or modify existing ones.<\/li><li>Run <em>sprinkle -s install.rb<\/em> inside or sprinkle_recipes directory and follow Sprinkle instructions.<\/li><\/ol>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automated&nbsp;set-up and maintenance&nbsp;of new servers is the only inexpensive and effective way to create new servers quickly and consistently.Using automated scripts allows you to kill two birds with one stone: Avoid possible mistakes by a system administrator (or whoever is setting up the server) and speed up routine tasks.Avoid configuration inconsistency when setting up typical&#8230;<\/p>\n","protected":false},"author":1,"featured_media":3757,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[],"coauthors":["admin"],"class_list":["post-26","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development"],"acf":[],"aioseo_notices":[],"categories_data":[{"name":"Engineering","link":"https:\/\/railsware.com\/blog?category=development"}],"post_thumbnails":"https:\/\/railsware.com\/blog\/wp-content\/themes\/railsware\/vendors\/images\/article-thumbnail-default.jpg","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":8,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":14128,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/posts\/26\/revisions\/14128"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/media\/3757"}],"wp:attachment":[{"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/tags?post=26"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/coauthors?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}