Skip to content

Commit 9965b7e

Browse files
authored
Merge pull request #546 from bastelfreak/proxy
document vcsrepo with git and http proxy
2 parents f9995ad + 2814734 commit 9965b7e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,31 @@ vcsrepo { '/path/to/repo':
206206
}
207207
~~~
208208

209+
To clone a HTTP repo through a proxy
210+
211+
The vcsrepo resource doesn't support a proxy configuration. However, you can configure it directly via git.
212+
Create the following `~/.gitconfig` file:
213+
214+
~~~
215+
[http]
216+
proxy = http://proxy.internal:8181
217+
~~~
218+
219+
Git will now automatically use this proxy for all repositories that are cloned via http/https:
220+
221+
~~~ puppet
222+
vcsrepo { '/path/to/repo':
223+
ensure => present,
224+
provider => git,
225+
source => 'https://example.com/repo.git',
226+
revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31',
227+
user => 'someUser',
228+
}
229+
~~~
230+
231+
You can find more information about the proxy configuration [here](https://gist.github.com/evantoli/f8c23a37eb3558ab8765).
232+
It's also possible to configure it on a per-repository level.
233+
209234
#### Use multiple remotes with a repository
210235

211236
In place of a single string, you can set `source` to a hash of one or more name => URL pairs:

0 commit comments

Comments
 (0)