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
Last revision Both sides next revision
preparation:target:fasthandle-init.htmlt [2017/11/18 23:34]
kurihara [RHEL7/CentOS7]
preparation:target:fasthandle-init.htmlt [2018/01/30 01:54]
kurihara ↷ Page moved and renamed from preparation:fasthandle-init.html to preparation:target:fasthandle-init.htmlt
Line 1: Line 1:
-====== FastHandle-init ======+[[:index.html#Preparation|Top#Preparation]] 
 +====== FastHandle-init for Target Server (fh-init.sh)======
 \\ \\
 {{INLINETOC}} {{INLINETOC}}
Line 9: Line 10:
 \\ \\
 ===== How to use FastHandle-init ===== ===== How to use FastHandle-init =====
-  -OS preparation+  -OS preparation with Network Configuration
   -Create fasthandle-init.sh <sxh bash toolbar:false gutter:false>   -Create fasthandle-init.sh <sxh bash toolbar:false gutter:false>
-vi fasthandle-init.sh+vi fh-init.sh
 </sxh> </sxh>
   -Change Permission <sxh bash toolbar:false gutter:false>   -Change Permission <sxh bash toolbar:false gutter:false>
-chown 755 fasthandle-init.sh+chown 755 fh-init.sh
 </sxh> </sxh>
   -Execute fansthandle-init.sh <sxh bash toolbar:false gutter:false>   -Execute fansthandle-init.sh <sxh bash toolbar:false gutter:false>
-./fasthandle-init.sh test-server-01+./fh-init.sh test-server-01
 </sxh> </sxh>
  
Line 28: Line 29:
 #!/bin/bash #!/bin/bash
 #================================================= #=================================================
-fasthandle-init.sh   HOSTNAME+fh-init.sh   HOSTNAME
 # #
 # How to use # How to use
-#     ./fasthandle-init.sh  test-server-01 +#     ./fh-init.sh 
-#+#     ./fh-init.sh  test-server-01
 #================================================= #=================================================
  
 # Hostname Settings # Hostname Settings
-HOSTNAME=$1 +if [ ! -z $1 ] ; then 
-hostname $HOSTNAME +    HOSTNAME=$1 
-hostnamectl set-hostname $HOSTNAME+    hostname $HOSTNAME 
 +    hostnamectl set-hostname $HOSTNAME 
 +fi 
  
 # Create fasthandle user # Create fasthandle user
 useradd fasthandle useradd fasthandle
 echo 'fasthandle:fastpass' | chpasswd 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> </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>
 +
 +
 +
 +\\
 +<WRAP box 90%>
 +[[:index.html#Preparation|Top#Preparation]]
 +<catlist -noAddPageButton -noHead>
 +</WRAP>
 +\\
 +[[:index.html#Preparation|Top#Preparation]]


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