GithubHelp home page GithubHelp logo

chef-server-blueprint's Introduction

chef-server-blueprint Cookbook

Provides recipes for managing a standalone Chef Server with RightScale, including:

  • Installation and Configuration of a standalone Chef Server
  • Scheduled backups and restore (Chef 12 only)

Github Repository: https://github.com/RightScale-Services-Cookbooks/chef-server-blueprint

Requirements

  • Requires Chef 11 or higher
  • Requires Ruby 1.9 or higher
  • RightLink 10 See cookbook version 0.1.7 for RightLink 6 support
  • Platform
    • RHEL/CentOS 6/7 64-bit
    • Ubuntu 12.04 64-bit
    • Ubuntu 14.04 64-bit
  • Cookbooks

See the Berksfile and metadata.rb for up to date dependency information.

Usage

To setup a standalone Chef Server, place the chef-server-blueprint::default recipe in the runlist, with the following inputs set:

  • node['chef-server-blueprint'][api_fqdn] - FQDN of this Chef Server
  • node['chef-server-blueprint'][remote_file] - Install Chef Server from a remote file instead of specifying version. (Optional)
  • node['chef-server-blueprint']['version'] - Version of Chef Server to install (Optional)

Creating a Backup

To create a manual backup of the Chef Server configuration, run the chef-server-blueprint::chef-ros-backup recipe with the following inputs set:

  • node['chef-server-blueprint']['backup']['lineage'] - The prefix that will be used to name/locate the backup of a particular VPN server.
  • node['chef-server-blueprint']['backup']['storage_account_provider'] - The storage provider where the dump file will be saved.
  • node['chef-server-blueprint']['backup']['storage_account_id'] - The storage provider authentication user.
  • node['chef-server-blueprint']['backup']['storage_account_secret'] - The storage provider authentication secret/password.
  • node['chef-server-blueprint']['backup']['storage_account_endpoint'] - The endpoint URL for the storage cloud.
  • node['chef-server-blueprint']['backup']['container'] - The cloud storage location where the dump file will be saved to or restored from.

This recipe creates a compressed tar file which is uploaded to a Remote Object Storage location supported by the rsc_ros.

Scheduled Backups

Automation of the manual backup is configured by the chef-server-blueprint::backup_schedule_enable and chef-server-blueprint::backup_schedule_disable recipes. These recipes enable and disable an hourly cron job which executes the chef-ros-backup1 recipe.

Restoring from a Backup

NOTE: The lineage input currently requires the complete filename in order to restore correctly. This is different from how this input is used for backups and will need to be modified prior to every restore attempt. This will be corrected in a future release.

To restore from a Backup, run the chef-server-blueprint::chef-ros-restore recipe with the following inputs set:

  • node['chef-server-blueprint']['backup']['lineage'] - The entire filename of the backup as it was uploaded to remote storage
  • node['chef-server-blueprint']['backup']['storage_account_provider'] - The storage provider where the dump file will be saved.
  • node['chef-server-blueprint']['backup']['storage_account_id'] - The storage provider authentication user.
  • node['chef-server-blueprint']['backup']['storage_account_secret'] - The storage provider authentication secret/password.
  • node['chef-server-blueprint']['backup']['storage_account_endpoint'] - The endpoint URL for the storage cloud.
  • node['chef-server-blueprint']['backup']['container'] - The cloud storage location where the dump file will be saved to or restored from.

Installing the WebUI

To install the WebUI, run the chef-server-blueprint::install-webui recipe.

Attributes

  • node['chef-server-blueprint'][api_fqdn] - FQDN of this Chef Server
  • node['chef-server-blueprint'][remote_file] - Install Chef Server from a remote file instead of specifying version. (Optional)
  • node['chef-server-blueprint']['version'] - Version of Chef Server to install (Optional)
  • node['chef-server-blueprint']['backup']['lineage'] - The prefix that will be used to name/locate the backup of a particular VPN server.
  • node['chef-server-blueprint']['backup']['storage_account_provider'] - The storage provider where the dump file will be saved.
  • node['chef-server-blueprint']['backup']['storage_account_id'] - The storage provider authentication user.
  • node['chef-server-blueprint']['backup']['storage_account_secret'] - The storage provider authentication secret/password.
  • node['chef-server-blueprint']['backup']['storage_account_endpoint'] - The endpoint URL for the storage cloud.
  • node['chef-server-blueprint']['backup']['container'] - The cloud storage location where the dump file will be saved to or restored from.

Recipes

chef-server-blueprint::default

Installs and configures the instance as a standalone Chef Server using the version specified for downloading from package.io OR using a user specified remote_file to perform the installation.

chef-server-blueprint::chef-ros-backup

Creates a compressed archive backup of the critical Chef Server files and uploads the file to Remote Object Storage provided by the rsc_ros cookbook. The backup name is [lineage]-yyyymmddhhMM.tar.bz2.

chef-server-blueprint::chef-ros-restore

Restores the compressed archive backup created by the chef-ros-backup recipe.

chef-server-blueprint::backup-schedule-enable

Creates a cron entry that runs the chef-ros-backup recipe every hour.

chef-server-blueprint::backup-schedule-disable

Removes the cron entry created by backup-schedule-enable.

Author

chef-server-blueprint's People

Contributors

cdwilhelm avatar nathan-rightscale avatar rmonge-rs avatar rshade avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chef-server-blueprint's Issues

undefined method `fqdn_resolves?' for ChefIngredientCookbook::Helpers:Module

�[0m  * log[*** Including recipe chef-server::default] action write
  
�[0mRecipe: chef-server::default�[0m
  * ruby_block[ensure node can resolve API FQDN] action run
    �[0m
    ================================================================================�[0m
    �[31mError executing action `run` on resource 'ruby_block[ensure node can resolve API FQDN]'�[0m
    ================================================================================�[0m
    
�[0m    NoMethodError�[0m
    -------------�[0m
    undefined method `fqdn_resolves?' for ChefIngredientCookbook::Helpers:Module�[0m
    
�[0m    Cookbook Trace:�[0m
    ---------------�[0m
    /home/rightscale/.chef/local-mode-cache/cache/cookbooks/chef-server/libraries/helpers.rb:11:in `api_fqdn_resolves?'
�[0m    /home/rightscale/.chef/local-mode-cache/cache/cookbooks/chef-server/recipes/default.rb:26:in `block (2 levels) in from_file'�[0m
    
�[0m    Resource Declaration:�[0m
    ---------------------�[0m
    # In /home/rightscale/.chef/local-mode-cache/cache/cookbooks/chef-server/recipes/default.rb
�[0m    
�[0m     22: ruby_block 'ensure node can resolve API FQDN' do
�[0m     23:   extend ChefServerCookbook::Helpers
�[0m     24:   block { repair_api_fqdn }
�[0m     25:   only_if { api_fqdn_available? }
�[0m     26:   not_if { api_fqdn_resolves? }
�[0m     27: end
�[0m     28: 
�[0m    
�[0m    Compiled Resource:�[0m
    ------------------�[0m
    # Declared in /home/rightscale/.chef/local-mode-cache/cache/cookbooks/chef-server/recipes/default.rb:22:in `from_file'
�[0m    
�[0m    ruby_block("ensure node can resolve API FQDN") do
�[0m      action [:run]
�[0m      default_guard_interpreter :default
�[0m      block_name "ensure node can resolve API FQDN"
�[0m      declared_type :ruby_block
�[0m      cookbook_name "chef-server"
�[0m      recipe_name "default"
�[0m      block #<Proc:0x00000002778ba0@/home/rightscale/.chef/local-mode-cache/cache/cookbooks/chef-server/recipes/default.rb:24>
�[0m      not_if { #code block }
�[0m      only_if { #code block }
�[0m    end
�[0m    
�[0m    System Info:�[0m
    ------------�[0m
    chef_version=13.2.20
�[0m    platform=ubuntu
�[0m    platform_version=14.04
�[0m    ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
�[0m    program_name=chef-solo worker: ppid=9719;start=01:16:02;
�[0m    executable=/opt/chef/bin/chef-solo�[0m
    
�[0m�[0m
Running handlers:�[0m
Running handlers complete
�[0mChef Client failed. 4 resources updated in 02 seconds�[0m
*RS> Status: FAILED with exit status 1

chef-server cookbook is pinned (https://github.com/RightScale-Services-Cookbooks/chef-server-blueprint/blob/master/metadata.rb#L11) to a version before a bug fix (chef-cookbooks/chef-server#135) needed to address the issue.

We should bump to at least v5.2.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.