注册 登录
LUPA开源社区 返回首页

wuting_linux的个人空间 http://www.lupaworld.com/?296848 [收藏] [复制] [分享] [RSS]

我的博客

ansible playbook 之——Linux机器上svn checkout 打包上传ftp

已有 106 次阅读2017-5-12 15:39 |个人分类:ansible|系统分类:IT技术| checkout, ground, Linux

- name: get ground code 
   raw:  "svn checkout url --username username --password XXX  {{ground_path}}" 
   register: result

- name: Show debug info 
   debug: var=result verbosity=0

- name: get ground code 
   raw:  "zip -r {{ground_zip_name}} /etc/ansible/svncode/ground/" 
   register: result


- name: Run expect to wait for a successful to put zip to ftp
   shell: |
  
     set timeout 300
     spawn ftp ip
     
     expect "*Name :"
     send "username\r"

     expect "Password:"
     send "password\r"

     expect "ftp>"
     send "cd DownLoad_Centre\r"

     expect "ftp>"
     send "cd WA\r"

     expect "ftp>"
     send "ls -l\r"

     expect "ftp>"
     send "lcd /etc/ansible/svncode\r"

     expect "ftp>"
     send "put ground.zip\r"

     expect "ftp>"
     send "quit\r"

     exit 0
   args:
     executable: /usr/bin/expect
   register: result

- name: Show file is exist debug info 
   debug: var=result verbosity=0

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册
验证问答 换一个 验证码 换一个

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187  

返回顶部