Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Sunday, January 21, 2024

Install Ansible on Red Hat Linux | Setup Ansible on Red Hat Linux

How to setup Ansible on Red Hat Linux VM?

Ansible is #1 configuration management tool. It can also be used for infrastructure provisioning as well. or You can use Ansible in combination of Terraform which can take care of infra automation and Ansible can do configuration management. We will be setting up Ansible on Red Hat VM in Azure cloud And create some resources in AWS Cloud by using Ansible playbooks.

Ansible Architecture:
 

The best way to install Ansible in Linux is to use PIP, a package manager for Python.

Pre-requisites:
  • Create new Red Hat EC2 in AWS Cloud for setting up Ansible, just open port 22 in firewall rule.
How to setup Ansible on Red Hat Linux VM?

Watch Steps in YouTube channel:

Change host name to AnsibleMgmtNode
sudo hostnamectl set-hostname 
AnsibleMgmtNode

Update Repository
sudo yum update -y

Install Python-pip3
sudo yum install python3-pip -y

Upgrade pip3 sudo pip3 install --upgrade pip


# Install Ansible pip3 install "ansible==2.9.17"



check Ansible version
ansible --version


Thursday, September 9, 2021

How to install Terraform on Red Hat Linux | TerraForm Installation on Red Hat Linux

 Terraform is an infrastructure as a code tool used for provisioning infrastructure on most of the cloud platforms. 

  • Open source
  • Can setup entire infrastructure by writing Terraform scripts/templates. 
  • Based on declarative model
  • Uses Hashi Corp Language(HCL) which is JSON format

You can watch this on YouTube channel:

Please find steps for installing Terraform On Enterprise Red Hat Linux.

Create a working directory
sudo mkdir -p /opt/terraform
cd /opt/terraform

Install wget utility
sudo yum install wget -y

Download Terraform from Hasicorp website
sudo wget https://releases.hashicorp.com/terraform/1.0.5/terraform_1.0.5_linux_amd64.zip

Install unzip utility
sudo yum install unzip -y

Unzip Terraform Zip file
sudo unzip terraform_1.0.5_linux_amd64.zip

Add terraform to PATH
sudo mv /opt/terraform/terraform /usr/bin/

terraform -version

Terraform v1.0.5
on linux_amd64

this should show version of Terraform.

Friday, June 19, 2020

Install Helm 2 on Linux - Setup Helm 2 on Linux | Install Helm 2 on Ubuntu | Setup Helm 2 on Linux

Helm is package manager for Kubernetes. Helm helps you manage Kubernetes applications. Helm Charts helps you define, install, and upgrade even the most complex Kubernetes application. Charts are easy to create, version, share, and publish.

Helm is made of two components: the CLI binary named helm that allows you to perform communication with a remote component, named tiller that lives inside your Kubernetes cluster that is responsible to perform patches and changes to resources you ask to manage. 

Helm can be installed by below way:

Download installables
sudo curl -LO https://git.io/get_helm.sh
provide permission
sudo chmod 700 get_helm.sh

Execute script to install 
sudo ./get_helm.sh

 
Verify installation

helm version --client

 
Tiller
Tiller is the service that actually communicates with the Kubernetes API to manage our Helm packages.
 
cat <<EOF > tiller-rbac-config.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: tiller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
  - kind: ServiceAccount
    name: tiller
    namespace: kube-system
EOF
 
Apply the RBAC configuration for Tiller via a kubectl command: 
kubectl create -f tiller-rbac-config.yaml 

Initialize Tiller
helm init --service-account tiller

Wednesday, April 29, 2020

Docker Installation on Red Hat Linux 8 | Install Docker on Linux

Find steps for installing Docker on Red Hat Linux 8

Enable Docker Registry
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

Install Docker CE using dnf comman
sudo dnf list docker-ce
sudo dnf install docker-ce --nobest -y
sudo systemctl start docker

sudo systemctl enable docker

sudo systemctl status docker

docker --version

sudo docker run hello-world


Steps for installing Docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker-compose --version

Add the docker group to current user
sudo usermod -aG docker $USER

Logout and login again.

Monday, March 18, 2019

Top 10 Linux commands - Basic Linux commands

If you are new to Linux, you should start getting familiar with Linux commands. Let us take a look at top 10 commands.

1. ls

ls command will list all the files in the directory.

2. cp
cp command will copy the files from source to dest folder

3. mv
mv command will copy the files from source to dest folder
4. rm

rm command will remove file from file system.

5. cd

cd command changes the directory

6. mkdir

mkdir creates new directory.

7. cat

cat command displays the content of a file

8. sudo 

Every single command that needs root's permission, need this sudo command. You can use sudo before each command that requires root permissions -
 
9. grep
 
You need to find a file but you don't remember its exact location or the path. grep will help you to solve this problem. You can use the grep command to help finding the file based on given keywords. 

10. poweroff

poweroff command is used to poweroff directly from terminal.