Category Archives: DevOps

Ansible role to create linux users with Github accounts ssh key

In this short tutorial we’ll learn how to create or delete the linux user accounts with public ssh keys associated with their Github accounts using Ansible, so please create a Github account if you don’t already have one, and follow the instructions for associated SSH keys with your account, if you didn’t perform it already.

First, download this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

Move inside the cloned directory:

cd ansible-roles

Read more of this post

Autoscaling with AWS instances using Ansible-Pull

Ansible has an excellent feature called ansible-pull, which many people don’t know or don’t use. This feature works best for self healing infrastructure, best example is AWS Autoscaling in which new ec2 instance is created from vanilla ami, then pull the code from somewhere (version control system) and configure itself before announcing that it is ready to serve (mean add to the serving ELB).

The steps for ansible-pull are:

1. Pull the git repo containing your playbooks.
2. That repo is cloned to the mentioned directory.
3. ansible-pull starts executing the local.yml found in your cloned repo directory.

Let’s assume that you want to pull the code from the private git repo and for this you need the ssh private key but you have taken the updated vanilla ubuntu ami from the Marketplace, then how you will clone this private repo? For this we’ll use the Bootstrap Pattern:

– Put the private part of ssh key for the git repository on S3.
– Getting ssh key from s3 bucket using IAM role credentials

For this, create a S3 bucket(in my case it is named “tendo-github-key-s3“):

s3-1

Read more of this post

Highly-Available WordPress Setup inside AWS VPC using Terraform & Ansible

In this post,we’ll create the Infrastructure for Highly-Available WordPress website over AWS using Terraform and then install the WordPress using Ansible. If you don’t know about the Terraform, please check this link.

We’ll use the Terraform to create the fully operational AWS VPC infrastructure(subnets,routeing tables,igw etc), it will also create everything that need to be for creating EC2 and RDS instances (security key, security group, subnet group). It will also create the Elastic Load Balancer and add the EC2 instance(s) automatically to it as well as creating the Route53 entry for this wordpress site and add the ELB alias to it.

Ansible will be used to deploy the wordpress on the EC2 instances that have been created via Terraform, that will be fault tolerant and highly available.

Requirements:

  • Terraform
  • Ansible
  • AWS admin access

Tools Used: Read more of this post

AWSCli Installation & Configuration using Ansible

In this blog post, we’ll learn that how we can use simple Ansible role to install the AWS CLI with all the required dependencies on Ubuntu 14.04 LTS, it should work on other versions of Ubuntu too.

First, clone this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

To use this role, edit the site.yml file:

vi site.yml

Read more of this post

Installing the VNC server on Ubuntu using Ansible

In this post,we’ll learn that how we can install the VNC server on Ubuntu 14.04 LTS using Ansible. If you don’t know about Ansible, please check this link.

If you want manual step by step procedure to install the VNC server on Ubuntu, please refer this post.

First, download this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

Read more of this post

Installing the WordPress on Ubuntu using Ansible

In this post,we’ll learn that how we can install the WordPress on Ubuntu 14.04 LTS using Ansible. If you don’t know about Ansible, please check this link.

If you want manual step by step procedure to install the WordPress on Ubuntu, please refer this post.

Note: This role depends on LEMP Stack role, it will automatically install the LEMP Stack before installing the WordPress.

First, download this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

Read more of this post

Installing the LEMP Stack on Ubuntu using Ansible

In this post,we’ll learn that how we can install the latest LEMP (Nginx, MySQL & PHP) Stack and it’s initial configuration on Ubuntu 14.04 LTS using Ansible. If you don’t know about Ansible, please check this link.

If you want the manual procedure to install the LEMP stack, please refer this link.

First, download this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

Read more of this post

Provision & Configure EC2 instance with Vagrant and Ansible

In this Simple tutorial, I’ll show you that how you can use the Vagrant with Ansible to provision and configure the EC2 instance on AWS. I am assuming that you already have Vagrant installed and have an AWS account(and know how to use both).

First you need to install the Vagrant AWS plugin:

vagrant plugin install vagrant-aws

After installing the plugin, add dummy AWS box:

vagrant box add aws https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box

Read more of this post

Post Installation steps on Ubuntu using Ansible

Ansible is a configuration management and provisioning tool, similar to Chef, Puppet or Salt. It’s one of the simplest and the easiest to get started with because it’s “just SSH”; It uses SSH to connect to servers and run the configured Tasks.

Ansible Introduction – Please must read this really good and detail Ansible Introduction

Here are the steps to install the Ansible on Ubuntu 14.04 LTS:

sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible

Read more of this post

%d bloggers like this: