Yeah don't use -c local if just some of your machines are local
- hosts: localhost
connection: local
tasks:
- ...
- hosts: other
tasks:
- ...
You can also set ansible_connection=local as an inventory variable.
Ansible will assume localhost means local if not explicitly defined in
inventory.
On Tue, Jul 15, 2014 at 11:52 AM, Michael Vermaes <[email protected]>
wrote:
> Sorry, disregard my comment - I misread the question. I missed the
> reference to the remote machine and was assuming all directories mentioned
> were local, and the play was being executed with '-c local'. This does seem
> to work, but probably isn't what is being requested.
>
>
> On Tue, Jul 15, 2014 at 11:39 PM, Michael DeHaan <[email protected]>
> wrote:
>
>> "Is it possible to pull a local repo to a remote machine?"
>>
>> Not directly.
>>
>> You could check out locally and use the synchronize module instead.
>>
>>
>>
>>
>> On Tue, Jul 15, 2014 at 11:10 AM, mvermaes <[email protected]> wrote:
>>
>>> The docs for the module don't specifically mention local repos, but I
>>> can't see anything that would prevent it and it worked for me. I think you
>>> just need to remove the trailing .git in the repo specification. Try:
>>>
>>> - name: pull the code
>>> git: repo=file:///home/username/myproject/ dest=/var/www
>>>
>>>
>>> On Tuesday, July 15, 2014 6:14:23 PM UTC+8, [email protected] wrote:
>>>>
>>>> I do not have remote git repo, only a local one. Is it possible to pull
>>>> a local repo to a remote machine?
>>>>
>>>> I tried the following:
>>>>
>>>> - name: pull the code
>>>> git: repo=file:///home/username/myproject/.git dest=/var/www
>>>>
>>>> and got an error:
>>>>
>>>> stderr: fatal: '/home/username/myproject/.git' does not appear to be a
>>>> git repository
>>>> fatal: Could not read from remote repository.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>> 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/68471377-4f6d-4df9-91f2-f88d2824da48%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/68471377-4f6d-4df9-91f2-f88d2824da48%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 a topic in the
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/ansible-project/XQXziYe2bnw/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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%2BnsWgx6pzQUtop%2BbF%3DtH8hN4VYzhJR-BcHhgC-%2Bm3_z6eijVw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgx6pzQUtop%2BbF%3DtH8hN4VYzhJR-BcHhgC-%2Bm3_z6eijVw%40mail.gmail.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/CAAQZgJyP9Jio6xeJGcUf0XPiFtteUG6UnC%2B0rtHBrQYrv1DY-Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAAQZgJyP9Jio6xeJGcUf0XPiFtteUG6UnC%2B0rtHBrQYrv1DY-Q%40mail.gmail.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%2BnsWgzNmagE1K_PJJRPoRUdAwGCVjy-oO6Nh88ffGMGgs3FDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.