FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Sidebar


Top     SiteMap

Manager Server

Target Server

$FHHOME/bin/xxx.sh | xxxx.exp













.

os:package:centos-service.html



This is an old revision of the document!


The namespace os:package does not exist

conf.html

CentOS Service Enable/Disabple

Operation

$ echo a |fab -l |grep service

$ echo xx.xx.xx.xx | fab  pro  centos_service.centos7_common


centos_service.py

import sys
from fabric.api import *
from fabric.contrib import files


#-------------------------------------------------------------------------------
# CentOS7
#-------------------------------------------------------------------------------
@task
def centos7_check_service():
    sudo("systemctl list-unit-files -t service |egrep "enable|disable" |sort -k 3")

@task
def centos7_common():
    #enable
    sudo("systemctl enable sysstat.service")
    sudo("systemctl enable snmpd.service")

    #disable
    sudo("systemctl disable firewalld.service")
    sudo("systemctl disable NetworkManager.service")



#-------------------------------------------------------------------------------
# CentOS6
#-------------------------------------------------------------------------------




conf.html



os/package/centos-service.html.1511866694.txt.gz ยท Last modified: 2017/11/28 19:58 by kurihara