FastHandle is fast operation tools for infrastructure configurations and tests.
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
os:package:rpm.html [2017/12/11 00:17] kurihara |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | [[os: | ||
| - | ~~NOTOC~~ | ||
| - | ====== RPM Management====== | ||
| - | |||
| - | |||
| - | ===== Operation ===== | ||
| - | |||
| - | <sxh bash toolbar: | ||
| - | $ fab -l |grep rpm | ||
| - | |||
| - | $ echo xx.xx.xx.xx | fab auth.pro | ||
| - | $ echo xx.xx.xx.xx | fab auth.pro | ||
| - | </ | ||
| - | |||
| - | \\ | ||
| - | ===== rpm.py ===== | ||
| - | |||
| - | <sxh python toolbar: | ||
| - | import sys | ||
| - | from fabric.api import * | ||
| - | from fabric.contrib import files | ||
| - | |||
| - | FHHOME=os.environ[" | ||
| - | |||
| - | # | ||
| - | # CentOS7 Common | ||
| - | # | ||
| - | @task | ||
| - | @task | ||
| - | def common(): | ||
| - | put(" | ||
| - | sudo(" | ||
| - | |||
| - | # | ||
| - | #CentOS6 Common | ||
| - | # | ||
| - | |||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | \\ | ||
| - | ===== rpm-centos7.sh ===== | ||
| - | |||
| - | <sxh bash toolbar: | ||
| - | #!/bin/bash | ||
| - | # rpm-centos.sh | ||
| - | # | ||
| - | # How to use | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | |||
| - | if [ -z $1 ]; then | ||
| - | echo " | ||
| - | exit 1 | ||
| - | fi | ||
| - | |||
| - | centos7() { | ||
| - | rpm -q epel-release | ||
| - | rpm -q bash-completion | ||
| - | rpm -q traceroute | ||
| - | rpm -q vim-enhanced | ||
| - | rpm -q tree > /dev/null 2>&1 || yum -y install tree | ||
| - | rpm -q telnet | ||
| - | rpm -q bind-utils | ||
| - | rpm -q tcpdump | ||
| - | rpm -q sysstat | ||
| - | rpm -q tcpdump | ||
| - | rpm -q net-snmp | ||
| - | rpm -q net-snmp-utils | ||
| - | rpm -q wget > /dev/null 2>&1 || yum -y install wget | ||
| - | rpm -q rsync > /dev/null 2>&1 || yum -y install rsync | ||
| - | rpm -q nmap > /dev/null 2>&1 || yum -y install nmap | ||
| - | rpm -q net-tools | ||
| - | rpm -q mailx > /dev/null 2>&1 || yum -y install mailx | ||
| - | rpm -q nmap-ncat | ||
| - | } | ||
| - | |||
| - | |||
| - | # | ||
| - | case ${1} in | ||
| - | centos7) centos7 | ||
| - | ;; | ||
| - | centos6) centos6 | ||
| - | ;; | ||
| - | nginx) nginx | ||
| - | ;; | ||
| - | *) echo "$1 option is valid" | ||
| - | ;; | ||
| - | esac | ||
| - | </ | ||
| - | |||
| - | \\ | ||
| - | <WRAP box 90%> | ||
| - | [[os: | ||
| - | <catlist -noAddPageButton -noHead> | ||
| - | </ | ||
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.