Saturday, 6 May 2017

DevOps trainings and Job Support

Devops is very popular buzzword in the current IT industry and It offers lot of benefits to the entire delivery process of the organizations

Devops is cutting edge technology
Devops changes the way to look at the IT organization infrastructure.



We Offer DevOps trainings and Job Support.

Please contact for trainings and job support email: scrmtel@gmail.com and contact no:   7780199676

Thursday, 13 April 2017

Chef-Cookbooks

For Django

yum_repository 'epel' do
   action :create
end


######  Global Install django through pip
package "python-pip" do
action :install
end

package "django" do
action :install
end

######  Set up directories to create a virtual environment
execute "Start project and create virtual environment" do
  command "mkdir /root/project; cd /root/project"
end


For Memcached cookbook:
------------------------------

package "memcached" do
  action :upgrade
end

##### 2: Make sure memcached is running
service "memcached" do
 enabled true
 running true
 action [:enable, :start]
end

-------------

yum_repository 'epel' do
   action :create
end
execute "update package" do
 command "yum update"
 ignore_failure true
 action :nothing
end.run_action(:run)

###### Set up Postgresql with psycopg2 and python django required packages #######
%w{postgresql postgresql-server postgresql-contrib python-django python-pip python-psycopg2}.each do |pkg|
package pkg do
     action :install
  end
end

######  Make sure postgresql service working and running fine
execute "Start Postgres daemon and enable it to start on boot" do
  command "service postgresql initdb; service postgresql start; chkconfig postgresql on"
end

Wednesday, 15 June 2016

Docker for sample applications

Sample docker file:

FROM ubuntu:14.04

USER root
RUN apt-get update && apt-get install -y \
    python3 \
    curl && \
    rm -rf /var/lib/apt/lists/*
RUN groupadd -r nonroot && \
    useradd -r -g nonroot -d /home/nonroot -s /sbin/nologin -c "Nonroot User" nonroot && \
    mkdir /home/nonroot && \
    chown -R nonroot:nonroot /home/nonroot

USER nonroot
WORKDIR /home/nonroot/
RUN curl -o index.html http://info.cern.ch/hypertext/WWW/TheProject.html

USER nonroot
EXPOSE 3000
WORKDIR /home/nonroot/
CMD ["python3", "-m", "http.server", "3000"]


sudo docker build -t=docker-example .
sudo docker run -p 3000:3000 -i -t docker-example
 http://localhost:3000/

yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
yum install nodejs
npm install http-server

----------------------------

# DOCKER-VERSION 1.2.0
FROM centos:centos6
#Install WGET
RUN yum install -y wget
#Install tar
RUN yum install -y tar
# Download JDK
RUN cd /opt;
RUN yum -y install java-1.7.0-openjdk-devel
#gunzip JDK
#RUN cd /opt;gunzip jdk-7u67-linux-x64.tar.gz
#RUN cd /opt;tar xvf jdk-7u67-linux-x64.tar
#RUN alternatives –install /usr/bin/java java /opt/jdk1.7.0_67/bin/java 2
# Download Apache Tomcat 7
RUN cd /tmp;wget http://redrockdigimark.com/apachemirror/tomcat/tomcat-8/v8.0.36/bin/apache-tomcat-8.0.36.tar.gz
# untar and move to proper location
RUN cd /tmp;gunzip apache-tomcat-8.0.36.tar.gz
RUN cd /tmp;tar xvf apache-tomcat-8.0.36.tar
RUN cd /tmp;mv apache-tomcat-8.0.36 /opt/tomcat8
RUN chmod -R 755 /opt/tomcat8
ENV JAVA_HOME /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.101.x86_64/
EXPOSE 8080
CMD /opt/tomcat8/bin/catalina.sh run


to run the docker:
docker run -it --rm -p 8080:8080 tel/tom1
http://ipaddress:8080

---------------------------

Wednesday, 1 June 2016

JIRA installation and setup

Steps:

1) Check whether java installed or not?
Java -version

2) cd /opt

3) wget https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-6.4.7-x64.bin

4) chmod +x atlassian-jira-6.4.7-x64.bin
5) ./atlassian-jira-6.4.7-x64.bin
6)  http://serverip:8080 or http://hostname:8080 cd /opt

Thursday, 26 May 2016

Ansible installation_and_its_setup

How to install ansible on our machines:
-----------------------------------------

1) Yum install epel-release
2) yum install ansible

To write commands in Ansible"

ansible 127.0.0.1 -m yum -a "name=software state=present" 

Then the software will be installed on your machine.

eg:
installing postgresql using ansible

ansible 127.0.0.1 -m yum -a "name=postgresql state=present"


---
- hosts: [target hosts]
  remote_user: [yourname]
  tasks:
    - [task 1]
    - [task 2]

Sample service check playbook


---
- hosts: [marketingservers]
  remote_user: webadmin
  tasks:
    - name: Ensure the Apache daemon has started
      service: name=httpd state=started
      become: yes
      become_method: sudo


Playbook task
tasks:
    - name: Ensure the Apache daemon has started
      service: name=httpd state=started
      become: yes

      become_method: sudo



Wednesday, 25 May 2016

Runtime_issues and resolutions

error :/bin/sh^M: bad interpreter: No such file or directory


This can be resolved by using these steps:

To fix this, open your script with vi or vim and enter in vi command mode (key ESC), then type this:
:set fileformat=unix
Finally save it
:x! or :wq!

Thursday, 19 May 2016

DevOps_automation_scripts

DevOps_Automation_Scripts
---------------------------
Jenkins installation script:
jenkins.sh 
#!/bin/sh
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
service jenkins start

chmod 755 jenkins.sh
./jenkins.sh
It will jenkins latest version.
Scripts

cp jenkins /etc/init.d/
update rc.d jenkins defaults
Now this will considered within in the init.d service and restart the service automatically whenever reboot machine.