FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Sidebar


Top     SiteMap

Manager Server

Target Server

$FHHOME/bin/xxx.sh | xxxx.exp













.

preparation:target:fasthandle-init.htmlt



Top#Preparation

FastHandle-init for Target Server (fh-init.sh)

What is FastHandle-init

FastHandle-init is a Basic OS Setting Script before installing FastHandle.


How to use FastHandle-init

  1. OS preparation with Network Configuration
  2. Create fasthandle-init.sh
    vi fh-init.sh
    
  3. Change Permission
    chown 755 fh-init.sh
    
  4. Execute fansthandle-init.sh
    ./fh-init.sh test-server-01
    


fh-init.sh (FastHandle-init Examples)

RHEL7/CentOS7

#!/bin/bash
#=================================================
# fh-init.sh   HOSTNAME
#
# How to use
#     ./fh-init.sh
#     ./fh-init.sh  test-server-01
#=================================================

# Hostname Settings
if [ ! -z $1 ] ; then
    HOSTNAME=$1
    hostname $HOSTNAME
    hostnamectl set-hostname $HOSTNAME
fi


# Create fasthandle user
useradd fasthandle
echo 'fasthandle:fastpass' | chpasswd


# sudoers
cp -p  /etc/sudoers  /etc/sudoers.`date -d '1day ago' +%Y%m%d`

cat << @ >> /etc/sudoers


# FastHandle
fasthandle    ALL=(ALL)   NOPASSWD:ALL

@

RHEL6/CentOS6

#!/bin/bash
#=================================================
# fh-init.sh   HOSTNAME
#
# How to use
#     ./fh-init.sh
#     ./fh-init.sh  test-server-01
#=================================================

# Hostname Settings
if [ ! -z $1 ] ; then
    HOSTNAME=$1
    hostname $HOSTNAME
    
    #/etc/sysconfig/network
    cp -p /etc/sysconfig/network /etc/sysconfig/network.`date '+%Y%m%d'
    grep -v HOSTNAME /etc/sysconfig/network > /tmp/network
    cat /tmp/network > /etc/sysconfig/network
    echo HOSTNAME=$H >> /etc/sysconfig/network
fi


# Create fasthandle user
useradd fasthandle
echo 'fasthandle:fastpass' | chpasswd


# sudoers
cp -p  /etc/sudoers  /etc/sudoers.`date -d '1day ago' +%Y%m%d`

cat << @ >> /etc/sudoers


# FastHandle
fasthandle    ALL=(ALL)   NOPASSWD:ALL

@


Top#Preparation



Top#Preparation



preparation/target/fasthandle-init.htmlt.txt ยท Last modified: 2019/02/13 22:07 by kurihara