From ee10020db29c624584452154b677be5e729b8605 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 20 Aug 2013 22:22:34 +0000 Subject: mgagit: Hopefully fix my puppet syntax errors This just splits the template writer out into it's own define. --- deployment/mgagit/manifests/init.pp | 22 ++++++---------------- deployment/mgagit/manifests/tmpl.pp | 9 +++++++++ deployment/mgagit/templates/group_owned_repo.gl | 10 +++++----- 3 files changed, 20 insertions(+), 21 deletions(-) create mode 100644 deployment/mgagit/manifests/tmpl.pp (limited to 'deployment') diff --git a/deployment/mgagit/manifests/init.pp b/deployment/mgagit/manifests/init.pp index f2002d94..d8912bec 100644 --- a/deployment/mgagit/manifests/init.pp +++ b/deployment/mgagit/manifests/init.pp @@ -61,24 +61,14 @@ class mgagit( content => template('mgagit/repodef_repo.gl'), } - $repogroup = 'packagers' - $repoml = 'soft' - file { "$gitolite_tmpldir/soft_repo.gl": - ensure => present, - owner => root, - group => root, - mode => '0644', - content => template('mgagit/group_owned_repo.gl'), + define mgagit::tmpl { 'soft': + tmpdir => $gitolite_tmpldir, + group => 'packages', } - $repogroup = 'web' - $repoml = 'atelier' - file { "$gitolite_tmpldir/web_repo.gl": - ensure => present, - owner => root, - group => root, - mode => '0644', - content => template('mgagit/group_owned_repo.gl'), + define mgagit::tmpl { 'web': + tmpdir => $gitolite_tmpldir, + ml => 'atelier', } file { [$gitolite_dir, $gitolite_keydir, $gitolite_confdir, diff --git a/deployment/mgagit/manifests/tmpl.pp b/deployment/mgagit/manifests/tmpl.pp new file mode 100644 index 00000000..3ef10aaa --- /dev/null +++ b/deployment/mgagit/manifests/tmpl.pp @@ -0,0 +1,9 @@ +define mgagit::tmpl($tmpldir, $group = $title, $ml = $title) { + file { "$tmpldir/${title}_repo.gl": + ensure => present, + owner => root, + group => root, + mode => '0644', + content => template('mgagit/group_owned_repo.gl'), + } +} diff --git a/deployment/mgagit/templates/group_owned_repo.gl b/deployment/mgagit/templates/group_owned_repo.gl index 0e5ae7c1..9187757d 100644 --- a/deployment/mgagit/templates/group_owned_repo.gl +++ b/deployment/mgagit/templates/group_owned_repo.gl @@ -5,10 +5,10 @@ repo [% repo %] RW topic/ = [% maintainer %] RW refs/tags/ = [% maintainer %] [% IF r.repos.$repo.lockdown != 'yes' -%] - RW master$ = @mga-<%= @repogroup %> - RW distro/ = @mga-<%= @repogroup %> - RW topic/ = @mga-<%= @repogroup %> - RW refs/tags/ = @mga-<%= @repogroup %> + RW master$ = @mga-<%= @group %> + RW distro/ = @mga-<%= @group %> + RW topic/ = @mga-<%= @group %> + RW refs/tags/ = @mga-<%= @group %> [% END -%] RW+ user/USER/ = @all R = @all @@ -18,7 +18,7 @@ repo [% repo %] [% IF r.repos.$repo.mailinglist -%] config hooks.mailinglist = "[% r.repos.$repo.mailinglist %]" [% ELSE -%] - config hooks.mailinglist = "<%= @repoml %>-commits@ml.mageia.org" + config hooks.mailinglist = "<%= @ml %>-commits@ml.mageia.org" [% END -%] [% END -%] config hooks.emailprefix = "[% repo %] " -- cgit v1.2.1