FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


middleware:postfix:index.html



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
middleware:postfix:index.html [2017/12/17 23:48]
kurihara
middleware:postfix:index.html [2018/02/21 23:50]
kurihara
Line 1: Line 1:
 [[:index.html#Middleware Management|Top#Middleware Management]] [[:index.html#Middleware Management|Top#Middleware Management]]
-====== Postfix ======+====== Postfix (postfix.py) ====== 
 + 
 +$FHHOME/fabfile/postfix.py
  
-\\ 
 {{INLINETOC}} {{INLINETOC}}
 \\ \\
  
-===== Operation =====+===== Postfix Operation with Fabric =====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-echo a |fab -l |grep postfix+$ fab -l |grep postfix
-  +
-$ echo xx.xx.xx.xx | fab  pro  postfix.yum_install +
-$ echo xx.xx.xx.xx | fab  stg  postfix.+
 </sxh> </sxh>
  
 +<sxh bash toolbar:false gutter:false>
 +$ fab  -H auht.pro  postfix.yum_install
 +</sxh>
  
 \\ \\
-===== postfix.py Fabric Recipes =====+==== Fabric Temporary Run Call Examples ==== 
 +<sxh bash toolbar:false gutter:false> 
 +$ H=test-server-1,test-server-2
  
 +$ fab  -H $H auth.pro  -- "ps aux |grep postfix"
 +
 +$ fab  -H $H auth.pro  -- sudo systemctl status postfix
 +$ fab  -H $H auth.pro  -- sudo systemctl restart postfix
 +
 +$ fab  -H $H auth.pro  -- postconf    # list all configuration
 +$ fab  -H $H auth.pro  -- postconf -n    # Display only parameters different from default
 +$ fab  -H $H auth.pro  -- postconf -d    # list default configuraiton
 +
 +
 +$ fab  -H $H auth.pro  -- "ls /var/spool/mqueue |wc -l"    # List Queue
 +$ fab  -H $H auth.pro  -- "mailq  |wc -l"   # List Queue
 +$ fab  -H $H auth.pro  -- "postqueue -p |wc -l"
 +$ fab  -H $H auth.pro  -- postcat -q QUEUE_ID    # show Postfix queue file contents
 +</sxh>
  
  
  
 \\ \\
-===== Configuration ===== +===== postfix.py ===== 
-  *[[middleware:postfix:main.cf.html]]+$FHHOME/fabfile/postfix.py
  
  
 +<sxh bash toolbar:false gutter:false>
 +import sys
 +from fabric.api import *
 +from fabric.contrib import files
 + 
 +#----------------------------------------------------------------------
 +# Installing Postfix
 +#----------------------------------------------------------------------
 +# postfix.install_yum
 +@task
 +def install_yum():
 +    sudo("rpm -q postfix        > /dev/null 2>&1 || yum -y install postfix")
  
 +
 +#----------------------------------------------------------------------
 +# Queue
 +#----------------------------------------------------------------------
 +# postfix.check_queue_num
 +@task
 +def postfix.check_queue_num():
 +    """ls /var/spool/mqueue | wc -l"""
 +    #sudo("mailq")
 +    sudo("ls /var/spool/mqueue | wc -l")
 +
 +
 +</sxh>
 +
 +
 +\\
 +===== Postfix Configuration Examples=====
 +  *[[middleware:postfix:conf001.html]]
 +
 +  *[[middleware:postfix:main.cf.html]]
 +  *[[middleware:postfix:transport.html]]
 +
 +
 +\\
 \\ \\
 +<WRAP box 90%>
 +<catlist ..: -noAddPageButton -smallHead -sortAscending>
 +</WRAP>
 \\ \\
 [[:index.html#Middleware Management|Top#Middleware Management]] [[:index.html#Middleware Management|Top#Middleware Management]]


middleware/postfix/index.html.txt · Last modified: 2019/02/11 00:46 by kurihara