FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


preparation:fhhome:auth.py.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
preparation:fhhome:auth.py.html [2017/11/26 23:08]
kurihara created
preparation:fhhome:auth.py.html [2018/05/08 00:08]
kurihara
Line 1: Line 1:
-====== fabfile/auth.py ======+[[:index.html#OS Management|Top#OS Management]] 
 +====== $FHHOME/fabfile/auth.py ======
  
  
  
-===== fabfile/auth.py =====+===== Operation ===== 
 +<sxh bash toolbar:false gutter:false> 
 +$ fab -l |grep -F auth. 
 +    auth.ciscopro                           USER=fasthandle PASSWORD=fas***s 
 +    auth.dev                                Develop # USER=fasthandle 
 +    auth.junospro                           USER=fasthandle PASSWORD=fas***s 
 +    auth.netapppro                          USER=root PASSWORD=fas***s 
 +    auth.pro                                Production # USER=fasthandle KEY 
 +    auth.stg                                Staging # USER=fasthandle KEY 
 +    auth.test1                              USER=fasthandle PASSWORD=fas***s 
 +    auth.test2                              USER=user01 PASSWORD=us***01 
 +    auth.winpro                             USER=fasthandle KEY 
 +    auth.winstg                             USER=fasthandle PASSWORD=fas***s 
 +    ..... 
 +</sxh> 
 + 
 + 
 +\\ 
 +===== $FHHOME/fabfile/auth.py ===== 
 + 
 +\\ 
 +<wrap em>Change login user and password and publickey for your servers.</wrap> 
 +\\
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 10: Line 33:
 from fabric.contrib import files from fabric.contrib import files
  
 +adding os.environ["FHHOME"]
 +
 +#------------------------------------------------------------------------
 +# Linux
 +#------------------------------------------------------------------------
 @task @task
 def pro(): def pro():
-    '''production env''' +    '''Production # USER=fasthandle KEY''' 
-    env.user = 'USER01+    env.user = 'fasthandle
-    env.key_filename = '~/.ssh/id_rsa_production+    env.key_filename = '$FHHOME/key/id_rsa.fasthandle.pro-fasthandle-1
-    env.password = 'passphrase-for-key' +    #env.password = 'passphrase-for-key' 
-  +
 @task @task
 def stg(): def stg():
-    '''staging env''' +    '''Staging # USER=fasthandle KEY''' 
-    env.user = 'USER01+    env.user = 'fasthandle
-    env.key_filename = '~/.ssh/id_rsa_develop+    env.key_filename = '$FHHOME/key/id_rsa.fasthandle.stg-fasthandle-1
-    env.password = 'passphrase-for-key' +    #env.password = 'passphrase-for-key' 
- +
 @task @task
 def dev(): def dev():
-    '''develop env''' +    '''Develop # USER=fasthandle''' 
-    env.user = 'USER02+    env.user = 'fasthandle
-    env.key_filename = '~/.ssh/id_rsa_develop+    env.key_filename = '$FHHOME/key/id_rsa.fasthandle.dev-fasthandle-1
-    env.password = 'passphrase-for-key' +    #env.password = 'passphrase-for-key' 
- +
 @task @task
-def tmp():+def test1(): 
 +    '''USER=fasthandle PASSWORD=fas***s'''
     env.user = 'fasthandle'     env.user = 'fasthandle'
     env.password = 'fastpass'     env.password = 'fastpass'
  
 @task @task
-def tmp2(): +def test2(): 
-    env.user = 'USER01+    '''USER=user01 PASSWORD=us***01''' 
-    env.password = 'PASSWORD' +    env.user = 'user01
-</sxh>+    env.password = 'user01'
  
 +#------------------------------------------------------------------------
 +# Windows
 +#------------------------------------------------------------------------
 +@task
 +def winpro():
 +    '''USER=fasthandle KEY'''
 +    env.user = 'fasthandle'
 +    env.key_filename = '$FHHOME/key/id_rsa.fasthandle.pro-fasthandle-1'
 +
 +@task
 +def winstg():
 +    '''USER=fasthandle PASSWORD=fas***s'''
 +    env.user = 'fasthandle'
 +    env.password = 'fastpass'
 +
 +#------------------------------------------------------------------------
 +# Hardware
 +#------------------------------------------------------------------------
 +@task
 +def ciscopro():
 +    '''USER=fasthandle PASSWORD=fas***s'''
 +    env.user = 'fasthandle'
 +    env.password = 'fastpass'
 +
 +@task
 +def junospro():
 +    '''USER=fasthandle PASSWORD=fas***s'''
 +    env.user = 'fasthandle'
 +    env.password = 'fastpass'
 +
 +@task
 +def netapppro():
 +    '''USER=root PASSWORD=fas***s'''
 +    env.user = 'root'
 +    env.password = 'fastpass'
 +
 +</sxh>
  
 +\\
 +<WRAP box 90%>
 +[[:index.html#OS Management|Top#OS Management]]
 +<catlist ..: -noAddPageButton -noHead>
 +</WRAP>
 +\\
 +[[:index.html#OS Management|Top#OS Management]]


preparation/fhhome/auth.py.html.txt · Last modified: 2019/02/13 00:17 by kurihara