* Fixed PXE templates managing install targets to work with CentOS.

Signed-off-by: Madison Kelly <digimer@neutron.digimer.ca>
main
Madison Kelly 5 years ago
parent 4787819ac9
commit 27f921289f
  1. 2
      Anvil/Tools/System.pm
  2. 12
      share/words.xml
  3. 57
      tools/striker-manage-install-target
  4. 4
      tools/striker-prep-database

@ -1603,7 +1603,7 @@ sub get_uptime
This returns the operating system type and the system architecture as two separate string variables. This returns the operating system type and the system architecture as two separate string variables.
# Run on RHEL 7, on a 64-bit system # Run on RHEL 8, on a 64-bit system
my ($os_type, $os_arch) = $anvil->System->get_os_type(); my ($os_type, $os_arch) = $anvil->System->get_os_type();
# '$os_type' holds 'rhel8' ('rhel' or 'centos' + release version) # '$os_type' holds 'rhel8' ('rhel' or 'centos' + release version)

@ -131,7 +131,7 @@ NOTE: Please be patient!
<key name="message_0081">Will boot the next device as configured in your BIOS in # second{,s}.</key> <key name="message_0081">Will boot the next device as configured in your BIOS in # second{,s}.</key>
<key name="message_0082"><![CDATA[Press the <tab> key to edit the boot parameters of the highlighted option.]]></key> <key name="message_0082"><![CDATA[Press the <tab> key to edit the boot parameters of the highlighted option.]]></key>
<key name="message_0083">Editing of this option is disabled.</key> <key name="message_0083">Editing of this option is disabled.</key>
<key name="message_0084">^1. Install a Striker dashboard (RHEL 8b 64-bit)</key> <key name="message_0084">^1. Install a Striker dashboard (#!data!sys::pxe::os_name!# #!data!sys::pxe::os_arch!#)</key>
<!-- Keep help text wrapped within the area shown directly below for the 'help' section of PXE 'default' meny entry. --> <!-- Keep help text wrapped within the area shown directly below for the 'help' section of PXE 'default' meny entry. -->
<!-- /===========================================================================================================\ --> <!-- /===========================================================================================================\ -->
<key name="message_0085"> <key name="message_0085">
@ -143,7 +143,7 @@ NOTE: Please be patient!
*** THERE WILL BE NO FURTHER PROMPT! PROCEED CAREFULLY! *** *** THERE WILL BE NO FURTHER PROMPT! PROCEED CAREFULLY! ***
</key> </key>
<!-- \===========================================================================================================/ --> <!-- \===========================================================================================================/ -->
<key name="message_0086">^2. Install an Anvil! Node (RHEL 8b 64-bit)</key> <key name="message_0086">^2. Install an Anvil! Node (#!data!sys::pxe::os_name!# #!data!sys::pxe::os_arch!#)</key>
<!-- Keep help text wrapped within the area shown directly below for the 'help' section of PXE 'default' meny entry. --> <!-- Keep help text wrapped within the area shown directly below for the 'help' section of PXE 'default' meny entry. -->
<!-- /===========================================================================================================\ --> <!-- /===========================================================================================================\ -->
<key name="message_0087"> <key name="message_0087">
@ -156,7 +156,7 @@ NOTE: Please be patient!
*** THERE WILL BE NO FURTHER PROMPT! PROCEED CAREFULLY! *** *** THERE WILL BE NO FURTHER PROMPT! PROCEED CAREFULLY! ***
</key> </key>
<!-- \===========================================================================================================/ --> <!-- \===========================================================================================================/ -->
<key name="message_0088">^3. Install an Anvil! Disaster Recover Host (RHEL 8b 64-bit)</key> <key name="message_0088">^3. Install an Anvil! Disaster Recover Host (#!data!sys::pxe::os_name!# #!data!sys::pxe::os_arch!#)</key>
<key name="message_0089"> <key name="message_0089">
<!-- Keep help text wrapped within the area shown directly below for the 'help' section of PXE 'default' meny entry. --> <!-- Keep help text wrapped within the area shown directly below for the 'help' section of PXE 'default' meny entry. -->
<!-- /===========================================================================================================\ --> <!-- /===========================================================================================================\ -->
@ -179,11 +179,11 @@ NOTE: Please be patient!
No data on the target machine will be changed by this option. No data on the target machine will be changed by this option.
</key> </key>
<!-- \===========================================================================================================/ --> <!-- \===========================================================================================================/ -->
<key name="message_0092">Install ^Standard RHEL 8b 64-bit Install</key> <key name="message_0092">Install ^Standard #!data!sys::pxe::os_name!# #!data!sys::pxe::os_arch!# Install</key>
<!-- Keep help text wrapped within the area shown directly below for the 'help' section of PXE 'default' meny entry. --> <!-- Keep help text wrapped within the area shown directly below for the 'help' section of PXE 'default' meny entry. -->
<!-- /===========================================================================================================\ --> <!-- /===========================================================================================================\ -->
<key name="message_0093"> <key name="message_0093">
This will start a standard install of RHEL 8b. This will start a standard install of #!data!sys::pxe::os_name!#.
This option will not change anything on disk until and unless you choose to do so. This option will not change anything on disk until and unless you choose to do so.
</key> </key>
@ -813,6 +813,7 @@ Failed to promote the DRBD resource: [#!variable!resource!#] primary. Expected a
<key name="log_0472">The unified fences metadata file: [#!data!path::data::fences_unified_metadata!#] doesn't exist yet. It will be created now.</key> <key name="log_0472">The unified fences metadata file: [#!data!path::data::fences_unified_metadata!#] doesn't exist yet. It will be created now.</key>
<key name="log_0473">The unified fences metadata file: [#!data!path::data::fences_unified_metadata!#] will be refreshed on user request (--refresh passed).</key> <key name="log_0473">The unified fences metadata file: [#!data!path::data::fences_unified_metadata!#] will be refreshed on user request (--refresh passed).</key>
<key name="log_0474">The unified fences metadata file: [#!data!path::data::fences_unified_metadata!#] old and will now be refreshed.</key> <key name="log_0474">The unified fences metadata file: [#!data!path::data::fences_unified_metadata!#] old and will now be refreshed.</key>
<key name="log_0475">This is a CentOS machine, moving the directory: [#!data!path::directories::html!#/rhel8] to: [#!data!path::directories::html!#/centos8].</key>
<!-- Test words. Do NOT change unless you update 't/Words.t' or tests will needlessly fail. --> <!-- Test words. Do NOT change unless you update 't/Words.t' or tests will needlessly fail. -->
<key name="t_0000">Test</key> <key name="t_0000">Test</key>
@ -1409,6 +1410,7 @@ The error was:
<key name="error_0113">The unified metadata file: [#!data!path::data::fences_unified_metadata!#] was not found. There may have been a problem creating it.</key> <key name="error_0113">The unified metadata file: [#!data!path::data::fences_unified_metadata!#] was not found. There may have been a problem creating it.</key>
<key name="error_0114">This row's modified_date wasn't the first column returned in query: [#!variable!query!#]</key> <key name="error_0114">This row's modified_date wasn't the first column returned in query: [#!variable!query!#]</key>
<key name="error_0115">This row's UUID column: [#!variable!uuid_column!#] wasn't the second column returned in query: [#!variable!query!#]</key> <key name="error_0115">This row's UUID column: [#!variable!uuid_column!#] wasn't the second column returned in query: [#!variable!query!#]</key>
<key name="error_0116">This is a CentOS machine, and tried to move the directory: [#!data!path::directories::html!#/rhel8] to: [#!data!path::directories::html!#/centos8], but that renane failed.</key>
<!-- These are units, words and so on used when displaying information. --> <!-- These are units, words and so on used when displaying information. -->
<key name="unit_0001">Yes</key> <key name="unit_0001">Yes</key>

@ -25,6 +25,7 @@
# 9 = The system isn't configured yet. # 9 = The system isn't configured yet.
# 10 = Failed to start dhcpd. # 10 = Failed to start dhcpd.
# 11 = Failed to stop dhcpd. # 11 = Failed to stop dhcpd.
# 12 = Failed to rename the /var/www/html/rhel8 to ./centos8
# #
# Switchs # Switchs
# #
@ -535,6 +536,18 @@ sub setup_boot_environment
update_progress($anvil, 10, "message_0096,!!file!".$anvil->data->{path}{configs}{'dhcpd.conf'}."!!"); update_progress($anvil, 10, "message_0096,!!file!".$anvil->data->{path}{configs}{'dhcpd.conf'}."!!");
} }
### NOTE: Some of the strings in the 'tftp_bios' template expect 'sys::pxe::os_name'
my ($os_type, $os_arch) = $anvil->System->get_os_type();
$anvil->data->{sys}{pxe}{os_name} = "";
$anvil->data->{sys}{pxe}{os_arch} = $os_arch;
if ($os_type eq "rhel8")
{
$anvil->data->{sys}{pxe}{os_name} = "RHEL 8";
}
elsif ($os_type eq "centos8")
{
$anvil->data->{sys}{pxe}{os_name} = "CentOS 8";
}
### PXE BIOS 'default' file. ### PXE BIOS 'default' file.
my $bios_default_body = $anvil->Template->get({file => "pxe.txt", show_name => 0, name => "tftp_bios", variables => { base_url => $base_url }}); my $bios_default_body = $anvil->Template->get({file => "pxe.txt", show_name => 0, name => "tftp_bios", variables => { base_url => $base_url }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { bios_default_body => $bios_default_body }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { bios_default_body => $bios_default_body }});
@ -2224,11 +2237,6 @@ sub load_packages
"radvd.x86_64", "radvd.x86_64",
"rdma-core.x86_64", "rdma-core.x86_64",
"readline.x86_64", "readline.x86_64",
"redhat-backgrounds.noarch",
"redhat-indexhtml.noarch",
"redhat-logos-httpd.noarch",
"redhat-logos.x86_64",
"redhat-release.x86_64",
"resource-agents.x86_64", "resource-agents.x86_64",
"rest.x86_64", "rest.x86_64",
"rootfiles.noarch", "rootfiles.noarch",
@ -2376,6 +2384,45 @@ sub load_packages
"zlib.x86_64", "zlib.x86_64",
], ],
}; };
my ($os_type, $os_arch) = $anvil->System->get_os_type();
if ($os_type eq "rhel8")
{
push @{$anvil->data->{packages}{r}}, "redhat-backgrounds.noarch";
push @{$anvil->data->{packages}{r}}, "redhat-indexhtml.noarch";
push @{$anvil->data->{packages}{r}}, "redhat-logos-httpd.noarch";
push @{$anvil->data->{packages}{r}}, "redhat-logos.x86_64";
push @{$anvil->data->{packages}{r}}, "redhat-release.x86_64";
}
elsif ($os_type eq "centos8")
{
push @{$anvil->data->{packages}{c}}, "centos-backgrounds.noarch";
push @{$anvil->data->{packages}{c}}, "centos-indexhtml.noarch";
push @{$anvil->data->{packages}{c}}, "centos-logos-httpd.noarch";
push @{$anvil->data->{packages}{c}}, "centos-logos.x86_64";
push @{$anvil->data->{packages}{c}}, "centos-release.x86_64";
# While we're here, we will need to rename /var/www/html/rhel8 to /var/www/html/centos8, as
# 'rhel8' is used by anvil-striker-extra.
if ((-e $anvil->data->{path}{directories}{html}."/rhel8") && (not -e $anvil->data->{path}{directories}{html}."/centos8"))
{
my $shell_call = $anvil->data->{path}{exe}{mv}." ".$anvil->data->{path}{directories}{html}."/rhel8 ".$anvil->data->{path}{directories}{html}."/centos8";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { shell_call => $shell_call }});
my ($handle, $return_code) = $anvil->System->call({debug => 2, shell_call => $shell_call});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { handle => $handle, return_code => $return_code }});
if (-e $anvil->data->{path}{directories}{html}."/centos8")
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0475"});
}
else
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "error_0116"});
$anvil->nice_exit({code => 12});
}
}
}
update_progress($anvil, 5, "log_0241"); update_progress($anvil, 5, "log_0241");
return(0); return(0);

@ -215,7 +215,7 @@ if ($local_uuid)
if ((not -e $anvil->data->{path}{secure}{postgres_pgpass}) && ($anvil->data->{database}{$local_uuid}{password})) if ((not -e $anvil->data->{path}{secure}{postgres_pgpass}) && ($anvil->data->{database}{$local_uuid}{password}))
{ {
my $body = "*:*:*:postgres:".$anvil->data->{database}{$local_uuid}{password}."\n"; my $body = "*:*:*:postgres:".$anvil->data->{database}{$local_uuid}{password}."\n";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, secure => 1, list => { body => $body }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, secure => 1, list => { body => $body }});
$anvil->Storage->write_file({ $anvil->Storage->write_file({
file => $anvil->data->{path}{secure}{postgres_pgpass}, file => $anvil->data->{path}{secure}{postgres_pgpass},
body => $body, body => $body,
@ -228,7 +228,7 @@ if ($local_uuid)
if (-e $anvil->data->{path}{secure}{postgres_pgpass}) if (-e $anvil->data->{path}{secure}{postgres_pgpass})
{ {
$created_pgpass = 1; $created_pgpass = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { created_pgpass => $created_pgpass }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { created_pgpass => $created_pgpass }});
} }
} }

Loading…
Cancel
Save