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/12/18 00:02]
kurihara
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:
 [[:index.html#Preparation|Top#Preparation]] [[:index.html#Preparation|Top#Preparation]]
-====== FastHandle-init for Target Server (fasthandle-init.sh)======+====== FastHandle-init for Target Server (fh-init.sh)======
 \\ \\
 {{INLINETOC}} {{INLINETOC}}
Line 12: Line 12:
   -OS preparation with Network Configuration   -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 29: 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
 #================================================= #=================================================
  
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.txt · Last modified: 2019/02/13 22:07 by kurihara