Hello everyoneI am starting with Ansible and I really like it so far. But at the moment I'm kinda stuck, because I can't clone from a repository.I have also posted this question on StackOverflow, but it seems that there is more activity on this Google Usergroup.--When I try to clone a repository from Bitbucket with Ansible, it seems like the task 'hangs'.In the I have found some information, but I'm not using SSH.If the task seems to be hanging, first verify remote host is in
known_hosts. SSH will prompt user to authorize the first contact with
a remote host. One solution is to add StrictHostKeyChecking no in
.ssh/config which will accept and authorize the connection on behalf
of the user. However, if you run as a different user such as setting
sudo to True), for example, root will not look at the user .ssh/config
setting.These are the two Playbooks I've tried. They both 'hang'.Playbook #1
- hosts: staging_mysqluser: ec2-usersudo: yesvars_files:- vars/mercurial.ymltasks:- name: Mercurial credentials setupaction: template src=templates/hgrc.j2 dest=/home/ec2-user/.hgrc- name: Install Mercurialaction: yum name=hg- name: Setup API repositoryaction: command hg clone https://bbuse...@bitbucket.org/username/my-repo -r default --debugPlaybook #2- hosts: staging_mysqluser: ec2-usersudo: yesvars_files:- vars/mercurial.ymltasks:- name: Mercurial credentials setupaction: template src=templates/hgrc.j2 dest=/home/ec2-user/.hgrc- name: Install Mercurialaction: yum name=hg- name: Clone API repohg: dest=/home/ec2-user repo=https://bbuse...@bitbucket.org/username/my-repoAny help is welcome as I'd like to continue with Ansible. Thanks in advance!
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
The authenticity of host 'bitbucket.org (131.103.20.167)' can't be established.It happens when I try to clone manually from SSH.
RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)?
Hi, Niels,
I can clone on my localhost with following playbook.
-------------------------
- hosts: localhost
user: shirou
sudo: no
tasks:
- name: Clone API repo
hg: dest=/tmp/ansible-test
>> https://bbusername@bitbucket.org/username/my-repo -r default --debug
>>
>> Playbook #2
>>
>> - hosts: staging_mysql
>> user: ec2-user
>> sudo: yes
>>
>> vars_files:
>> - vars/mercurial.yml
>>
>> tasks:
>> - name: Mercurial credentials setup
>> action: template src=templates/hgrc.j2 dest=/home/ec2-user/.hgrc
>>
>> - name: Install Mercurial
>> action: yum name=hg
>>
>> - name: Clone API repo
>> hg: dest=/home/ec2-user
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/38ea70de-5b1f-455d-89f8-736cdf1cdbf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.