diff options
author | Michael Scherer <misc@mageia.org> | 2012-03-16 22:46:23 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-03-16 22:46:23 +0000 |
commit | b74151bf723df3fcadf24d2f6e00401bb69c1020 (patch) | |
tree | ca67dcadb418e482472167cca393fb4ac5a1b5b3 | |
parent | 31adbee69aa33150bd8016837b85646a948f8ad7 (diff) | |
download | puppet-b74151bf723df3fcadf24d2f6e00401bb69c1020.tar puppet-b74151bf723df3fcadf24d2f6e00401bb69c1020.tar.gz puppet-b74151bf723df3fcadf24d2f6e00401bb69c1020.tar.bz2 puppet-b74151bf723df3fcadf24d2f6e00401bb69c1020.tar.xz puppet-b74151bf723df3fcadf24d2f6e00401bb69c1020.zip |
refactor completely iurt module ( maybe should even be moved out of buildsystem
module, since it tend to be too big )
-rw-r--r-- | modules/buildsystem/manifests/base.pp | 9 | ||||
-rw-r--r-- | modules/buildsystem/manifests/init.pp | 3 | ||||
-rw-r--r-- | modules/buildsystem/manifests/iurt/config.pp | 11 | ||||
-rw-r--r-- | modules/buildsystem/manifests/iurt/init.pp | 31 | ||||
-rw-r--r-- | modules/buildsystem/manifests/iurt/packages.pp | 3 | ||||
-rw-r--r-- | modules/buildsystem/manifests/iurt/user.pp | 13 | ||||
-rw-r--r-- | modules/buildsystem/manifests/iurtupload.pp | 3 | ||||
-rw-r--r-- | modules/buildsystem/manifests/iurtuser.pp | 12 | ||||
-rw-r--r-- | modules/buildsystem/manifests/mainnode.pp | 4 | ||||
-rw-r--r-- | modules/buildsystem/templates/iurt/sudoers.iurt | 2 | ||||
-rw-r--r-- | modules/buildsystem/templates/upload.conf | 4 |
11 files changed, 52 insertions, 43 deletions
diff --git a/modules/buildsystem/manifests/base.pp b/modules/buildsystem/manifests/base.pp index a028c31d..7f7a447b 100644 --- a/modules/buildsystem/manifests/base.pp +++ b/modules/buildsystem/manifests/base.pp @@ -1,17 +1,18 @@ class buildsystem::base { - $build_login = 'iurt' - $build_home_dir = "/home/$build_login" + $sched_login = 'schedbot' $sched_home_dir = "/var/lib/$sched_login" + $packages_archivedir = "$sched_home_dir/old" $repository_root = '/distrib/bootstrap' + $packagers_group = 'mga-packagers' $packagers_committers_group = 'mga-packagers-committers' include ssh::auth - ssh::auth::key { $build_login: + ssh::auth::key { $buildsystem::iurt::user::login: # declare a key for build bot: RSA, 2048 bits - home => $build_home_dir, + home => "$buildsystem::iurt::user::homedir" } ssh::auth::key { $sched_login: diff --git a/modules/buildsystem/manifests/init.pp b/modules/buildsystem/manifests/init.pp index fb6a8ff6..3c0b1909 100644 --- a/modules/buildsystem/manifests/init.pp +++ b/modules/buildsystem/manifests/init.pp @@ -93,6 +93,8 @@ class buildsystem { # A script to copy on valstar the 2010.1 rpms built on jonund class sync20101 inherits base { + $build_login = $buildsystem::iurt::user::login + # TODO user iurt::user::homedir too local_script { "sync2010.1": content => template("buildsystem/sync2010.1"), } @@ -100,6 +102,7 @@ class buildsystem { # a script to build 2010.1 packages. used on jonund class iurt20101 inherits base { + $build_login = $buildsystem::iurt::user::login local_script { "iurt2010.1": content => template("buildsystem/iurt2010.1"), } diff --git a/modules/buildsystem/manifests/iurt/config.pp b/modules/buildsystem/manifests/iurt/config.pp new file mode 100644 index 00000000..88c08b66 --- /dev/null +++ b/modules/buildsystem/manifests/iurt/config.pp @@ -0,0 +1,11 @@ +define buildsystem::iurt::config() { + $distribution = $name + # TODO rename the variable too in template + $build_login = $buildsystem::iurt::user::login + + file { "/etc/iurt/build/$distribution.conf": + owner => $build_login, + group => $build_login, + content => template("buildsystem/iurt/$distribution.conf") + } +} diff --git a/modules/buildsystem/manifests/iurt/init.pp b/modules/buildsystem/manifests/iurt/init.pp index e545f270..9f5780bd 100644 --- a/modules/buildsystem/manifests/iurt/init.pp +++ b/modules/buildsystem/manifests/iurt/init.pp @@ -1,42 +1,29 @@ class buildsystem::iurt { include sudo - include buildsystem::iurtuser - $build_login = $buildsystem::base::build_login - $build_home_dir = $buildsystem::base::build_home_dir + include buildsystem::iurt::user + include buildsystem::iurt::package + $login = $buildsystem::iurt::user::login + $homedir = $buildsystem::iurt::user::homedir + + ssh::auth::client { $login: } - ssh::auth::client { $build_login: } ssh::auth::server { $buildsystem::base::sched_login: - user => $build_login + user => $login } # remove old build directory - tidy { "$build_home_dir/iurt": + tidy { "$homedir/iurt": age => '8w', recurse => true, matches => ['[0-9][0-9].*\..*\..*\.[0-9]*','log','*.rpm','*.log','*.mga[0-9]+'], rmdirs => true, } -# build node common settings -# we could have the following skip list to use less space: -# '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/' - package { 'iurt': } - file { '/etc/iurt/build': ensure => directory, } - define iurt_config() { - - $distribution = $name - file { "/etc/iurt/build/$distribution.conf": - owner => $buildsystem::iurt::build_login, - group => $buildsystem::iurt::build_login, - content => template("buildsystem/iurt/$distribution.conf") - } - } - - iurt_config { ['1','cauldron','mandriva2010.1','infra_1']: } + buildsystem::iurt::config { ['1','cauldron','mandriva2010.1','infra_1']: } sudo::sudoers_config { 'iurt': content => template('buildsystem/iurt/sudoers.iurt') diff --git a/modules/buildsystem/manifests/iurt/packages.pp b/modules/buildsystem/manifests/iurt/packages.pp new file mode 100644 index 00000000..448b4a89 --- /dev/null +++ b/modules/buildsystem/manifests/iurt/packages.pp @@ -0,0 +1,3 @@ +class buildsystem::iurt::packages { + package { 'iurt': } +} diff --git a/modules/buildsystem/manifests/iurt/user.pp b/modules/buildsystem/manifests/iurt/user.pp new file mode 100644 index 00000000..a70c25c1 --- /dev/null +++ b/modules/buildsystem/manifests/iurt/user.pp @@ -0,0 +1,13 @@ +class buildsystem::iurt::user { + $login = 'iurt' + $homedir = "/home/$login" + + sshuser { $login: + homedir => $homedir, + comment => 'System user used to run build bots', + } + + file { '/etc/iurt': + ensure => directory, + } +} diff --git a/modules/buildsystem/manifests/iurtupload.pp b/modules/buildsystem/manifests/iurtupload.pp index e4d7269d..af71ad2f 100644 --- a/modules/buildsystem/manifests/iurtupload.pp +++ b/modules/buildsystem/manifests/iurtupload.pp @@ -1,4 +1,7 @@ class buildsystem::iurtupload { + $login = $buildsystem::iurt::user::login + $homedir = $buildsystem::iurt::user::homedir + file { '/etc/iurt/upload.conf': require => File['/etc/iurt'], content => template('buildsystem/upload.conf') diff --git a/modules/buildsystem/manifests/iurtuser.pp b/modules/buildsystem/manifests/iurtuser.pp deleted file mode 100644 index 8afce2ef..00000000 --- a/modules/buildsystem/manifests/iurtuser.pp +++ /dev/null @@ -1,12 +0,0 @@ -class buildsystem::iurtuser { - sshuser { $buildsystem::base::build_login: - homedir => $buildsystem::base::build_home_dir, - comment => 'System user used to run build bots', - } - - file { '/etc/iurt': - ensure => directory, - } -} - - diff --git a/modules/buildsystem/manifests/mainnode.pp b/modules/buildsystem/manifests/mainnode.pp index e895c3cf..800b2a48 100644 --- a/modules/buildsystem/manifests/mainnode.pp +++ b/modules/buildsystem/manifests/mainnode.pp @@ -1,9 +1,9 @@ class buildsystem::mainnode { include buildsystem::base - include buildsystem::iurtuser + include buildsystem::iurt::user $sched_login = $buildsystem::base::sched_login $sched_home_dir = $buildsystem::base::sched_home_dir - $build_login = $buildsystem::base::build_login + $build_login = $buildsystem::iurt::user::login $repository_root = $buildsystem::base::repository_root sshuser { $sched_login: diff --git a/modules/buildsystem/templates/iurt/sudoers.iurt b/modules/buildsystem/templates/iurt/sudoers.iurt index 266f301c..408aa92c 100644 --- a/modules/buildsystem/templates/iurt/sudoers.iurt +++ b/modules/buildsystem/templates/iurt/sudoers.iurt @@ -1 +1 @@ -<%= build_login %> ALL = NOPASSWD: /usr/sbin/iurt_root_command +<%= login %> ALL = NOPASSWD: /usr/sbin/iurt_root_command diff --git a/modules/buildsystem/templates/upload.conf b/modules/buildsystem/templates/upload.conf index f4555259..99443831 100644 --- a/modules/buildsystem/templates/upload.conf +++ b/modules/buildsystem/templates/upload.conf @@ -12,7 +12,7 @@ my %nodes = ( x86_64 => [ qw(jonund0 ecosse0 jonund1 ecosse1) ], ); my $repository = "http://repository.<%= domain %>/distrib/"; -my $homedir = "<%= build_home_dir %>"; +my $homedir = "<%= homedir %>"; { bot => { @@ -23,7 +23,7 @@ my $homedir = "<%= build_home_dir %>"; my $node = $_; ($node => { iurt => { - user => '<%= build_login %>', + user => '<%= login %>', # (spuk, 2007-08-16) disabled iurt_cache additional media, locks trying to mount -o bind # command => "iurt --copy-srpm --group -v 6 --config local_spool $homedir/iurt/__DIR__ --no_rsync --chrooted-urpmi -m __MEDIA__ -- $repository --additional-media -m __MEDIA__ -- file://$homedir/cache/ -p \"__PACKAGER__\" -r __TARGET__ __ARCH__", command => "iurt --copy_srpm --group --rpmmacros \"%distro_section __SECTION__\" --config local_spool $homedir/iurt/__DIR__ --no_rsync --chrooted-urpmi -m __MEDIA__ -- $repository -p \"__PACKAGER__\" -r __TARGET__ __ARCH__", |