summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsongyanchao <[email protected]>2023-05-29 22:02:18 -0400
committerไป˜ๆ˜Žๅซ <[email protected]>2023-05-30 11:28:14 +0000
commit7a3d96920c33be382a3ac2ec7ff117cf4bd88882 (patch)
tree84a7bfe00d31a854bb37353bd7aea287f4ec89ca
parenta0e998458cf2ce6af9bc9b528b2a7aa26b2b78ed (diff)
๐ŸŽˆ perf: Replace the ofed installation methodv22.11.9
Replace the ofed installation method
-rwxr-xr-xansible/roles/OFED/files/uname4
-rw-r--r--ansible/roles/OFED/tasks/main.yml82
-rw-r--r--conf/yum-CentOS-7.conf8
-rw-r--r--conf/yum-RockyLinux-8.conf8
-rwxr-xr-xtools/mk-base-image2
5 files changed, 61 insertions, 43 deletions
diff --git a/ansible/roles/OFED/files/uname b/ansible/roles/OFED/files/uname
index 5502e6a0..8a89026d 100755
--- a/ansible/roles/OFED/files/uname
+++ b/ansible/roles/OFED/files/uname
@@ -2,8 +2,8 @@
if [ "$1" == "-r" ]
then
- echo 5.17.15-1.el8.x86_64
+ echo KERNEL_VERSION.x86_64
else
- /usr/bin/uname-bak $1
+ /usr/bin/uname-backup $1
fi
exit 0
diff --git a/ansible/roles/OFED/tasks/main.yml b/ansible/roles/OFED/tasks/main.yml
index 6738cde3..3fe0481e 100644
--- a/ansible/roles/OFED/tasks/main.yml
+++ b/ansible/roles/OFED/tasks/main.yml
@@ -1,12 +1,12 @@
---
-- name: "copy OFED installer package to to destination server"
+- name: "copy MFT installer package to to destination server"
copy:
src: "{{ role_path }}/files/"
- dest: "/tmp/OFED/"
+ dest: "/tmp/mft/"
- name: "create unarchive directory"
file:
- path: "/tmp/OFED/unarchived"
+ path: "/tmp/mft/unarchived"
state: directory
- name: "Backup and Replace the uname tools"
@@ -16,53 +16,55 @@
mode: "{{ item.mode }}"
remote_src: yes
with_items:
- - { src: "/usr/bin/uname" , dest: "/usr/bin/uname-bak" , mode: "0755" }
- - { src: "/tmp/OFED/uname" , dest: "/usr/bin/uname" , mode: "0755" }
+ - { src: "/usr/bin/uname" , dest: "/usr/bin/uname-backup" , mode: "0755" }
+ - { src: "/tmp/mft/uname" , dest: "/usr/bin/uname" , mode: "0755" }
-######TSG-X-P0804 install start######
-- name: "unarchive OFED installer"
- unarchive:
- src: /tmp/OFED/MLNX_OFED_SRC-5.8-1.0.1.1.tgz
- dest: /tmp/OFED/unarchived/
- remote_src: yes
+- name: "change kernel version for uname"
+ shell: sed -i -e 's/KERNEL_VERSION/5.17.15-1.el8/' /usr/bin/uname
when: runtime_env == 'TSG-X-P0804' or runtime_env == 'TSG-X-P0906'
-- name: "Get linux kernel file path"
- shell: uname -r
- register: obtain_kernel_version
- when: runtime_env == 'TSG-X-P0804' or runtime_env == 'TSG-X-P0906'
+- name: "change kernel version for uname"
+ shell: sed -i -e 's/KERNEL_VERSION/3.10.0-1160.59.1.el7/' /usr/bin/uname
+ when: runtime_env == 'TSG-X-P1403'
-- name: "execute OFED installer"
- shell: /tmp/OFED/unarchived/MLNX_OFED_SRC-5.8-1.0.1.1/install.pl -k {{obtain_kernel_version.stdout}} --all --force
- environment:
- MAKEFLAGS :
- when: runtime_env == 'TSG-X-P0804' or runtime_env == 'TSG-X-P0906'
+- name: "create kernel directory"
+ file:
+ path: "/lib/modules/3.10.0-1160.59.1.el7.x86_64"
+ state: directory
+ when: runtime_env == 'TSG-X-P1403'
-- name: "unarchive MFT RPM"
- unarchive:
- src: /tmp/OFED/mft-4.20.0-34-x86_64-rpm.tgz
- dest: /tmp/OFED/unarchived/
- remote_src: yes
- when: runtime_env == 'TSG-X-P0804' or runtime_env == 'TSG-X-P0906'
+- name: "ln kernel for el7"
+ shell: ln -vfs --relative /usr/src/kernels/3.10.0-1160.59.1.el7.x86_64/ /lib/modules/3.10.0-1160.59.1.el7.x86_64/build
+ when: runtime_env == 'TSG-X-P1403'
-- name: "execute MFT installer"
- shell: /tmp/OFED/unarchived/mft-4.20.0-34-x86_64-rpm/install.sh
+###### TSG-X-P0804 TSG-X-P0906 ofed install start ######
+- name: "install rpm packages: ofed"
+ yum:
+ name: "mlnx-ofed-all-5.17.15-1.el8-v1.0.0-20221206.noarch"
+ conf_file: "{{ rpm_repo_config_path }}"
+ state: present
when: runtime_env == 'TSG-X-P0804' or runtime_env == 'TSG-X-P0906'
+############ end ############
-######TSG-X-P0804 install end ######
+###### TSG-X-P1403 ofed install start ######
+- name: "install rpm packages: ofed"
+ yum:
+ name: "mlnx-ofed-all-3.10.0-1160.59.1.el7-v1.0.0-20221206.noarch"
+ conf_file: "{{ rpm_repo_config_path }}"
+ state: present
+ when: runtime_env == 'TSG-X-P1403'
+############ end ############
-######TSG-X-P1403 install start######
-- name: "unarchive OFED installer"
+###### MFT install start ######
+- name: "unarchive mft RPM"
unarchive:
- src: /tmp/OFED/MLNX_OFED_LINUX-5.5-1.0.3.2-rhel7.9-x86_64-ext.tgz
- dest: /tmp/OFED/unarchived/
+ src: /tmp/mft/mft-4.20.0-34-x86_64-rpm.tgz
+ dest: /tmp/mft/unarchived/
remote_src: yes
- when: runtime_env == 'TSG-X-P1403'
-- name: "execute OFED installer"
- shell: /tmp/OFED/unarchived/MLNX_OFED_LINUX-5.5-1.0.3.2-rhel7.9-x86_64-ext/mlnxofedinstall --add-kernel-support --kernel 3.10.0-1160.59.1.el7.x86_64 --force --without-depcheck
- when: runtime_env == 'TSG-X-P1403'
-######TSG-X-P1403 install end ######
+- name: "execute MFT installer"
+ shell: /tmp/mft/unarchived/mft-4.20.0-34-x86_64-rpm/install.sh
+############ end ############
- name: "enable auto update firmware on boot"
replace:
@@ -72,7 +74,7 @@
- name: "Restore the uname tools"
copy:
- src: "/usr/bin/uname-bak"
+ src: "/usr/bin/uname-backup"
dest: "/usr/bin/uname"
mode: "0755"
- remote_src: yes \ No newline at end of file
+ remote_src: yes
diff --git a/conf/yum-CentOS-7.conf b/conf/yum-CentOS-7.conf
index 039993af..5371b615 100644
--- a/conf/yum-CentOS-7.conf
+++ b/conf/yum-CentOS-7.conf
@@ -124,3 +124,11 @@ enabled=1
gpgcheck=0
username=PULP_REPO_USERNAME
password=PULP_REPO_PASSWORD
+
+[ofed]
+name=ofed
+baseurl=https://repo.geedge.net/pulp/content/7/x86_64/stable/ofed/
+enabled=1
+gpgcheck=0
+username=PULP_REPO_USERNAME
+password=PULP_REPO_PASSWORD \ No newline at end of file
diff --git a/conf/yum-RockyLinux-8.conf b/conf/yum-RockyLinux-8.conf
index 1545a8b3..3750b148 100644
--- a/conf/yum-RockyLinux-8.conf
+++ b/conf/yum-RockyLinux-8.conf
@@ -97,3 +97,11 @@ enabled=1
gpgcheck=0
username=PULP_REPO_USERNAME
password=PULP_REPO_PASSWORD
+
+[ofed]
+name=ofed
+baseurl=https://repo.geedge.net/pulp/content/8/x86_64/stable/ofed/
+enabled=1
+gpgcheck=0
+username=PULP_REPO_USERNAME
+password=PULP_REPO_PASSWORD \ No newline at end of file
diff --git a/tools/mk-base-image b/tools/mk-base-image
index 8fa31ba0..56a8bcbc 100755
--- a/tools/mk-base-image
+++ b/tools/mk-base-image
@@ -54,7 +54,7 @@ case $profile_id in
base_package_to_install="@base @core @debugging @directory-client @guest-agents
@hardware-monitoring @network-file-system-client @performance @remote-system-management
grub2 epel-release efibootmgr ansible yum-utils ipmitool docker-ce docker-ce-cli
- containerd.io lrzsz python3 vconfig watchdog pcm git tmux fish"
+ containerd.io lrzsz python3 vconfig watchdog pcm git tmux fish rpm-build"
;;
*)
base_package_to_install="error_profile_id"