web/modules/rhn/RHN/SatInstall.pm | 69 ++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
New commits:
commit 7714864d4a100931c0071695f659e2b2608aa6ae
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Apr 1 13:43:10 2009 +0200
Revert "484702 - remove dead function generate_server_pem from
RHN::SatInstall."
This reverts commit 128f4ee11c4bbd18690b4974f51e97db07849c32.
Conflicts:
web/modules/rhn/RHN/SatInstall.pm
generate_server_pem() is still needed by rhn-enable-push.pl
(rhn-upgrade package).
This cannot be replaced by Spacewalk::Setup::generate_server_pem(),
because we need to be able to install rhn-upgrade on all Satellite
versions, even those that do not have Spacewalk::Setup module.
diff --git a/web/modules/rhn/RHN/SatInstall.pm b/web/modules/rhn/RHN/SatInstall.pm
index 4a9d72c..c4be158 100644
--- a/web/modules/rhn/RHN/SatInstall.pm
+++ b/web/modules/rhn/RHN/SatInstall.pm
@@ -475,6 +475,37 @@ sub get_db_population_errors {
return @errors;
}
+sub generate_server_pem {
+ my $class = shift;
+ my %params = validate(@_, { ssl_dir => 1,
+ system => 1,
+ out_file => 0 });
+
+ my @opts;
+
+ push @opts, '--ssl-dir=' . File::Spec->catfile($params{ssl_dir},
$params{system});
+
+ if ($params{out_file}) {
+ push @opts, '--out-file=' . $params{out_file};
+ }
+ my $opts = join(' ', @opts);
+
+ my $content;
+
+ open(FH, "/usr/bin/sudo /usr/bin/rhn-generate-pem.pl $opts |")
+ or throw "(satinstall:generate_pem_error) Could not generate server.pem file:
$OS_ERROR";
+
+ my @content = <FH>;
+
+ close(FH);
+
+ if (not $params{out_file}) {
+ $content = join('', @content);
+ }
+
+ return $content;
+}
+
sub is_rpm_installed {
my $class = shift;
my $rpmname = shift;
commit 966b9e7a545130fde46fb324a9fb1fa460551ec0
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Apr 1 13:23:29 2009 +0200
Revert "484703 - remove dead function generate_satcon_dict from
RHN::SatInstall."
This reverts commit 1de6c23dc8c136aa5576252a27ab9a27ee4730bd.
generate_satcon_dict() is still needed by rhn-load-config.pl
(rhn-upgrade package).
This cannot be replaced by Spacewalk::Setup::generate_satcon_dict(),
since we need to be able to install rhn-upgrade package on all satellite
versions, even those that do not have Spacewalk::Setup module.
diff --git a/web/modules/rhn/RHN/SatInstall.pm b/web/modules/rhn/RHN/SatInstall.pm
index 51642ed..4a9d72c 100644
--- a/web/modules/rhn/RHN/SatInstall.pm
+++ b/web/modules/rhn/RHN/SatInstall.pm
@@ -66,6 +66,24 @@ use constant DB_POP_LOG_SIZE => 154000;
# Some utility functions to do the configuration steps needed for the
# satellite install.
+sub generate_satcon_dict {
+ my $class = shift;
+ my %params = validate(@_, { conf_file => { default => DEFAULT_SATCON_DICT },
+ tree => { default => DEFAULT_RHN_SATCON_TREE },
+ });
+
+ my $ret = system("/usr/bin/sudo",
"/usr/bin/satcon-build-dictionary.pl",
+ "--tree=" . $params{tree},
+ "--target=" . $params{conf_file});
+
+ if ($ret) {
+ throw 'There was a problem building the satcon dictionary. '
+ . 'See the webserver error log for details.';
+ }
+
+ return;
+}
+
sub satcon_deploy {
my $class = shift;
my %params = validate(@_, { conf_file => { default => DEFAULT_SATCON_DICT },
commit e1c35fe888d405217ce8ee4096c9b449ee3573e9
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Apr 1 13:21:16 2009 +0200
Revert "484705 - remove dead function satcon_deploy from RHN::SatInstall."
This reverts commit 2d680d9b12843b624c6fedfc70a366023a8911bd.
satcon_deploy() is still needed by rhn-enable-monitoring.pl,
rhn-enable-push.pl and rhn-load-config.pl (rhn-upgrade package).
This cannot be replaced by Spacewalk::Setup::satcon_deploy(), because we
need to be able to install rhn-upgrade on all Satellite versions, even
those that do not have Spacewalk::Setup module.
diff --git a/web/modules/rhn/RHN/SatInstall.pm b/web/modules/rhn/RHN/SatInstall.pm
index d2885fe..51642ed 100644
--- a/web/modules/rhn/RHN/SatInstall.pm
+++ b/web/modules/rhn/RHN/SatInstall.pm
@@ -66,6 +66,26 @@ use constant DB_POP_LOG_SIZE => 154000;
# Some utility functions to do the configuration steps needed for the
# satellite install.
+sub satcon_deploy {
+ my $class = shift;
+ my %params = validate(@_, { conf_file => { default => DEFAULT_SATCON_DICT },
+ tree => { default => DEFAULT_RHN_SATCON_TREE },
+ dest => { default => '/etc' },
+ });
+
+ my @opts = ("--source=" . $params{tree}, "--dest=" .
$params{dest},
+ "--conf=" . $params{conf_file});
+
+ my $ret = system("/usr/bin/sudo", "/usr/bin/satcon-deploy-tree.pl",
@opts);
+
+ if ($ret) {
+ throw 'There was a problem deploying the satellite configuration. '
+ . 'See the webserver error log for details.';
+ }
+
+ return;
+}
+
sub write_config {
my $class = shift;
my $options = shift;
Show replies by date