Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
22 manifests/apt/sources_list.pp
@@ -0,0 +1,22 @@
+define pbuilder::apt::sources_list (
+ $pbuilder_name,
+ $ensure='present',
+ $source=false,
+ $content=false,
+ $pbuilder_type='pbuilder'
+) {
+
+ if $source {
+ file {"/etc/pbuilder/${pbuilder_name}/apt/sources.list.d/${name}.list":
+ ensure => $ensure,
+ source => $source,
+ notify => Exec["update ${pbuilder_type} ${pbuilder_name}"],
+ }
+ } else {
+ file {"/etc/pbuilder/${pbuilder_name}/apt/sources.list.d/${name}.list":
+ ensure => $ensure,
+ content => $content,
+ notify => Exec["update ${pbuilder_type} ${pbuilder_name}"],
+ }
+ }
+}
View
57 manifests/cowbuilder.pp
@@ -0,0 +1,57 @@
+define pbuilder::cowbuilder (
+ $ensure='present',
+ $dist=$lsbdistcodename,
+ $arch=$architecture,
+ $cachedir='/var/cache/pbuilder',
+ $confdir='/etc/pbuilder',
+ $pbuilderrc=''
+) {
+
+ include pbuilder::cowbuilder::common
+
+ $cowbuilder = '/usr/sbin/cowbuilder'
+ $basepath = "${cachedir}/base-${name}.cow"
+
+ case $ensure {
+ present: {
+ file {
+ "${confdir}/${name}":
+ ensure => directory,
+ require => Package['pbuilder'];
+
+ "${confdir}/${name}/apt":
+ ensure => directory,
+ require => File["${confdir}/${name}"];
+
+ "${confdir}/${name}/apt/sources.list.d":
+ ensure => directory,
+ require => File["${confdir}/${name}/apt"];
+
+ "${confdir}/${name}/pbuilderrc":
+ ensure => present,
+ content => $pbuilderrc,
+ }
+
+ exec {
+ "create cowbuilder ${name}":
+ command => "${cowbuilder} --create --basepath ${basepath} --dist ${dist} --architecture ${arch}",
+ require => File['/etc/pbuilderrc'],
+ creates => $basepath;
+
+ "update cowbuilder ${name}":
+ command => "${cowbuilder} --update --configfile ${confdir}/${name}/pbuilderrc --override-config --basepath ${basepath} --dist ${dist} --architecture ${arch}",
+ refreshonly => true;
+ }
+ }
+
+ absent: {
+
+ }
+
+ default: {
+ fail("Wrong value for ensure: ${ensure}")
+ }
+ }
+
+
+}
View
35 manifests/cowbuilder/common.pp
@@ -0,0 +1,35 @@
+class pbuilder::cowbuilder::common inherits pbuilder::common {
+ package {'cowbuilder':
+ ensure => installed,
+ }
+
+ file {'/etc/pbuilderrc':
+ ensure => present,
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ content => '# file managed by puppet
+MIRRORSITE="http://ftp.debian.org/debian"
+
+DEBBUILDOPTS="-sa"
+unset DEBOOTSTRAPOPTS
+
+NAME=$(sed -e "s@.*/base-\([^ \t/]\+\)\.cow.*@\1@" <<<$SUDO_COMMAND)
+
+if [ -z $NAME ]; then
+ echo "W: Could not parse pbuilder name"
+else
+ if [ -d "/etc/pbuilder/${NAME}/apt" ]; then
+ APTCONFDIR="/etc/pbuilder/${NAME}/apt"
+ fi
+
+ if [ -f "/etc/pbuilder/${NAME}/pbuilderrc" ]; then
+ echo "I: Including /etc/pbuilder/${NAME}/pbuilderrc" >&2
+ . "/etc/pbuilder/${NAME}/pbuilderrc"
+ else
+ echo "I: Could not find /etc/pbuilder/${NAME}/pbuilderrc" >&2
+ fi
+fi
+',
+ }
+}

No commit comments for this range

Something went wrong with that request. Please try again.