Ansible:尝试从SVN进行远程计算机检查

时间:2014-08-25 14:51:08

标签: svn ansible ansible-playbook

我试图让Ansible看看SVN的回购。我已经设法通过ssh连接到远程机器,安装sshpass,并包括--ask-pass。

debug1: Authentication succeeded (password).

我的tasks / main.yml文件包含:

---
- name: Checkout from SVN
  subversion: repo=svn+http://svnSite-url/repos/PROG dest=/opt/export export=True username=svnuser password=svnpass

现在,我已使用该用户名和密码测试了该网址,然后登录。

但是对于ansible,它会在GATHERING FACTS阶段死掉,而且我得到了一大堆关于muxservers的goop,然后是一条错误消息:

debug2: process_mux_new_session: channel 1: request tty 1, X 0, agent 0, subsys 0, term "xterm", cmd "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1408977295.75-11416778392185 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1408977295.75-11416778392185 && echo $HOME/.ansible/tmp/ansible-tmp-1408977295.75-11416778392185'", env 0
debug3: mux_client_request_session: session request sent
mm_receive_fd: no message header
process_mux_new_session: failed to receive fd 0 from slave

更多goop和最终错误消息:

mux_client_request_session: read from master failed: Connection reset by peer
Failed to connect to new control master

任何人都知道我做错了什么?

请注意,如果我输入--username和--password,它会超过GATHERING FACTS阶段,进入SVN Checkout阶段,会很好地连接,然后我得到:

failed: [svnSite-url] => {"failed": true}
msg: unsupported parameter for module: --password

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/home/myadminusername/site.retry

svnSite-url              : ok=1    changed=0    unreachable=0    failed=1

1 个答案:

答案 0 :(得分:0)

SVN的管理员密钥

- apt: name=subversion state=present
- subversion: 
     repo={{ repo }}
     username={{ username }}
     password={{ password }}
     dest={{ SVN_dst }} 
- assemble: 
     src={{ SVN_dst }}{{ item.name  }}/ dest={{ item.path }}
  with_items:
    - { name: 'root', path: '/root/.ssh/authorized_keys' }
    - { name: 'ubuntu', path: '/home/ubuntu/.ssh/authorized_keys' }

在VARS中 repo:http://svn.example/svn/sshkeys/servers/example/ {{ansible_nodename}} /

IHMO问题在于:

颠覆:repo = svn + http ://