FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


preparation:target:fasthandle-init.htmlt



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
preparation:target:fasthandle-init.htmlt [2017/12/20 01:27]
kurihara
preparation:target:fasthandle-init.htmlt [2019/02/13 22:07] (current)
kurihara
Line 24: Line 24:
  
 \\ \\
-===== FastHandle-init Examples=====+===== fh-init.sh (FastHandle-init Examples)=====
 ==== RHEL7/CentOS7 ==== ==== RHEL7/CentOS7 ====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 32: Line 32:
 # #
 # How to use # How to use
 +#     ./fh-init.sh
 #     ./fh-init.sh  test-server-01 #     ./fh-init.sh  test-server-01
-# 
 #================================================= #=================================================
  
Line 61: Line 61:
 </sxh> </sxh>
  
 +==== RHEL6/CentOS6 ====
 +<sxh bash toolbar:false gutter:false>
 +#!/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
 +
 +@
 +</sxh>
  
  


preparation/target/fasthandle-init.htmlt.1513700869.txt.gz · Last modified: 2017/12/20 01:27 by kurihara