From 2f8127555100814ec1ad04af8067de5bc8bfd843 Mon Sep 17 00:00:00 2001 From: Digimer Date: Fri, 20 Dec 2019 00:54:07 -0500 Subject: [PATCH] * Updated the kickstart template/script to now add the local striker to the installed system's dnf repo list. * Fixed a bug in the tftp templates where the os_type was statically set to 'rhel8'. Signed-off-by: Digimer --- html/skins/alteeve/pxe.txt | 25 ++++++++++++++----------- notes | 23 +++++++++++++++++++++++ share/words.xml | 1 + tools/striker-manage-install-target | 29 +++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+), 11 deletions(-) diff --git a/html/skins/alteeve/pxe.txt b/html/skins/alteeve/pxe.txt index 4a793272..5f758aca 100644 --- a/html/skins/alteeve/pxe.txt +++ b/html/skins/alteeve/pxe.txt @@ -226,6 +226,9 @@ cat << EOF > /mnt/sysimage/etc/NetworkManager/dispatcher.d/ifup-local EOF chmod +x /mnt/sysimage/etc/NetworkManager/dispatcher.d/ifup-local +cat << EOF > /mnt/sysimage/#!variable!repo_file!# +#!variable!repo_body!# +EOF %end @@ -802,41 +805,41 @@ menu label #!string!message_0084!# TEXT HELP #!string!message_0085!# ENDTEXT -kernel rhel8/vmlinuz +kernel #!data!host_os::os_type!#/vmlinuz # NOTE: add ' rd.debug' below for debugging -append initrd=rhel8/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/striker.ks inst.gpt inst.sshd +append initrd=#!data!host_os::os_type!#/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/striker.ks inst.gpt inst.sshd label node menu label #!string!message_0086!# TEXT HELP #!string!message_0087!# ENDTEXT -kernel rhel8/vmlinuz -append initrd=rhel8/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/node.ks inst.gpt inst.sshd +kernel #!data!host_os::os_type!#/vmlinuz +append initrd=#!data!host_os::os_type!#/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/node.ks inst.gpt inst.sshd label node menu label #!string!message_0088!# TEXT HELP #!string!message_0089!# ENDTEXT -kernel rhel8/vmlinuz -append initrd=rhel8/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/dr.ks inst.gpt inst.sshd +kernel #!data!host_os::os_type!#/vmlinuz +append initrd=#!data!host_os::os_type!#/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/dr.ks inst.gpt inst.sshd label rescue menu label #!string!message_0090!# TEXT HELP #!string!message_0091!# ENDTEXT -kernel rhel8/vmlinuz -append initrd=rhel8/initrd.img ip=dhcp root=live:#!variable!base_url!#/LiveOS/squashfs.img rescue inst.repo=#!variable!base_url!#/os/ ip=dhcp inst.sshd +kernel #!data!host_os::os_type!#/vmlinuz +append initrd=#!data!host_os::os_type!#/initrd.img ip=dhcp root=live:#!variable!base_url!#/LiveOS/squashfs.img rescue inst.repo=#!variable!base_url!#/os/ ip=dhcp inst.sshd -label rhel8 +label #!data!host_os::os_type!# menu label #!string!message_0092!# TEXT HELP #!string!message_0093!# ENDTEXT -kernel rhel8/vmlinuz -append initrd=rhel8/initrd.img root=live:#!variable!base_url!#/images/install.img inst.repo=#!variable!base_url!#/os/ ip=dhcp inst.gpt inst.sshd +kernel #!data!host_os::os_type!#/vmlinuz +append initrd=#!data!host_os::os_type!#/initrd.img root=live:#!variable!base_url!#/images/install.img inst.repo=#!variable!base_url!#/os/ ip=dhcp inst.gpt inst.sshd label next menu default diff --git a/notes b/notes index 522f9776..98987e68 100644 --- a/notes +++ b/notes @@ -42,6 +42,29 @@ DOCS; - ==== +dnf download --source awscli booth booth-arbitrator booth-core booth-site booth-test corosync corosync-qdevice corosync-qnetd corosynclib-devel fence-agents-aliyun fence-agents-aws fence-agents-azure-arm fence-agents-gce libknet1 \ + libknet1-compress-bzip2-plugin libknet1-compress-lz4-plugin libknet1-compress-lzma-plugin libknet1-compress-lzo2-plugin libknet1-compress-plugins-all libknet1-compress-zlib-plugin libknet1-crypto-nss-plugin \ + libknet1-crypto-openssl-plugin libknet1-crypto-plugins-all libknet1-plugins-all pacemaker pacemaker-cli pacemaker-cts pacemaker-doc pacemaker-libs-devel pacemaker-nagios-plugins-metadata pacemaker-remote \ + pcs pcs-snmp python3-azure-sdk python3-boto3 python3-botocore python3-fasteners python3-gflags python3-google-api-client python3-httplib2 python3-oauth2client python3-s3transfer python3-uritemplate \ + resource-agents resource-agents-aliyun resource-agents-gcp + +rpm -Uvh python-s3transfer-0.1.13-1.el8.src.rpm python-oauth2client-4.1.2-6.el8.src.rpm booth-1.0-5.f2d38ce.git.el8.src.rpm google-api-python-client-1.6.5-3.el8.src.rpm python-boto3-1.6.1-2.el8.src.rpm python-httplib2-0.10.3-4.el8.src.rpm python-botocore-1.9.1-2.el8.src.rpm corosync-qdevice-3.0.0-2.el8.src.rpm python-uritemplate-3.0.0-3.el8.src.rpm python3-azure-sdk-4.0.0-9.el8.src.rpm awscli-1.14.50-5.el8.src.rpm python-gflags-2.0-15.el8ost.src.rpm resource-agents-4.1.1-33.el8.src.rpm python-fasteners-0.14.1-15.el8ost.src.rpm pcs-0.10.2-4.el8.src.rpm fence-agents-4.2.1-30.el8_1.1.src.rpm + +rpmbuild -ba python-s3transfer.spec python-oauth2client.spec booth.spec google-api-python-client.spec python-boto3.spec python-httplib2.spec python-botocore.spec corosync-qdevice.spec python-uritemplate.spec python3-azure-sdk.spec \ + awscli.spec python-gflags.spec resource-agents.spec python-fasteners.spec pcs.spec fence-agents.spec + + +The key packages which are needed are: + corosync + corosynclib-devel + pacemaker + pacemaker-cli + pacemaker-doc + pacemaker-libs-devel + pcs + resource-agents + + Network planning; 10.x.y.z / 255.255.0.0 diff --git a/share/words.xml b/share/words.xml index 7d04b17c..cc36163c 100644 --- a/share/words.xml +++ b/share/words.xml @@ -257,6 +257,7 @@ About to try to download aproximately: [#!variable!packages!#] packages needed t Set the new host name. This is a RHEL host and has not yet been subscribed, but there is no internet access detected. OS Updates likely won't work, nor will subscribing the system. These tasks will be deferred until later in the setup process. There is no internet access detected. OS Updates likely won't work and will be deferred until later in the setup process. + Local repository Starting: [#!variable!program!#]. diff --git a/tools/striker-manage-install-target b/tools/striker-manage-install-target index 34243386..383a3a48 100755 --- a/tools/striker-manage-install-target +++ b/tools/striker-manage-install-target @@ -564,12 +564,39 @@ sub setup_boot_environment print $anvil->Words->string({key => "message_0096", variables => { file => $anvil->data->{path}{configs}{pxe_default} }})."\n"; } + ### TODO: Add repos for all known strikers + # Build the repository file body. + my $repo_file = "/etc/yum.repos.d/".$anvil->_short_host_name.".repo"; + my $repo_body = "[".$anvil->_short_host_name."-repo]\n"; + $repo_body .= "name=".$anvil->_host_name." #!string!message_0153!#\n"; + # Add the IPs. + $anvil->Network->get_ips({}); + my $first_line = 1; + foreach my $in_iface (sort {$a cmp $b} keys %{$anvil->data->{network}{'local'}{interface}}) + { + my $ip = $anvil->data->{network}{'local'}{interface}{$in_iface}{ip}; + if ($ip) + { + my $prefix = $first_line ? "baseurl=" : " "; + $first_line = 0; + $repo_body .= $prefix."http://".$ip."/".$anvil->data->{host_os}{os_type}."/".$anvil->data->{host_os}{os_arch}."/os/\n"; + } + } + $repo_body .= "enabled=1\n"; + $repo_body .= "gpgcheck=0\n"; + $repo_body .= "skip_if_unavailable=1\n"; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { + repo_file => $repo_file, + repo_body => $repo_body, + }}); + ### Generate kickstart files. my $progress = 10; foreach my $type ("striker", "node", "dr") { $progress += 2; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { type => $type, progress => $progress }}); + my $say_type = "#!string!message_0115!#"; if ($type eq "node") { @@ -588,6 +615,8 @@ sub setup_boot_environment keyboard => $anvil->data->{kickstart}{keyboard} ? $anvil->data->{kickstart}{keyboard} : $anvil->data->{defaults}{kickstart}{keyboard}, timezone => $anvil->data->{kickstart}{timezone} ? $anvil->data->{kickstart}{timezone} : $anvil->data->{defaults}{kickstart}{timezone}, password => $anvil->data->{kickstart}{password} ? $anvil->data->{kickstart}{password} : $anvil->data->{defaults}{kickstart}{password}, + repo_file => $repo_file, + repo_body => $repo_body, debug => 0, # This isn't the same as the rest of our code, just '1' or '0'. }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { kickstart_body => $kickstart_body }});