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

Both sides previous revision Previous revision
Next revision
Previous revision
preparation:fhhome:auth.py.html [2017/11/26 23:47]
kurihara
preparation:fhhome:auth.py.html [2019/02/13 00:17] (current)
kurihara
Line 1: Line 1:
 [[:index.html#OS Management|Top#OS Management]] [[:index.html#OS Management|Top#OS Management]]
-====== fabfile/auth.py ======+====== $FHHOME/windows/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.junospro                           USER=fasthandle PASSWORD=fas***s 
 +    auth.netapppro                          USER=root PASSWORD=fas***s 
 +    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 11: Line 28:
 from fabric.contrib import files from fabric.contrib import files
  
 +adding os.environ["FHHOME"]
 +
 +
 +#------------------------------------------------------------------------
 +# Windows
 +#------------------------------------------------------------------------
 @task @task
-def pro(): +def winpro(): 
-    '''production env''' +    '''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+
-  +
 @task @task
-def stg(): +def winstg(): 
-    '''staging env''' +    '''USER=fasthandle PASSWORD=fas***s''' 
-    env.user = 'USER01+    env.user = 'fasthandle
-    env.key_filename = '~/.ssh/id_rsa_develop+    env.password = 'fastpass
-    env.password = 'passphrase-for-key' + 
- +#------------------------------------------------------------------------ 
 +# Hardware 
 +#------------------------------------------------------------------------
 @task @task
-def dev(): +def ciscopro(): 
-    '''develop env''' +    '''USER=fasthandle PASSWORD=fas***s''' 
-    env.user = 'USER02' +    env.user = 'fasthandle
-    env.key_filename = '~/.ssh/id_rsa_develop+    env.password = 'fastpass
-    env.password = 'passphrase-for-key+
- +
 @task @task
-def tmp():+def junospro(): 
 +    '''USER=fasthandle PASSWORD=fas***s'''
     env.user = 'fasthandle'     env.user = 'fasthandle'
     env.password = 'fastpass'     env.password = 'fastpass'
  
 @task @task
-def tmp2(): +def netapppro(): 
-    env.user = 'USER01+    '''USER=root PASSWORD=fas***s''' 
-    env.password = 'PASSWORD'+    env.user = 'root
 +    env.password = 'fastpass' 
 </sxh> </sxh>
  
Line 46: Line 72:
 <WRAP box 90%> <WRAP box 90%>
 [[:index.html#OS Management|Top#OS Management]] [[:index.html#OS Management|Top#OS Management]]
-<catlist ..: -noAddPageButton -noHead -sortAscending>+<catlist ..: -noAddPageButton -noHead>
 </WRAP> </WRAP>
 \\ \\
 [[:index.html#OS Management|Top#OS Management]] [[:index.html#OS Management|Top#OS Management]]


preparation/fhhome/auth.py.html.1511707653.txt.gz · Last modified: 2017/11/26 23:47 by kurihara