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/11/13 00:55]
kurihara
preparation:target:fasthandle-init.htmlt [2019/02/13 22:07] (current)
kurihara
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 23: Line 24:
  
 \\ \\
-===== FastHandle-init Sample=====+===== fh-init.sh (FastHandle-init Examples)=====
 ==== RHEL7/CentOS7 ==== ==== RHEL7/CentOS7 ====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 #!/bin/bash #!/bin/bash
-fasthandle-init.sh+#================================================= 
 +# fh-init.sh   HOSTNAME 
 +
 +# How to use 
 +#     ./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.1510502150.txt.gz · Last modified: 2017/11/13 00:55 by kurihara