0

In .pp file:

replication => [

{

  name  => 'local',

  url   => xyz,

  push  => ['refs/heads', 'refs/tags'],

},

{

  name  => 'github',

  url   => abc,

  push  => ['refs/heads', 'refs/tags'],

},

]

How to define template to output the replication.config file looks like below:

[remote "local"]

url  = abc

push = refs/heads

push = refs/tags



[remote "github"]

url  = abc

push = refs/heads

push = refs/tags
Tim Brigham
  • 15,545
  • 10
  • 75
  • 115
user1536782
  • 71
  • 1
  • 2
  • If this is for Gerrit, have you tried [one of the modules available in the Forge](https://forge.puppetlabs.com/modules?utf-8=%E2%9C%93&sort=rank&q=gerrit)? – Aaron Copley Jan 19 '16 at 21:19
  • Not a complete answer, but you might look at the [Augeas INI file lens](http://augeas.net/docs/references/lenses/files/inifile-aug.html) or Puppet 4's [iteration and loops](https://docs.puppet.com/puppet/latest/reference/lang_iteration.html). – CodeGnome Oct 22 '16 at 05:37

1 Answers1

0

You could create a defined resource type based on a template and use puppetlabs-concat to join two parts based on the same template into your desired replication.config.

Aaron Copley
  • 12,525
  • 5
  • 47
  • 68