Right now the git module doesn't really like it when you change from one
repo to another.

You might solve this by removing the directory prior to calling the git
module, which obviously has some side effects, but this seems to ring with
a "don't do that" kind of answer, which you might not like.

If you are testing your branch, it seems you should deploy that to a test
VM, and production should always go off the same repo, as a matter of
policy...

Not saying a repo switch on the directory should not be possible, but it's
a bit of a niche thing, and even git doesn't really support "replace this
repo with that one in the same place".




On Mon, Apr 28, 2014 at 6:27 PM, Alexandr Kurilin <[email protected]>wrote:

> Hello folks,
>
> I set up my deployment flow in such a way that Ansible clones a git repo
> locally (generally named "myrepo-deploy" and never modified by hand),
> cleans and syncs it as master, builds the contents and deploys them to
> either dev, production or pre-production depending on which hosts file I
> choose for ansible-playbook.
>
> The challenge is that sometimes I need to deploy from a modified copy of
> the above repo where development work is happening. e.g. instead of using
> clean myrepo-deploy against preproduction, I'd like to use myrepo (with
> some uncommitted modifications in it) against preproduction just for
> testing purposes.
>
> So I'd love to be able to be able to pass a switch to ansible-playbooks
> and say "use the development version of the repo just this one time".
>
>    - I know there's an option with when: and using environment variables
>    - I know I could also create a separate hosts file that's something
>    like "preprod-dev", but now I have to make one of these for each of my host
>    files and it adds an extra burden of variable maintenance in 2x files.
>
> Is there perhaps a better practice that you could recommend for this kind
> of situation?
>
> Thank you 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 [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/836e7f75-7ed3-440b-871a-d567453d6ea6%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/836e7f75-7ed3-440b-871a-d567453d6ea6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CA%2BnsWgz1-iBB2S%2BSZ0nkA58iEmpk5KMFq7V52NPGm07QrX-XYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to