Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / SSH_Keypair_Creation.md
Last active March 10, 2018 16:22
Creating SSH-keypair

Creating SSH-keypair

  1. On any Unix flavoured machine run the below command
ssh-keygen
  1. When you type in the above command and hit enter you will be asked for
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
  1. Enter the Name of the key as requested [For Ex: Sample_key] and hit enter. The machine prompts for a passphrase hit enter and then it again prompts to re-enter the passphrase to continue.
Enter passphrase (empty for no passphrase): 

Enter same passphrase again:

@mohanpedala
mohanpedala / Bamboo_Installation_manual_CentOS 7.md
Last active June 6, 2017 18:56
Bamboo_Installation_manual_CentOS 7

Bamboo_Installation_manual_CentOS 7

  1. Create a CentOS 7 Virtual machine on a Virtual box.
  2. Install Java jdk 1.8.0 by using the below command.
 yum -y install java-1.8.0-openjdk.x86_64 
  1. Once the java installation is completed configure the Environment Variables with the below paths
echo 'export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk' | sudo tee -a /etc/profile
echo 'export JRE_HOME=/usr/lib/jvm/jre' | sudo tee -a /etc/profile
source /etc/profile
  1. Verify the java version and paths.
@mohanpedala
mohanpedala / rpm-install.md
Created June 4, 2017 03:18
Installing an rpm file in RHEL
rpm -ivh <file-name>.rpm
@mohanpedala
mohanpedala / chef-workstation-userdata.md
Last active May 17, 2019 17:48
Userdata for chef-workstation on AWS EC2

Userdata for chef-workstation on AWS EC2

Copy paste the below userdata into userdata section when creating a new EC2 instance on AWS EC2. Userdata section is available in Advanced Options Section.

#!/bin/bash
echo BEGIN
sudo yum update -y
sudo yum install -y wget git
wget https://packages.chef.io/files/stable/chefdk/1.4.3/el/7/chefdk-1.4.3-1.el7.x86_64.rpm
sudo rpm -ivh chefdk-1.4.3-1.el7.x86_64.rpm
@mohanpedala
mohanpedala / userdata-to-bootstrap-ec2-instance.md
Last active June 6, 2017 18:54
Using userdata to bootstrap an EC2 Instance

Using userdata to bootstrap an EC2 Instance

It is possible to bootstrap an EC2 instance by running a shell script on launch. The shell script that you want to run when a new EC2 instance is created should be placed in the userdata section. Userdata section can be found in the advanced options while configuring the new EC2 instance. The userdata that is provided on EC2 creation console is copied to the below mentioned folder

/var/lib/cloud/instance/scripts

Also, the log file for the userdata execution can be found here :

@mohanpedala
mohanpedala / chef-server-installation-rhel-7-userdata.md
Last active June 6, 2017 18:54
Userdata for Installation chef-server on rhel 7

Userdata for Installation chef-server on rhel 7

Instructions to install chef-server 12.15.7-1 on RHEL 7.3. The official documentation for installation can be found here

Chef Server Installation

Optional packages installed

--> chef-manage

@mohanpedala
mohanpedala / chef-workstation-configuration.md
Last active March 14, 2023 22:34
chef-workstation-configuration

Chef-workstation-configuration

Once the chef-workstation installation(here is the link to run the script to install chef-workstation on RHEL 7) is completed we need to verify the main components in the chef-dk

chef verify

To configure the environment variable use chef env

chef env
@mohanpedala
mohanpedala / Chef-bootstrap-node-rhel-7.md
Last active June 6, 2017 18:48
chef-bootstrap-node-rhel-7-aws

Boot Strapping a node reference doc

  1. Spin an instance in aws (rhel-7) tag it as chef-node.
  2. Spin up the chef-workstation and test the ssh connectivity between chef-workstation and chef-node
ssh -i ~/path/to/key.pem username@<ip/domainname>
  1. Exit the test session once connected.
  2. Start the bootstrap process using key-based authentication.
@mohanpedala
mohanpedala / Role-cookbook-exp.md
Last active June 7, 2017 19:07
What is role cookbook

Role cookbooks

It is a way to define certain patterns and processes that exist across nodes in a organization as belonging to single job function. Each role consists of a run list and zero (or more) attributes.

Advantages and Disadvantages:

  1. Roles can not be versioned.
  2. It is easier to search for Chef nodes in a role than Chef nodes that ran a recipe.
  3. They're intended to be a lightweight way to group servers that shouldn't contain much business logic.

Example:

@mohanpedala
mohanpedala / Chef_test_kitchen.md
Last active December 19, 2017 21:28
Chef-test-kitchen

Test-kitchen setup on aws

Reference doc learn-chef

  1. create a aws account and gather the below details

    a. Create your credentials file b. Note your region and availability zone c. Note your VPC subnet d. Create a security group