This all rings a vague bell, I ended up going through the ansible module code
to figure out what it was playing at (I gave up and just built the code into an
RPM, hence my answer being a bit outdated - sorry about that).

I've seen similar issues with get_url (which suffers from the same problem).

One way to get around it is to set "dest=" to a folder named after the commit
you want.
Combined with update=no you'll save the time tax on subsequent runs when
the commit is constant, but be able to check out fresh code when you update
the desired commit var.

On 20 February 2015 at 11:14, nrser <[email protected]> wrote:
> it was doing a remote request even when the `version` parameter was set and
> the local copy was at that tag. here's what was in the meta file that
> triggered it:
>
> ---
> dependencies:
>   - role: github_repo
>     owner: kcrawford
>     name: dockutil
>     version: 2.0.2
>
> i can understand always hitting the wire if the version isn't set (which i
> would assume to indicate you want HEAD), but i dodn't understand the network
> access when the version is provided and the local copy is already at that
> version. it even does so when `version` is set to a specific commit, which,
> from my understanding of git would make needed a change impossible (the
> commit could be gone from the remote repo, but it should not be possible for
> that same commit hash to point to a different state of the repo, right?).
>
> as i said before, given the nature of git i can understand there being some
> corner cases where an update is necessary to have the correct checkout - for
> a tag, maybe the it now points to a different commit - but these seems like
> rare instances to pay 25 seconds per repo for by default.
>
> On Friday, February 20, 2015 at 7:01:56 PM UTC+8, Dick Davies wrote:
>>
>> Be a bit careful with that - that repo isn't going to update once it's
>> checked
>> out ( a bit like 'state=present' on a RPM resource).
>> That might be what you want, of course :)
>>
>> I found a good compromise of network activity vs. control was to use the
>> "version=" parameter and point at a tag/commit. That's easy enough to set
>> as a var and makes sure I'm getting the code I want, rather than HEAD
>> (especially important if you have handlers attached to that task that you
>> don't want firing every run).
>>
>>
>> On 20 February 2015 at 10:36, nrser <[email protected]> wrote:
>> > it looks like the parameter i was looking for was `update=no`, which
>> > seems
>> > to prevent the remote request. something like:
>> >
>> > - name: clone {{ owner }}/{{ name }} from github
>> >   git:
>> >     repo: "[email protected]:{{ owner }}/{{ name }}"
>> >     dest: "{{ gh_root }}/{{ owner }}/{{ name }}"
>> >     update: "{{ update | default(no) }}"
>> >
>> >
>> > On Wednesday, February 18, 2015 at 11:00:03 PM UTC+8, Brian Coca wrote:
>> >>
>> >> can you show the git task?
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Brian Coca
>> >
>> > --
>> > 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 [email protected].
>> > To post to this group, send email to [email protected].
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/ansible-project/6a4ed7dc-8186-403a-a4a7-c7be41929718%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK5eLPSvP9k_FzhRhqOiMbOSEbJvZdc1dDpn81Li6Z2DXtg1Nw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to