git version not cloning branch

7 views
Skip to first unread message

jtim....@gmail.com

unread,
Aug 16, 2018, 11:57:33 PM8/16/18
to Ansible Project
hi,
I'm using the git module, specifying 'centos' as the version. 'centos' is the name of a branch in my gitlab repo.
No errors, and the clone part works but always 'master' is what's left in the destination. I suppose the code actually does a clone and then a checkout of the branch.
So it looks like the checkout is not happening.

ansible 2.6.2, python 2.7.5

I get this response:
changed: [mymachine] => (item={u'version': u'centos', u'reponame': u'myrepo', u'destname': u'/path/to/code/repodir'})

What am I doing wrong? This is the relevant snip from my playbook.

- name: retrieve repos
become_user: myusername
git:
repo: g...@gitlab.myco.com:myusername/{{ item.reponame }}.git
accept_hostkey: yes
ssh_opts: "-o StrictHostKeyChecking=no"
clone: yes
force: yes
dest: "{{ item.destname }}"

loop:
- {'reponame': 'myrepo', 'destname': "{{coderoot}}/myrepo", 'version': 'centos'}
more repos go here...

Jonathan Lozada De La Matta

unread,
Aug 17, 2018, 12:36:57 AM8/17/18
to ansible...@googlegroups.com
you need to add version: centos

--
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/b4ba1286-214e-4846-bfb4-67e9f7dce0b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Jonathan lozada de la matta

AUTOMATION CONSULTANT - AUTOMATION PRACTICE

Red Hat Consulting Services

jloz...@redhat.com   



 

Reply all
Reply to author
Forward
0 new messages