Tagged in: centos7

How to Install git on Centos 7

I found my self needing git to pull down scripts for ansible. Thus this is how to configure git on Centos 7.

 

  1. # yum install git -y
  2. git --version
  3. You should see a version like this. Install Done!

git version

 

  1. Next lets configure it!
  2. # git config --global user.name "Your Name"
  3. # git config –global user.email “[email protected]
  4.  # git config –list
  5. You should see the following, and we are done!

configgit

  1. Lets create a new location for our git repository
  2. mkdir /git
  3. cd /git
  4. git init
  5. now lets pull down a configure we want to use.
  6. the command git clone (URL) clones a entire repository down to your server or workstation.
  7. Enjoy!

 

Sources.

How To Install Git on CentOS 7 https://www.digitalocean.com/community/tutorials/how-to-install-git-on-centos-7

Using Git with Github. http://blog.scottlowe.org/2015/01/26/using-git-with-github/

A Non-Programmer’s Introduction to Git http://blog.scottlowe.org/2015/01/14/non-programmer-git-intro/

credit to Scott Lowe and Josh Barnett

 

 

 

Roger L

How to Install and config Ansible on CentOS 7.

In preparation for my lab and openstack testing. I wanted to look at implementing a automation tool. I decided on ansible, as I haven’t used it, and I like a challenge. 🙂

What is ansible?

I turn to Wikipedia.

Ansible (software)

From Wikipedia, the free encyclopedia

 

Ansible, a free-software platform for configuring and managing computers, combines multi-node software deployment, ad hoc task execution, and configuration management.[fusion_builder_container hundred_percent=”yes” overflow=”visible”][fusion_builder_row][fusion_builder_column type=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none”][1] It manages nodes (which must have Python 2.4 or later installed on them) over SSH or over PowerShell.[2] Modules work over JSON and standard output and can be written in any programming language. The system uses YAML to express reusable descriptions of systems.[3]

Michael DeHaan, the author of the provisioning server application Cobbler and co-author of the Func framework for remote administration, developed the platform.[4] It is included as part of the Fedora distribution of Linux, owned by Red Hat Inc., and is also available for Red Hat Enterprise Linux, CentOS, and Scientific Linux via Extra Packages for Enterprise Linux (EPEL) as well as for other operating systems.[5] Ansible, Inc commercially supports and sponsors Ansible[6] On 16 October, 2015, Red Hat Inc. announced that it had signed a definitive agreement to acquire Ansible, Inc.[7][8]

The name “Ansible” references the fictional instantaneous hyperspace communication system (featured in Orson Scott Card‘s Ender’s Game,[9] and originally invented by Ursula K. Le Guin for her 1966 novel Rocannon’s World).”

 

 

After some research on how to install Ansible on Centos 7, I found this write up quite detailed.

 

Ansible is a free & open source Configuration and automation tool for UNIX like operating system. It is written in python and similar to Chef or Puppet but there is one difference and advantage of Ansible is that we don’t need to install any agent on the nodes. It uses SSH for making communication to its nodes.

In this article we will install and configure Ansible in CentOS 7 and will try to manage its two nodes.”

http://www.linuxtechi.com/install-and-use-ansible-in-centos-7/

 

So lets do it!

 

#1 will be putty term 1, #2 will be putty term 2.

 

  • First I like nano, #1 yum install nano -y
  • Connect with putty to the host #1
  • #1 rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
  • #1 yum install ansible -y
  • #1 ansible –version
  • #1 ssh-keygen

ssh gen

copyssh

  • #1 nano /etc/ansible/hosts
  • add this at the bottom. I am calling this openstack servers.

[openstackservers]

192.168.50.200

192.168.50.201

192.168.50.202

192.168.50.203

192.168.50.204

192.168.50.205

192.168.50.206

 

  • alt x to save, y enter.
  • #1 cat /etc/ansible/hosts

openstackservers

 

  • #1 ansible -m ping 'openstackservers'
  • pingpong

 

  • Sweet. Now let’s have some fun. First I like to watch my work. Lets logs our progress in a new putty session. once your connected lets create some new directories.
  • #2 mkdir /anisble/
  • #2 mkdir /anisble/logs
  • now lets go back to the first putty session. and do the following.
  • #1 anisble -m command -a “who” ‘openstackservers’ >> /anisble/logs.log
  • then lets go back to term 2
  • #2 tail -f /anisble/logs.log
  • This will allow us to see the results on term #2 without losing our commands on term #1. lets check for updates.
  • #1 anisble -m command -a “update -y” ‘openstackservers’ >> /anisble/logs.log
  • in term #2 you will see the following.

updates

 

We are all done! See future posts about way’s to use anisble.

 

Roger Lund[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

Install VMware tools on Centos 7

I was standing up some Centos 7 boxes in VMware vSphere. And I figured I would blog on the steps to install VMware Tools.

 

The below Steps are taken from http://partnerweb.vmware.com/GOSIG/CentOS_7.html

 

 “CentOS 7 documentation covers information on how to install the operating system in a virtual machine. For additional information about the operating system, refer to the instructions included in the installation media.

CentOS 7 documentation includes the following topics:

Installation Instructions

To install CentOS 7 in a virtual machine you can use either the standard CentOS distribution CD or the boot floppy/network method. The following installation instructions are for standard distribution CD.

Prerequisites

Before you begin, verify that the following tasks are complete:

Installation Steps

  1. Insert the CentOS 7 CD-ROM in the CD-ROM drive.
  2. Power on the virtual machine to start installing CentOS 7.
  3. Follow the prompts to complete the installation.
  4. Set the storage location for installation. In the INSTALLATION SUMMARY screen, in the STORAGE session area, select INSTALLATION DESTINATION.
  5. Change the Base Environment and select Add-Ons to install. In the INSTALLATION SUMMARY screen, in the SOFTWARE session area, click SOFTWARE SELECTION.CentOS 7 includes Open VMware Tools. The default Base Environment is Minimal install, which only has basic functionality.
    • For Minimal install and Virtualization Host environments, Open VMware Tools is not available during installation.
      After CentOS 7 installation, to install Open VMware Tools, using root privileges, run the command:
      # yum install open-vm-tools
    • For other types of Base Environments, to install Open VMware Tools, select the Guest Agents Add-On.
    • If this Add-On is not listed, the Base Environment already includes Open VMware Tools and installs it by default.
  6. Click Done.
  7. Click Begin Installation to continue.
  8. Set root password and create new users, as needed, in the CONFIGURATION screen.

VMware Tools in an CentOS 7 Guest

Use the guest OS provided Open VM Tools or install VMware Tools, as needed.

Open VM Tools

Open VM Tools is the open source implementation of VMware Tools and consist of a suite of virtualization utilities that improves the functionality, administration, and management of virtual machines on VMware hypervisors. VMware recommends using the Open VM Tools redistributed by the operating system vendors. To use Open VM Tools:

  1. Add the vmhgfs Driver
    If you use the file sharing feature by using Shared Folders in VMware Workstation and Fusion, install the vmhgfs driver in the virtual machine. This driver is not included inbox in the operating system. Installing the additional vmhgfs driver does not disturb the other inbox VMware drivers or Open VMware Tools. To install this driver:

    1. Install Open VMware Tools.
    2. Install the traditional TAR Format VMware Tools that is bundled with VMware Workstation or Fusion products.
  2. Add the deployPkg Tools Plug-in
    If you are using the virtual machine as a template or if it will be protected by SRM (Site Recovery Manager), then install the deployPkg Tools plug-in. To install this plug-in:

    1. Create a file, /etc/yum.repos.d/vmware-tools.repo, with the following content:
      [fusion_builder_container hundred_percent="yes" overflow="visible"][fusion_builder_row][fusion_builder_column type="1_1" background_position="left top" background_color="" border_size="" border_color="" border_style="solid" spacing="yes" background_image="" background_repeat="no-repeat" padding="" margin_top="0px" margin_bottom="0px" class="" id="" animation_type="" animation_speed="0.3" animation_direction="left" hide_on_mobile="no" center_content="no" min_height="none"][vmware-tools]
      name = VMware Tools
      baseurl = http://packages.vmware.com/packages/rhel7/x86_64/
      enabled = 1
      gpgcheck = 1
    2. Install the package:
      $ sudo yum install open-vm-tools-deploypkg
      See knowledge base article 2075048, Installing the deployPkg plug-in in a Linux virtual machine, at http://kb.vmware.com/kb/2075048.

For additional information, see:

VMware Tools

For additional information on VMware Tools, see knowledge base article 1014294, General VMware Tools installation instructions, at http://kb.vmware.com/kb/1014294.

Knowledge Base Articles for CentOS 7

The following link refers to knowledge base articles on operating system specific issues. See VMware Knowledge Base for a list of known issues about the operating system.

VMware Compatibility Guide

The VMware Compatibility Guide Web site lists supported guest and host operating systems and provides related support information.”

 

 

Here we go.

 

  1. Login to the linux guest via putty.
  2. Login as root:
  3. [email protected]’s password. I entered the password.
  4. # yum install open-vm-tools -y

Then I wanted to update Centos as well.

 

  1. yum update -y
  2. shutdown -r -t now

 

Now lets look at the VM in the vSphere client.

 

 

 

 

centos7_vmware_tools_vm_selection centos7_vmware_tools_install

Now we have Running VMware Tools!

 

 

Roger L[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]