How does the git module work?
a) Does it do a pull on the remote server?
b) Does it first do a pull on the local admin server and then rsync copy the repo to the remote server?
If not, is it possible to do this in some other way?
Thanks
How does the git module work?
a) Does it do a pull on the remote server?
b) Does it first do a pull on the local admin server and then rsync copy the repo to the remote server?
If not, is it possible to do this in some other way?
Thanks
fre 2017-09-29 klockan 14:03 -0700 skrev indraj joglekar:
How does the git module work?
a) Does it do a pull on the remote server?
b) Does it first do a pull on the local admin server and then rsync
copy the repo to the remote server?
The clone/pull happens locally on the remote server.
If not, is it possible to do this in some other way?
Which way would you prefer it to work?
// Andreas
I see. The remote server needs to have access to the git server in that case.
Ideally would like it to be
a) “Pull on Local and rsync to remote”
b) or “Pull on Local from git server” and “Push to remote server from local server”
c) or “Pull on Local from git server” and “Pull on remote server from local server”
so as to avoid any remote server dependencies.
We do that all the time with local_action, module: git or module: subversion, and then synchronize onto the server, in a two -step process.
Some internal servers just do not have a route into the internet. The local dir is then ignored in .gitignore or svnprop svn:ignore.
Random example:
**-** **name**: get code for collectdweb
**local_action**:
**module**: git
**repo**: https://github.com/httpdss/collectd-web.git
**dest**: "{{ role_path }}/files/collectd-web.git"
**run_once**: true
**check_mode**: no
**changed_when**: no
**-** **name**: deploy code to server
**synchronize**:
**src**: {{ item.src }}
**dest**: {{ item.dest }}
**delete**: yes
**checksum**: yes
**perms**: no
**times**: no
**rsync_opts**: "--chown=www-data:www-data --cvs-exclude"
**with_items**:
**-** { **src**: 'collectd-web.git/', **dest**: '/home/www/collectd-web/' }
tags: rsync