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
Next revision Both sides next revision
preparation:fhhome:auth.py.html [2018/01/03 01:59]
kurihara
preparation:fhhome:auth.py.html [2018/02/05 01:33]
kurihara
Line 4: Line 4:
  
  
 +===== 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
 +    ope.cp_p_1dayago                        fab auth.pro  cp_p_1dayago:/etc/h...
 +    ope.put                                 fab auth.pro ope.scp:/home/fastha...
 +    ope.ssh                                 fab auth.pro ope.ssh
 +    ope.sshcmd                              fab auth.pro ope.sshcmd:"sudo vi ...
 +    ope.sudo_vi                             fab auth.pro ope.vi:/etc/hosts
 +</sxh>
 +
 +
 +\\
 ===== $FHHOME/fabfile/auth.py ===== ===== $FHHOME/fabfile/auth.py =====
  
 \\ \\
-<wrap hi>Change login user and password and publickkey.</wrap>+<wrap em>Change login user and password and publickey for your servers.</wrap>
 \\ \\
  
Line 15: Line 37:
 from fabric.contrib import files from fabric.contrib import files
  
 +
 +#------------------------------------------------------------------------
 +# Linux
 +#------------------------------------------------------------------------
 @task @task
 def pro(): def pro():
-    '''production env'''+    '''Production # USER=fasthandle KEY'''
     env.user = 'fasthandle'     env.user = 'fasthandle'
     env.key_filename = '$FHHOME/key/id_rsa.fasthandle.pro-fasthandle-1'     env.key_filename = '$FHHOME/key/id_rsa.fasthandle.pro-fasthandle-1'
Line 24: Line 50:
 @task @task
 def stg(): def stg():
-    '''staging env'''+    '''Staging # USER=fasthandle KEY'''
     env.user = 'fasthandle'     env.user = 'fasthandle'
     env.key_filename = '$FHHOME/key/id_rsa.fasthandle.stg-fasthandle-1'     env.key_filename = '$FHHOME/key/id_rsa.fasthandle.stg-fasthandle-1'
Line 31: Line 57:
 @task @task
 def dev(): def dev():
-    '''develop env'''+    '''Develop # USER=fasthandle'''
     env.user = 'fasthandle'     env.user = 'fasthandle'
     env.key_filename = '$FHHOME/key/id_rsa.fasthandle.dev-fasthandle-1'     env.key_filename = '$FHHOME/key/id_rsa.fasthandle.dev-fasthandle-1'
Line 37: Line 63:
  
 @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(): 
 +    '''USER=user01 PASSWORD=us***01'''
     env.user = 'user01'     env.user = 'user01'
     env.password = 'user01'     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> </sxh>


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