Coder Social home page Coder Social logo

training_node_setup's Introduction

training_node_setup

Description

This cookbook is for Chef students to use. It stands up 3 nodes of Centos in their lab that they can use to bootstrap to their own Chef Server

How to Use

You run the following command:

$ kitchen create

Check in the .kitchen folder and you will find the IP and FQDN details

Bootstrap Details

Run the following command

$ knife bootstrap FQDN -x USER -P PWD --sudo -N node1
  • FQDN - Public IP Address or Fully Qualified Domain Name or your Node
  • USER - 'centos'
  • PWD - Is the password (Use the '-i' for ~.ssh\id_rsa )
  • node1 - The name.... You can use any name....

AWS EC2 Specific Examples

This is an example BOOTSTRAP command on AWS EC2 training lab BJC:

$ knife bootstrap -i ~\.ssh\id_rsa [email protected] -N node1 --sudo

This is an example ADD RECIPE command on AWS EC2 training lab BJC:

$ knife node run_list add node1 "recipe[your_cookbook]"

This is an example bootstrap and add recipe command on AWS EC2 training lab BJC:

$ knife bootstrap -i ~\.ssh\id_rsa [email protected] -N node1 --sudo --run-list 'recipe[your_cookbook]'

Converge Your Recipe

Converge node 1 and run the Chef-Client

$ knife ssh 'name:node1' 'sudo chef-client' -x centos -i ~\.ssh\id_rsa

Converge all your nodes

$ knife ssh "*:*" "sudo chef-client" -x centos -i ~\.ssh\id_rsa

Should the AWS Reaper take down your nodes

Remove the missing nodes from Chef Server

##Delete all nodes
$ knife node delete node1
$ knife node delete node2
$ knife node delete node3
$ knife node delete node4

Restore node1

$ knife bootstrap -i ~\.ssh\id_rsa [email protected] -N node1 --sudo -r 'role[web]' -E production

Restore node2

$ knife bootstrap -i ~\.ssh\id_rsa [email protected] -N node2 --sudo -r 'role[web]' -E production

Restore node3

$ knife bootstrap -i ~\.ssh\id_rsa [email protected] -N node3 --sudo -r 'role[loadbalancer]' -E production

Restore node4

knife bootstrap -i ~\.ssh\id_rsa [email protected] -N node4 --sudo -r 'role[web]' -E acceptance

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.