diff options
| author | fumingwei <[email protected]> | 2023-11-29 16:44:17 +0800 |
|---|---|---|
| committer | 付明卫 <[email protected]> | 2023-12-10 12:37:39 +0000 |
| commit | 4ecad45965b02fc6c3cda2ec3371cab7adc93763 (patch) | |
| tree | ce0e728660ce8898407574c493d24790fb21e997 | |
| parent | da989c356ce070c714c4aaaedf8efcea82a187f9 (diff) | |
feature:TSG-17838:构建TSG 9140 NPB容器化镜像rel-23.12
96 files changed, 420 insertions, 2560 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f61502fc..2317402b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,44 +72,31 @@ stages: tags: - tsg-os-builder-el8 -feature_branch_build_7400_mcn0: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN0P01R01 - DALIY_BUILD_VERSION: 1 - except: - - tags - - /^dev-.*$/i - - /^rel-.*$/i - - /^update-.*$/i - -feature_branch_build_7400_mcn123: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN123P01R01 - DALIY_BUILD_VERSION: 1 - except: - - tags - - /^dev-.*$/i - - /^rel-.*$/i - - /^update-.*$/i +# feature_branch_build_7400_mcn0: +# image: $BUILD_BASED_IMAGE_CENTOS7 +# stage: build +# extends: .build_tsg-buildimage +# variables: +# PROFILE_LIST: 7400MCN0P01R01 +# DALIY_BUILD_VERSION: 1 +# except: +# - tags +# - /^dev-.*$/i +# - /^rel-.*$/i +# - /^update-.*$/i -feature_branch_build_9000: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 9000NPBP01R01 - DALIY_BUILD_VERSION: 1 - except: - - tags - - /^dev-.*$/i - - /^rel-.*$/i - - /^update-.*$/i +# feature_branch_build_7400_mcn123: +# image: $BUILD_BASED_IMAGE_CENTOS7 +# stage: build +# extends: .build_tsg-buildimage +# variables: +# PROFILE_LIST: 7400MCN123P01R01 +# DALIY_BUILD_VERSION: 1 +# except: +# - tags +# - /^dev-.*$/i +# - /^rel-.*$/i +# - /^update-.*$/i feature_branch_build_container_images_TSGXP0906: image: $BUILD_BASED_IMAGE_ROCKYLINUX8 @@ -163,75 +150,33 @@ feature_branch_build_kvm_image_TSGXP0906: - /^rel-.*$/i - /^update-.*$/i -# feature_branch_build_server_unlocked: +# develop_build_7400_mcn0: # image: $BUILD_BASED_IMAGE_CENTOS7 # stage: build # extends: .build_tsg-buildimage # variables: -# PROFILE_LIST: SERVER +# PROFILE_LIST: 7400MCN0P01R01 +# UPLOAD_TO_FILE_REPO: 1 +# PULP3_FILE_REPO_NAME: tsg-os-images-develop +# PULP3_FILE_DIST_NAME: tsg-os-images-develop # DALIY_BUILD_VERSION: 1 -# LOCK_STATE: UNLOCKED -# except: -# - tags +# FILE_REPO_PATH: install/develop/tsg-os-images +# only: # - /^dev-.*$/i -# - /^rel-.*$/i -# - /^update-.*$/i -# feature_branch_build_server_locked: +# develop_build_7400_mcn123: # image: $BUILD_BASED_IMAGE_CENTOS7 # stage: build # extends: .build_tsg-buildimage # variables: -# PROFILE_LIST: SERVER +# PROFILE_LIST: 7400MCN123P01R01 +# UPLOAD_TO_FILE_REPO: 1 +# PULP3_FILE_REPO_NAME: tsg-os-images-develop +# PULP3_FILE_DIST_NAME: tsg-os-images-develop # DALIY_BUILD_VERSION: 1 -# LOCK_STATE: LOCKED -# except: -# - tags +# FILE_REPO_PATH: install/develop/tsg-os-images +# only: # - /^dev-.*$/i -# - /^rel-.*$/i -# - /^update-.*$/i - -develop_build_7400_mcn0: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN0P01R01 - UPLOAD_TO_FILE_REPO: 1 - PULP3_FILE_REPO_NAME: tsg-os-images-develop - PULP3_FILE_DIST_NAME: tsg-os-images-develop - DALIY_BUILD_VERSION: 1 - FILE_REPO_PATH: install/develop/tsg-os-images - only: - - /^dev-.*$/i - -develop_build_7400_mcn123: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN123P01R01 - UPLOAD_TO_FILE_REPO: 1 - PULP3_FILE_REPO_NAME: tsg-os-images-develop - PULP3_FILE_DIST_NAME: tsg-os-images-develop - DALIY_BUILD_VERSION: 1 - FILE_REPO_PATH: install/develop/tsg-os-images - only: - - /^dev-.*$/i - -develop_build_9000: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 9000NPBP01R01 - UPLOAD_TO_FILE_REPO: 1 - PULP3_FILE_REPO_NAME: tsg-os-images-develop - PULP3_FILE_DIST_NAME: tsg-os-images-develop - DALIY_BUILD_VERSION: 1 - FILE_REPO_PATH: install/develop/tsg-os-images - only: - - /^dev-.*$/i develop_build_container_images_TSGXP0906: image: $BUILD_BASED_IMAGE_ROCKYLINUX8 @@ -289,77 +234,33 @@ develop_build_kvm_image_TSGXP0906: only: - /^dev-.*$/i -# develop_build_server_unlocked: +# testing_build_7400_mcn0: # image: $BUILD_BASED_IMAGE_CENTOS7 # stage: build # extends: .build_tsg-buildimage # variables: -# PROFILE_LIST: SERVER +# PROFILE_LIST: 7400MCN0P01R01 # UPLOAD_TO_FILE_REPO: 1 -# PULP3_FILE_REPO_NAME: tsg-os-images-develop -# PULP3_FILE_DIST_NAME: tsg-os-images-develop +# PULP3_FILE_REPO_NAME: tsg-os-images-testing +# PULP3_FILE_DIST_NAME: tsg-os-images-testing +# FILE_REPO_PATH: install/testing/tsg-os-images # DALIY_BUILD_VERSION: 1 -# FILE_REPO_PATH: install/develop/tsg-os-images -# LOCK_STATE: UNLOCKED # only: -# - /^dev-.*$/i +# - /^rel-.*$/i -# develop_build_server_locked: +# testing_build_7400_mcn123: # image: $BUILD_BASED_IMAGE_CENTOS7 # stage: build # extends: .build_tsg-buildimage # variables: -# PROFILE_LIST: SERVER +# PROFILE_LIST: 7400MCN123P01R01 # UPLOAD_TO_FILE_REPO: 1 -# PULP3_FILE_REPO_NAME: tsg-os-images-develop -# PULP3_FILE_DIST_NAME: tsg-os-images-develop +# PULP3_FILE_REPO_NAME: tsg-os-images-testing +# PULP3_FILE_DIST_NAME: tsg-os-images-testing +# FILE_REPO_PATH: install/testing/tsg-os-images # DALIY_BUILD_VERSION: 1 -# FILE_REPO_PATH: install/develop/tsg-os-images -# LOCK_STATE: LOCKED # only: -# - /^dev-.*$/i - -testing_build_7400_mcn0: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN0P01R01 - UPLOAD_TO_FILE_REPO: 1 - PULP3_FILE_REPO_NAME: tsg-os-images-testing - PULP3_FILE_DIST_NAME: tsg-os-images-testing - FILE_REPO_PATH: install/testing/tsg-os-images - DALIY_BUILD_VERSION: 1 - only: - - /^rel-.*$/i - -testing_build_7400_mcn123: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN123P01R01 - UPLOAD_TO_FILE_REPO: 1 - PULP3_FILE_REPO_NAME: tsg-os-images-testing - PULP3_FILE_DIST_NAME: tsg-os-images-testing - FILE_REPO_PATH: install/testing/tsg-os-images - DALIY_BUILD_VERSION: 1 - only: - - /^rel-.*$/i - -testing_build_9000: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 9000NPBP01R01 - UPLOAD_TO_FILE_REPO: 1 - PULP3_FILE_REPO_NAME: tsg-os-images-testing - PULP3_FILE_DIST_NAME: tsg-os-images-testing - FILE_REPO_PATH: install/testing/tsg-os-images - DALIY_BUILD_VERSION: 1 - only: - - /^rel-.*$/i +# - /^rel-.*$/i testing_build_container_images_TSGXP0906: image: $BUILD_BASED_IMAGE_ROCKYLINUX8 @@ -417,77 +318,33 @@ testing_build_kvm_image_TSGXP0906: only: - /^rel-.*$/i -# testing_build_server_unlocked: +# rc_build_7400_mcn0: # image: $BUILD_BASED_IMAGE_CENTOS7 # stage: build # extends: .build_tsg-buildimage # variables: -# PROFILE_LIST: SERVER +# PROFILE_LIST: 7400MCN0P01R01 # UPLOAD_TO_FILE_REPO: 1 -# PULP3_FILE_REPO_NAME: tsg-os-images-testing -# PULP3_FILE_DIST_NAME: tsg-os-images-testing -# DALIY_BUILD_VERSION: 1 -# FILE_REPO_PATH: install/testing/tsg-os-images -# LOCK_STATE: UNLOCKED +# DALIY_BUILD_VERSION: 0 +# PULP3_FILE_REPO_NAME: tsg-os-images-rc +# PULP3_FILE_DIST_NAME: tsg-os-images-rc +# FILE_REPO_PATH: install/rc/tsg-os-images # only: -# - /^rel-.*$/i +# - /^.*-rc.*$/i -# testing_build_server_locked: +# rc_build_7400_mcn123: # image: $BUILD_BASED_IMAGE_CENTOS7 # stage: build # extends: .build_tsg-buildimage # variables: -# PROFILE_LIST: SERVER +# PROFILE_LIST: 7400MCN123P01R01 # UPLOAD_TO_FILE_REPO: 1 -# PULP3_FILE_REPO_NAME: tsg-os-images-testing -# PULP3_FILE_DIST_NAME: tsg-os-images-testing -# DALIY_BUILD_VERSION: 1 -# FILE_REPO_PATH: install/testing/tsg-os-images -# LOCK_STATE: LOCKED +# DALIY_BUILD_VERSION: 0 +# PULP3_FILE_REPO_NAME: tsg-os-images-rc +# PULP3_FILE_DIST_NAME: tsg-os-images-rc +# FILE_REPO_PATH: install/rc/tsg-os-images # only: -# - /^rel-.*$/i - -rc_build_7400_mcn0: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN0P01R01 - UPLOAD_TO_FILE_REPO: 1 - DALIY_BUILD_VERSION: 0 - PULP3_FILE_REPO_NAME: tsg-os-images-rc - PULP3_FILE_DIST_NAME: tsg-os-images-rc - FILE_REPO_PATH: install/rc/tsg-os-images - only: - - /^.*-rc.*$/i - -rc_build_7400_mcn123: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN123P01R01 - UPLOAD_TO_FILE_REPO: 1 - DALIY_BUILD_VERSION: 0 - PULP3_FILE_REPO_NAME: tsg-os-images-rc - PULP3_FILE_DIST_NAME: tsg-os-images-rc - FILE_REPO_PATH: install/rc/tsg-os-images - only: - - /^.*-rc.*$/i - -rc_build_9000: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 9000NPBP01R01 - UPLOAD_TO_FILE_REPO: 1 - DALIY_BUILD_VERSION: 0 - PULP3_FILE_REPO_NAME: tsg-os-images-rc - PULP3_FILE_DIST_NAME: tsg-os-images-rc - FILE_REPO_PATH: install/rc/tsg-os-images - only: - - /^.*-rc.*$/i +# - /^.*-rc.*$/i rc_build_container_images_TSGXP0906: image: $BUILD_BASED_IMAGE_ROCKYLINUX8 @@ -545,84 +402,38 @@ rc_build_kvm_image_TSGXP0906: only: - /^.*-rc.*$/i -# rc_build_server_unlocked: +# release_build_7400_mcn0: # image: $BUILD_BASED_IMAGE_CENTOS7 # stage: build # extends: .build_tsg-buildimage # variables: -# PROFILE_LIST: SERVER +# PROFILE_LIST: 7400MCN0P01R01 # UPLOAD_TO_FILE_REPO: 1 # DALIY_BUILD_VERSION: 0 -# PULP3_FILE_REPO_NAME: tsg-os-images-rc -# PULP3_FILE_DIST_NAME: tsg-os-images-rc -# FILE_REPO_PATH: install/rc/tsg-os-images -# LOCK_STATE: UNLOCKED +# PULP3_FILE_REPO_NAME: tsg-os-images-release +# PULP3_FILE_DIST_NAME: tsg-os-images-release +# FILE_REPO_PATH: install/release/tsg-os-images # only: +# - tags +# except: # - /^.*-rc.*$/i -# rc_build_server_locked: +# release_build_7400_mcn123: # image: $BUILD_BASED_IMAGE_CENTOS7 # stage: build # extends: .build_tsg-buildimage # variables: -# PROFILE_LIST: SERVER +# PROFILE_LIST: 7400MCN123P01R01 # UPLOAD_TO_FILE_REPO: 1 # DALIY_BUILD_VERSION: 0 -# PULP3_FILE_REPO_NAME: tsg-os-images-rc -# PULP3_FILE_DIST_NAME: tsg-os-images-rc -# FILE_REPO_PATH: install/rc/tsg-os-images -# LOCK_STATE: LOCKED +# PULP3_FILE_REPO_NAME: tsg-os-images-release +# PULP3_FILE_DIST_NAME: tsg-os-images-release +# FILE_REPO_PATH: install/release/tsg-os-images # only: +# - tags +# except: # - /^.*-rc.*$/i -release_build_7400_mcn0: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN0P01R01 - UPLOAD_TO_FILE_REPO: 1 - DALIY_BUILD_VERSION: 0 - PULP3_FILE_REPO_NAME: tsg-os-images-release - PULP3_FILE_DIST_NAME: tsg-os-images-release - FILE_REPO_PATH: install/release/tsg-os-images - only: - - tags - except: - - /^.*-rc.*$/i - -release_build_7400_mcn123: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 7400MCN123P01R01 - UPLOAD_TO_FILE_REPO: 1 - DALIY_BUILD_VERSION: 0 - PULP3_FILE_REPO_NAME: tsg-os-images-release - PULP3_FILE_DIST_NAME: tsg-os-images-release - FILE_REPO_PATH: install/release/tsg-os-images - only: - - tags - except: - - /^.*-rc.*$/i - -release_build_9000: - image: $BUILD_BASED_IMAGE_CENTOS7 - stage: build - extends: .build_tsg-buildimage - variables: - PROFILE_LIST: 9000NPBP01R01 - UPLOAD_TO_FILE_REPO: 1 - DALIY_BUILD_VERSION: 0 - PULP3_FILE_REPO_NAME: tsg-os-images-release - PULP3_FILE_DIST_NAME: tsg-os-images-release - FILE_REPO_PATH: install/release/tsg-os-images - only: - - tags - except: - - /^.*-rc.*$/i - release_build_container_images_TSGXP0906: image: $BUILD_BASED_IMAGE_ROCKYLINUX8 stage: build @@ -684,37 +495,3 @@ release_build_kvm_image_TSGXP0906: - tags except: - /^.*-rc.*$/i - -# release_build_server_unlocked: -# image: $BUILD_BASED_IMAGE_CENTOS7 -# stage: build -# extends: .build_tsg-buildimage -# variables: -# PROFILE_LIST: SERVER -# UPLOAD_TO_FILE_REPO: 1 -# DALIY_BUILD_VERSION: 0 -# PULP3_FILE_REPO_NAME: tsg-os-images-release -# PULP3_FILE_DIST_NAME: tsg-os-images-release -# FILE_REPO_PATH: install/release/tsg-os-images -# LOCK_STATE: UNLOCKED -# only: -# - tags -# except: -# - /^.*-rc.*$/i - -# release_build_server_locked: -# image: $BUILD_BASED_IMAGE_CENTOS7 -# stage: build -# extends: .build_tsg-buildimage -# variables: -# PROFILE_LIST: SERVER -# UPLOAD_TO_FILE_REPO: 1 -# DALIY_BUILD_VERSION: 0 -# PULP3_FILE_REPO_NAME: tsg-os-images-release -# PULP3_FILE_DIST_NAME: tsg-os-images-release -# FILE_REPO_PATH: install/release/tsg-os-images -# LOCK_STATE: LOCKED -# only: -# - tags -# except: -# - /^.*-rc.*$/i diff --git a/ansible/HAL_deploy.yml b/ansible/HAL_deploy.yml index 98cdca69..13ef9419 100644 --- a/ansible/HAL_deploy.yml +++ b/ansible/HAL_deploy.yml @@ -50,42 +50,6 @@ - {role: system-init, tags: system-init} - {role: hasp, tags: hasp} -- hosts: 9000-NPB-P01R01 - remote_user: root - vars_files: - - install_config/group_vars/HAL_9000NPBP01R01.yml - - install_config/group_vars/rpm_version.yml - roles: - - {role: tsg-os-provision, tags: tsg-os-provision} - - {role: coredump, tags: coredump} - - {role: tsg_device_tag, tags: tsg_device_tag} - - {role: tsg_sn, tags: tsg_sn} - - {role: framework, tags: framework} - - {role: mrzcpd, tags: mrzcpd} - - {role: sapp, tags: sapp} - - {role: kni, tags: kni} - - {role: firewall, tags: firewall} - - {role: tsg_app, tags: tsg_app} - - {role: i40e-drive, tags: i40e-drive} - - {role: redis, tags: redis} - - {role: certstore, tags: certstore} - - {role: tfe, tags: tfe} - - {role: telegraf_statistic, tags: telegraf_statistic} - - {role: sysctl, tags: sysctl} - - {role: exporter, tags: exporter} - - {role: docker, tags: docker} - - {role: tsg-diagnose, tags: tsg-diagnose} - - {role: tsg-exporter-proxy-9140, tags: tsg-exporter-proxy-9140} - - {role: system-init-9140, tags: system-init-9140} - - {role: system-init, tags: system-init} - - {role: wannat_wangw, tags: wannat_wangw} - - {role: wannat_common, tags: wannat_common} - - {role: wire_graft, tags: wire_graft} - - {role: nz-talon, tags: nz-talon} - - {role: tsg-os-provision-condition, tags: tsg-os-provision-condition} - - {role: consul, tags: consul} - - {role: hasp, tags: hasp} - - hosts: TSG-X-NXR620G40-R01-P0906 remote_user: root vars_files: @@ -113,6 +77,7 @@ - {role: cm-cache, tags: cm-cache} - {role: exporter, tags: exporter} - {role: tuned, tags: tuned} + - {role: patches-9000-NPB, tags: patches-9000-NPB} - hosts: TSG-X-NXR620G40-R01-P0906-init remote_user: root @@ -212,13 +177,6 @@ - {role: mrzcpd, tags: mrzcpd} - {role: confd, tags: confd} -- hosts: server - remote_user: root - vars_files: - - install_config/group_vars/rpm_version.yml - roles: - - {role: rpm_download, tags: rpm_download} - - hosts: TSG-X-NXR620G40-R01-P0906-base remote_user: root vars_files: diff --git a/ansible/roles/OFED/tasks/main.yml b/ansible/roles/OFED/tasks/main.yml index 57973e9b..6e19eef7 100644 --- a/ansible/roles/OFED/tasks/main.yml +++ b/ansible/roles/OFED/tasks/main.yml @@ -29,7 +29,6 @@ name: "mlnx-ofed-kernel-only-all-5.17.15-1.el8.x86_64.noarch" conf_file: "{{ rpm_repo_config_path }}" state: present - when: runtime_env == 'TSG-X-P0906' ######################### end ######################### ############ MFT install start ############ @@ -38,17 +37,14 @@ src: /tmp/mft/mft-4.22.1-11-x86_64-rpm.tgz dest: /tmp/mft/unarchived/ remote_src: yes - when: runtime_env == 'TSG-X-P0906' - name: "Execute MFT installer" shell: /tmp/mft/unarchived/mft-4.22.1-11-x86_64-rpm/install.sh - when: runtime_env == 'TSG-X-P0906' ######################### end ######################### ############ MLNX FW UPDATER install start ############ - name: "Install mlnx-fw-updater rpm package" shell: rpm -i /tmp/mft/mlnx-fw-updater-5.8-2.0.3.0.x86_64.rpm - when: runtime_env == 'TSG-X-P0906' ######################### end ######################### ############ Set RUN_FW_UPDATER_ONBOOT ############ @@ -57,7 +53,6 @@ path: /etc/infiniband/openib.conf regexp: '^RUN_FW_UPDATER_ONBOOT' line: "RUN_FW_UPDATER_ONBOOT=no" - when: runtime_env == 'TSG-X-P0906' ######################### end ######################### ###### Restore the uname tools ###### diff --git a/ansible/roles/framework/files/maat_redis_tool b/ansible/roles/framework/files/maat_redis_tool Binary files differdeleted file mode 100644 index 9e797bb7..00000000 --- a/ansible/roles/framework/files/maat_redis_tool +++ /dev/null diff --git a/ansible/roles/mrzcpd-deviceplugin/tasks/main.yml b/ansible/roles/mrzcpd-deviceplugin/tasks/main.yml index 00e7b00e..18fbf76d 100644 --- a/ansible/roles/mrzcpd-deviceplugin/tasks/main.yml +++ b/ansible/roles/mrzcpd-deviceplugin/tasks/main.yml @@ -7,5 +7,4 @@ state: present - name: "Install lspci" - shell: yum install -y pciutils - when: runtime_env == 'TSG-X-P0906'
\ No newline at end of file + shell: yum install -y pciutils
\ No newline at end of file diff --git a/ansible/roles/mrzcpd/tasks/main.yml b/ansible/roles/mrzcpd/tasks/main.yml index e55a414d..b6d7af39 100644 --- a/ansible/roles/mrzcpd/tasks/main.yml +++ b/ansible/roles/mrzcpd/tasks/main.yml @@ -109,13 +109,6 @@ mode: 0644 when: runtime_env != 'TSG-X-P0906' -- name: "update mrglobal.conf - TSG9140" - template: - src: "{{ role_path }}/templates/mrglobal.conf.j2.j2.9000NPBP01R01" - dest: /opt/tsg/tsg-os-provision/templates/mrglobal.conf.j2 - when: - - runtime_env == 'TSG-9140' - - name: "update mrglobal.conf - TSG7400 - mcn0" template: src: "{{ role_path }}/templates/mrglobal.conf.j2.j2.7400MCN0P01R01" diff --git a/ansible/roles/mrzcpd/templates/mrglobal.conf.j2.j2.9000NPBP01R01 b/ansible/roles/mrzcpd/templates/mrglobal.conf.j2.j2.9000NPBP01R01 deleted file mode 100644 index d723c9e4..00000000 --- a/ansible/roles/mrzcpd/templates/mrglobal.conf.j2.j2.9000NPBP01R01 +++ /dev/null @@ -1,77 +0,0 @@ -[device] -{% set steeering_to_proxy_nic_list = [] %} -{% for node_info in dp_steering_proxy.node_list %}{{ steeering_to_proxy_nic_list.append(node_info.nic_name) }}{% endfor %} -device={{ dp_steering_firewall.nic_internal }},{{ steeering_to_proxy_nic_list | join(",") }},{{ dp_traffic_mirror.nic_name }} -sz_tunnel=8192 -sz_buffer=0 - -[device:{{ dp_steering_firewall.nic_internal }}] -mtu=4096 -clear_tx_flags=1 -hw_strip_crc=1 -vlan-strip=1 -{% raw %}in_addr={{ gdev_conf_keep_alive_ip }} -{% endraw %} -in_mask=255.255.0.0 -rssmode=2 - -{% for node_info in dp_steering_proxy.node_list %} -[device:{{ node_info.nic_name }}] -mtu=4096 -clear_tx_flags=1 -vlan-filter=1 -vlan-strip=1 -vlan-id-allow=4095 -vlan-pvid=0 -vlan-pvid-mode=2 -hw_strip_crc=1 -sz_tunnel=8192 -sz_buffer=0 -rssmode=2 - -{% endfor %} - -[device:{{ dp_traffic_mirror.nic_name }}] -mtu=2048 -hw_strip_crc=1 -rssmode=2 -vlan-strip=1 - -[service] -# lcore id for i/o service, use comma to split -iocore={{ workload_zcpd.cpu_affinity }} -{% raw %}{% if session_distribution_policy.hash_key == 'outer-most-sip-dip' %} -distmode=0 -{% endif %} -{% if session_distribution_policy.hash_key == 'outer-most-sip-dip-sport-dport' %} -distmode=1 -{% endif %} -{% if session_distribution_policy.hash_key == 'inner-most-sip-dip' %} -distmode=2 -{% endif %} -{% if session_distribution_policy.hash_key == 'inner-most-sip-dip-sport-dport' %} -distmode=3 -{% endif %} -{% if session_distribution_policy.hash_key == 'hardware' %} -distmode=4 -{% endif %} -{% endraw %} -hashmode=0 -idle_threshold=10000 - -[eal] -virtaddr=0x7f40c4a00000 -loglevel=7 - -[keepalive] -check_spinlock=0 - -[ctrlzone] -ctrlzone0=tunnat,64 - -[pool] -create_mode=3 -sz_direct_pktmbuf=2097152 -sz_indirect_pktmbuf=8192 -sz_cache=256 -sz_data=4096
\ No newline at end of file diff --git a/ansible/roles/nz-talon/files/nz-talon-21.11.13-Release.x86_64.rpm b/ansible/roles/nz-talon/files/nz-talon-21.11.13-Release.x86_64.rpm Binary files differdeleted file mode 100644 index a11e8d22..00000000 --- a/ansible/roles/nz-talon/files/nz-talon-21.11.13-Release.x86_64.rpm +++ /dev/null diff --git a/ansible/roles/nz-talon/tasks/main.yml b/ansible/roles/nz-talon/tasks/main.yml deleted file mode 100644 index 3556152b..00000000 --- a/ansible/roles/nz-talon/tasks/main.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: "copy nz-talon rpms to destination server" - copy: - src: "{{ role_path }}/files/" - dest: "/tmp/nz-talon/" - -- name: "install nz-talon" - yum: - name: - - /tmp/nz-talon/nz-talon-21.11.13-Release.x86_64.rpm - state: present - -- name: "enable promtail" - systemd: - name: promtail - enabled: yes - -- name: "enable nz-talon" - systemd: - name: nz-talon - enabled: yes diff --git a/ansible/roles/patches-9000-NPB/files/README.md b/ansible/roles/patches-9000-NPB/files/README.md new file mode 100644 index 00000000..fbd404cf --- /dev/null +++ b/ansible/roles/patches-9000-NPB/files/README.md @@ -0,0 +1,14 @@ +# TSG-9140设备网卡固化列表 + +|序号 | 原网卡名 | bus-info | 固化网卡名 | 用途 | +| --- | --- | --- | --- | --- | +| 1 | enp1s0 | 0000:01:00.0 | eth_pf_smbio | 与OS3300连接的X710网卡 从交换板上获取/转发原始流量 | +| 5 | enp130s0 | 0000:82:00.0 | eth_pf_smbcx | 与OS3200连接的X710网卡 | +| 8 | enp130s2f2 | 0000:82:02.2 | eth_vf_mirr | 解密流量转发 | +| 9 | enp130s2f3 | 0000:82:02.3 | eth_vf_ctl | 策略与日志 | +| 10 | enp131s0f0 | 0000:83:00.0 | eth_pf_mgmt0 | 与OS3300连接的base管理网卡 | +| 11 | enp131s0f1 | 0000:83:00.1 | eth_pf_mgmt1 | 与OS3200连接的base管理网卡(暂未使用) | +| 12 | enp131s0f2 | 0000:83:00.2 | eth_pf_ge0 | 前面板的GE电口(预留) | +| 13 | enp131s0f3 | 0000:83:00.3 | eth_pf_ge1 | 前面板的GE电口(预留) | +| 14 | enp5s0f0 | 0000:05:00.0 | eth_pf_xe0 | 前面板的10GE光口(预留) | +| 15 | enp5s0f1 | 0000:05:00.1 | eth_pf_xe0 | 前面板的10GE光口(预留) | diff --git a/ansible/roles/patches-9000-NPB/files/install.sh b/ansible/roles/patches-9000-NPB/files/install.sh new file mode 100644 index 00000000..d5a2a03a --- /dev/null +++ b/ansible/roles/patches-9000-NPB/files/install.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +UNARCHIVE_DIR="/tmp/9000_NPB_patches" + + +function unarchive_patch_tgz() +{ + mkdir -p $UNARCHIVE_DIR + PAYLOAD_LINE=`awk '/^__PAYLOAD_BELOW__/ {print NR + 1; exit 0; }' $0` + tail -n+$PAYLOAD_LINE $0 | tar xzv -C $UNARCHIVE_DIR +} + +function install_patch_files() +{ + cp $UNARCHIVE_DIR/90-9000NPBP01R01.rules /usr/lib/udev/rules.d/90-9000NPBP01R01.rules + + cp $UNARCHIVE_DIR/ifcfg-eth_pf_smbio /etc/sysconfig/network-scripts/ifcfg-eth_pf_smbio + cp $UNARCHIVE_DIR/set-eth_pf_smbio-macaddr.sh /usr/bin/set-eth_pf_smbio-macaddr.sh + chmod 0777 /usr/bin/set-eth_pf_smbio-macaddr.sh + + cp $UNARCHIVE_DIR/ifcfg-eth_pf_smbcx /etc/sysconfig/network-scripts/ifcfg-eth_pf_smbcx + cp $UNARCHIVE_DIR/ifcfg-eth_vf_mirr /etc/sysconfig/network-scripts/ifcfg-eth_vf_mirr + cp $UNARCHIVE_DIR/ifcfg-eth_vf_ctl /etc/sysconfig/network-scripts/ifcfg-eth_vf_ctl + + #Network Manager dispatcher shell + cp $UNARCHIVE_DIR/nm_pre-up_set_mgmt_ipaddr.sh /usr/lib/NetworkManager/dispatcher.d/pre-up.d/00-set_mgmt_ipaddr.sh + chmod 0755 /usr/lib/NetworkManager/dispatcher.d/pre-up.d/00-set_mgmt_ipaddr.sh + + cp $UNARCHIVE_DIR/ifcfg-eth_pf_xe0 /etc/sysconfig/network-scripts/ifcfg-eth_pf_xe0 + cp $UNARCHIVE_DIR/ifcfg-eth_pf_xe1 /etc/sysconfig/network-scripts/ifcfg-eth_pf_xe1 + cp $UNARCHIVE_DIR/ifcfg-eth_pf_mgmt0 /etc/sysconfig/network-scripts/ifcfg-eth_pf_mgmt0 + cp $UNARCHIVE_DIR/ifcfg-eth_pf_mgmt1 /etc/sysconfig/network-scripts/ifcfg-eth_pf_mgmt1 + cp $UNARCHIVE_DIR/ifcfg-eth_pf_ge0 /etc/sysconfig/network-scripts/ifcfg-eth_pf_ge0 + cp $UNARCHIVE_DIR/ifcfg-eth_pf_ge1 /etc/sysconfig/network-scripts/ifcfg-eth_pf_ge1 + + cp $UNARCHIVE_DIR/90-9000-dracut.rules /usr/lib/dracut/dracut.conf.d/90-9000-dracut.rules + + cp $UNARCHIVE_DIR/poweroff-guard.service /usr/lib/systemd/system/poweroff-guard.service + systemctl enable poweroff-guard.service + cp $UNARCHIVE_DIR/start-poweroff-guard.service /usr/lib/systemd/system/start-poweroff-guard.service + systemctl enable start-poweroff-guard.service + + mkdir -p /usr/lib/systemd/system/tsg-clixon-backend.service.d + cp $UNARCHIVE_DIR/service_add_prestart.conf /usr/lib/systemd/system/tsg-clixon-backend.service.d/service_add_prestart.conf + + mkdir -p /opt/tsg/clixon/bin + cp $UNARCHIVE_DIR/set_9000_NPB_running_db.sh /opt/tsg/clixon/bin/set_9000_NPB_running_db.sh + chmod 0755 /opt/tsg/clixon/bin/set_9000_NPB_running_db.sh +} + +function set_HAL_config() +{ + HAL_config="/etc/sysconfig/tsg-os-HAL.conf" + + # mrzcpd affinity cpu core + sed -i 's/.*IOCORE=*/IOCORE=1-4/' $HAL_config + # vsys affinity cpu core + sed -i 's/.*WORKLOAD_CORE=*/WORKLOAD_CORE=5-55/' $HAL_config + # deafault memory hugepages number. + sed -i 's/.*HUGEPAGES=*/HUGEPAGES=16/' $HAL_config +} + +function clean_unarchive_dir() +{ + rm -rf $UNARCHIVE_DIR +} + +unarchive_patch_tgz +install_patch_files +set_HAL_config +clean_unarchive_dir + +exit 0 + +__PAYLOAD_BELOW__ diff --git a/ansible/roles/system-init-9140/templates/90-9000-dracut.rules.j2 b/ansible/roles/patches-9000-NPB/files/patch/90-9000-dracut.rules index 0469b190..0469b190 100644 --- a/ansible/roles/system-init-9140/templates/90-9000-dracut.rules.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/90-9000-dracut.rules diff --git a/ansible/roles/patches-9000-NPB/files/patch/90-9000NPBP01R01.rules b/ansible/roles/patches-9000-NPB/files/patch/90-9000NPBP01R01.rules new file mode 100644 index 00000000..ff15ddf8 --- /dev/null +++ b/ansible/roles/patches-9000-NPB/files/patch/90-9000NPBP01R01.rules @@ -0,0 +1,22 @@ +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:00.0", NAME:="eth_pf_smbio" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:00.0",RUN+="/usr/bin/set-eth_pf_smbio-macaddr.sh" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0", NAME:="eth_pf_smbcx" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0",ATTR{device/sriov_numvfs}="2" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0",ATTR{/device/sriov/0/max_tx_rate}="20480" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0",ATTR{/device/sriov/1/max_tx_rate}="20480" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.0", NAME:="eth_vf_mirr" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.1", NAME:="eth_vf_ctl" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 1 vlan 3817" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 0 trust on" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 1 trust on" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 0 state enable" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 1 state enable" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 0 spoofchk off" + +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:83:00.0", NAME:="eth_pf_mgmt0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:83:00.1", NAME:="eth_pf_mgmt1" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:83:00.2", NAME:="eth_pf_ge0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:83:00.3", NAME:="eth_pf_ge1" + +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.0", NAME:="eth_pf_xe0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.1", NAME:="eth_pf_xe1"
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_ge0.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_ge0 index 5fd11d6d..5fd11d6d 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_ge0.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_ge0 diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_ge1.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_ge1 index c5f1fc2b..c5f1fc2b 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_ge1.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_ge1 diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_mgmt0.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_mgmt0 index a68347d4..a68347d4 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_mgmt0.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_mgmt0 diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_mgmt1.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_mgmt1 index fff6fcc0..fff6fcc0 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_mgmt1.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_mgmt1 diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_smbcx.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_smbcx index d3f20533..d3f20533 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_smbcx.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_smbcx diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_smbio.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_smbio index d4728f44..d4728f44 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_smbio.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_smbio diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_xe0.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_xe0 index 8cec9cf8..8cec9cf8 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_xe0.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_xe0 diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_xe1.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_xe1 index 66b4eccf..66b4eccf 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_xe1.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_pf_xe1 diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_ctl.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_vf_ctl index eb2f0aae..eb2f0aae 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_ctl.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_vf_ctl diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_mirr.toml.j2 b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_vf_mirr index 73418a22..73418a22 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_mirr.toml.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/ifcfg-eth_vf_mirr diff --git a/ansible/roles/patches-9000-NPB/files/patch/nm_pre-up_set_mgmt_ipaddr.sh b/ansible/roles/patches-9000-NPB/files/patch/nm_pre-up_set_mgmt_ipaddr.sh new file mode 100644 index 00000000..47b9ef4e --- /dev/null +++ b/ansible/roles/patches-9000-NPB/files/patch/nm_pre-up_set_mgmt_ipaddr.sh @@ -0,0 +1,29 @@ +#!/bin/sh +INTERFACE="$1" +ACTION="$2" +SLOT_ID= + +read_slot_id() +{ + output=$(ipmitool picmg addrinfo) + echo $output + substr=${output:22:1} + echo $substr + SLOT_ID=$((16#${substr}+16)) +} + +if [[ $INTERFACE == "eth_pf_mgmt0" ]] && [[ $ACTION == "pre-up" ]] +then + logger "NetworkManager Dispather Scripts: $0, Interface: $INTERFACE, action: $ACTION" + read_slot_id + ipaddr='10.254.'$SLOT_ID'.1' + ifconfig eth_pf_mgmt0 $ipaddr netmask 255.255.0.0 +fi + +if [[ $INTERFACE == "eth_pf_mgmt1" ]] && [[ $ACTION == "pre-up" ]] +then + logger "NetworkManager Dispather Scripts: $0, Interface: $INTERFACE, action: $ACTION" + read_slot_id + ipaddr='10.253.'$SLOT_ID'.1' + ifconfig eth_pf_mgmt1 $ipaddr netmask 255.255.0.0 +fi
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/poweroff-guard.service.j2 b/ansible/roles/patches-9000-NPB/files/patch/poweroff-guard.service index 58b04214..58b04214 100644 --- a/ansible/roles/system-init-9140/templates/poweroff-guard.service.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/poweroff-guard.service diff --git a/ansible/roles/patches-9000-NPB/files/patch/service_add_prestart.conf b/ansible/roles/patches-9000-NPB/files/patch/service_add_prestart.conf new file mode 100644 index 00000000..8b748ce9 --- /dev/null +++ b/ansible/roles/patches-9000-NPB/files/patch/service_add_prestart.conf @@ -0,0 +1,2 @@ +[Service] +ExecStartPre=/opt/tsg/clixon/bin/set_9000_NPB_running_db.sh diff --git a/ansible/roles/patches-9000-NPB/files/patch/set-eth_pf_smbio-macaddr.sh b/ansible/roles/patches-9000-NPB/files/patch/set-eth_pf_smbio-macaddr.sh new file mode 100644 index 00000000..fab3d3d0 --- /dev/null +++ b/ansible/roles/patches-9000-NPB/files/patch/set-eth_pf_smbio-macaddr.sh @@ -0,0 +1,11 @@ +#!/bin/sh +NIC_NAME="eth_pf_smbio" +echo -------------------- set $NIC_NAME macaddr -------------------- + +output=$(ipmitool picmg addrinfo) +echo $output +substr=${output:21:2} +echo deviceid:$substr +macaddr='90:00:00:91:40:'$substr +echo $NIC_NAME macaddr:$macaddr +ip link set dev $NIC_NAME address $macaddr
\ No newline at end of file diff --git a/ansible/roles/patches-9000-NPB/files/patch/set_9000_NPB_running_db.sh b/ansible/roles/patches-9000-NPB/files/patch/set_9000_NPB_running_db.sh new file mode 100644 index 00000000..22be328f --- /dev/null +++ b/ansible/roles/patches-9000-NPB/files/patch/set_9000_NPB_running_db.sh @@ -0,0 +1,61 @@ +#!/bin/sh +RUNNING_DB_FILE="/etc/clixon/running_db" +NETWORK_IN_RUNNING_DB= + +SLOT_ID= + +read_slot_id() +{ + output=$(ipmitool picmg addrinfo) + substr=${output:22:1} + SLOT_ID=$((16#${substr}+16)) +} + +add_network_into_running_db() +{ + local network="<network xmlns=\"urn:yang:tsg-os-mgnt-srv\"> + <interface> + <name>eth_pf_smbio</name> + <type>endpoint</type> + <address>10.252.${SLOT_ID}.1</address> + </interface> + <interface> + <name>eth_vf_mirr</name> + <type>endpoint</type> + </interface> + <service> + <name>service_1</name> + <mode>virtual-wire</mode> + <listen_on_device>eth_pf_smbio</listen_on_device> + </service> + <traffic_mirror> + <enable>yes</enable> + <interface>eth_vf_mirr</interface> + </traffic_mirror> + </network>" + #xmlstarlet ed --omit-decl -s "/config" -t text -n '' -v "$(xmlstarlet sel -t -c '/config/*' 2.xml)" 1.xml | xmlstarlet unesc | xmlstarlet fo --omit-decl > 3.xml + #$network | xmlstarlet sel -t -c '/config/*' + xml_content=$(xmlstarlet ed --omit-decl -s "/config" -t text -n '' -v "${network}" ${RUNNING_DB_FILE} | xmlstarlet unesc) + echo ${xml_content} | xmlstarlet fo --omit-decl > ${RUNNING_DB_FILE} +} + +is_network_in_running_db() +{ + ret=$(xmlstarlet sel -N ns="urn:yang:tsg-os-mgnt-srv" -t -v "count(/config/ns:network)" ${RUNNING_DB_FILE}) + if [ "${ret}" == "0" ]; then + NETWORK_IN_RUNNING_DB="false" + else + NETWORK_IN_RUNNING_DB="true" + fi +} + +delete_running_db_network() +{ + if [ "${NETWORK_IN_RUNNING_DB}" == "true" ]; then + xmlstarlet ed --omit-decl -L -N ns="urn:yang:tsg-os-mgnt-srv" -d "/config/ns:network" ${RUNNING_DB_FILE} + fi +} +read_slot_id +is_network_in_running_db +delete_running_db_network +add_network_into_running_db diff --git a/ansible/roles/system-init-9140/templates/start-poweroff-guard.service.j2 b/ansible/roles/patches-9000-NPB/files/patch/start-poweroff-guard.service index 994b4385..994b4385 100644 --- a/ansible/roles/system-init-9140/templates/start-poweroff-guard.service.j2 +++ b/ansible/roles/patches-9000-NPB/files/patch/start-poweroff-guard.service diff --git a/ansible/roles/patches-9000-NPB/tasks/main.yml b/ansible/roles/patches-9000-NPB/tasks/main.yml new file mode 100644 index 00000000..f1f8c138 --- /dev/null +++ b/ansible/roles/patches-9000-NPB/tasks/main.yml @@ -0,0 +1,19 @@ +--- +- name: "Copy patch files to /tmp/9000_NPB/patch/ dir" + copy: + src: "{{ role_path }}/files/patch/" + dest: /tmp/9000_NPB/patch/ + +- name: "Copy install files to /tmp/9000_NPB dir" + copy: + src: "{{ role_path }}/files/install.sh" + dest: /tmp/9000_NPB/ + +- name: "Archive 9000 NPB patch tags" + shell: tar -zcvf /tmp/9000_NPB/patch.tar.gz -C /tmp/9000_NPB/patch/ . + +- name: "Build self-extracting scripts" + shell: cat /tmp/9000_NPB/install.sh /tmp/9000_NPB/patch.tar.gz > /tmp/9000_NPB/tsg-os_9000-NPB-P01R01_patch.bin + +- name: "Chmod +x tsg-os_9000-NPB-P01R01_patch.bin" + shell: chmod 0755 /tmp/9000_NPB/tsg-os_9000-NPB-P01R01_patch.bin
\ No newline at end of file diff --git a/ansible/roles/rpm_download/tasks/main.yml b/ansible/roles/rpm_download/tasks/main.yml deleted file mode 100644 index 2ad67621..00000000 --- a/ansible/roles/rpm_download/tasks/main.yml +++ /dev/null @@ -1,142 +0,0 @@ ---- -- name: "download rpm packages: certstore" - yum: - name: - - "{{ certstore_rpm_version.certstore }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - -- name: "download rpm packages: firewall" - yum: - name: "{{ item.value }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - with_dict: "{{ firewall_rpm_version }}" - -- name: "uninstall rsyslog-kafka and librdkafka" - yum: - name: "{{ item }}" - state: absent - with_items: - - rsyslog-kafka - - librdkafka - -- name: "download rpm packages: framework" - yum: - name: "{{ item.1 }}" - state: present - conf_file: "{{ rpm_repo_config_path }}" - download_only: yes - download_dir: "{{ path_download }}" - loop: "{{ framework_rpm_version | dictsort }}" - -- name: "download rpm packages: kni" - yum: - name: - - "{{ kni_rpm_version.kni }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - -- name: "download rpm packages: mrzcpd" - yum: - name: "{{ item.value }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - with_dict: "{{ mrzcpd_rpm_version }}" - -- name: "download rpm packages: sapp and tcpdump_mesa" - yum: - name: "{{ item.value }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - with_dict: "{{ sapp_rpm_version }}" - -- name: "download rpm packages: tfe" - yum: - name: "{{ item.value }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - with_dict: "{{ tfe_rpm_version }}" - -- name: "download rpm packages: app_skecth_local" - yum: - name: "{{ tsg_app_rpm_version.app_sketch_local }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - -- name: "download rpm packages: tsg-diagnose" - yum: - name: - - "{{ tsg_diagnose_rpm_version.tsg_diagnose }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - -- name: "download rpm packages: http_healthcheck" - yum: - name: "{{ http_healthcheck_rpm_version.http_healthcheck }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - -- name: "download rpm packages: wannat wangw" - yum: - name: "{{ item.value }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - with_dict: "{{ wannat_wangw_rpm_version }}" - -- name: "download rpm packages: wire_graft" - yum: - name: "{{ item.value }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" - with_dict: "{{ wire_graft_rpm_version }}" - -- name: "download rpm packages: freeipmi" - yum: - name: "{{ item }}" - conf_file: "{{ rpm_repo_config_path }}" - state: latest - download_only: yes - download_dir: "{{ path_download }}" - with_items: - - freeipmi - - systemd-sysv - -- name: "download rpm packages: watchdog" - yum: - name: "watchdog" - conf_file: "{{ rpm_repo_config_path }}" - state: latest - download_only: yes - download_dir: "{{ path_download }}" - -- name: "download rpm packages: hasp_tools" - yum: - name: - - "{{ hasp_tools_rpm_version.hasp_tools }}" - conf_file: "{{ rpm_repo_config_path }}" - state: present - download_only: yes - download_dir: "{{ path_download }}" diff --git a/ansible/roles/rpm_to_dest/tasks/main.yml b/ansible/roles/rpm_to_dest/tasks/main.yml deleted file mode 100644 index d7117a4a..00000000 --- a/ansible/roles/rpm_to_dest/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: "copy rpm to target_device" - copy: - src: "{{ role_path }}/files/" - dest: /tmp/rpm_download/ diff --git a/ansible/roles/rpm_uninstall/tasks/main.yml b/ansible/roles/rpm_uninstall/tasks/main.yml deleted file mode 100644 index b75179de..00000000 --- a/ansible/roles/rpm_uninstall/tasks/main.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -#- name: "uninstall certstore" -# yum: -# name: "{{ item.value }}" -# state: absent -# with_dict: "{{ certstore_rpm_version }}" - -- name: "uninstall firewall" - yum: - name: "{{ item.key }}" - state: absent - with_dict: "{{ firewall_rpm_version }}" - -#- name: "uninstall framework" -# yum: -# name: "{{ item.key }}" -# state: absent -# with_dict: "{{ framework_rpm_version }}" - -- name: "uninstall kni" - yum: - name: "{{ item.key }}" - state: absent - with_dict: "{{ kni_rpm_version }}" - -- name: "uninstall mrzcpd" - yum: - name: "{{ item.key }}" - state: absent - with_dict: "{{ mrzcpd_rpm_version }}" - -- name: "uninstall sapp and tcpdump_mesa" - yum: - name: "{{ item.key }}" - state: absent - with_dict: "{{ sapp_rpm_version }}" - -#- name: "uninstall tfe" -# yum: -# name: "{{ item.value }}" -# state: absent -# with_dict: "{{ tfe_rpm_version }}" - -- name: "uninstall app_skecth_local" - yum: - name: "{{ item.key }}" - state: absent - with_dict: "{{ tsg_app_rpm_version }}" - -#- name: "uninstall tsg-diagnose" -# yum: -# name: "{{ item.value }}" -# state: absent -# with_dict: "{{ tsg_diagnose_rpm_version }}" - -- name: "uninstall http_healthcheck" - yum: - name: "{{ item.key }}" - state: absent - with_dict: "{{ http_healthcheck_rpm_version }}" - -- name: "uninstall wannat wangw" - yum: - name: "{{ item.key }}" - state: absent - with_dict: "{{ wannat_wangw_rpm_version }}" - -- name: "uninstall wire_graft" - yum: - name: "{{ item.key }}" - state: absent - with_dict: "{{ wire_graft_rpm_version }}" - -- name: "uninstall hasp_tools" - yum: - name: "{{ item.key }}" - state: absent - with_dict: "{{ hasp_tools_rpm_version }}" diff --git a/ansible/roles/sapp/tasks/main.yml b/ansible/roles/sapp/tasks/main.yml index 72e0c135..f7f2791c 100644 --- a/ansible/roles/sapp/tasks/main.yml +++ b/ansible/roles/sapp/tasks/main.yml @@ -98,14 +98,6 @@ dest: /opt/tsg/sapp/etc/necessary_plug_list.conf tags: template -- name: Template the vlan_flipping_map.conf - tsg-9140 - template: - src: "{{ role_path }}/templates/vlan_flipping_map.conf.j2.9000NPBP01R01" - dest: /opt/tsg/sapp/etc/vlan_flipping_map.conf - tags: template - when: - - runtime_env == 'TSG-9140' - - name: Template the vlan_flipping_map.conf - tsg-7400 template: src: "{{ role_path }}/templates/vlan_flipping_map.conf.j2.j2.7400MCN0P01R01" diff --git a/ansible/roles/sapp/templates/vlan_flipping_map.conf.j2.9000NPBP01R01 b/ansible/roles/sapp/templates/vlan_flipping_map.conf.j2.9000NPBP01R01 deleted file mode 100644 index bb4e2eff..00000000 --- a/ansible/roles/sapp/templates/vlan_flipping_map.conf.j2.9000NPBP01R01 +++ /dev/null @@ -1,10 +0,0 @@ -#for inline a device vlan flipping -#数据包来自C路由器端, 即C2I(I2E)方向, -#数据包来自I路由器端, 即I2C(E2I)方向, -#平台会根据vlan_id,设置当前包route_dir的值, 以便上层业务插件做两个方向的流量统计, -#如果一对vlan_id写反了, 网络是通的, 但是I2E,E2I的流量统计就颠倒了. -#配置文件格式, pattern: -#来自C路由器vlan_id 来自I路由器vlan_id 是否开启mac地址翻转 -#C_router_vlan_id I_router_vlan_id mac_flipping_enable -4000 4001 0 - diff --git a/ansible/roles/system-init-9140/tasks/main.yml b/ansible/roles/system-init-9140/tasks/main.yml deleted file mode 100644 index f854b864..00000000 --- a/ansible/roles/system-init-9140/tasks/main.yml +++ /dev/null @@ -1,270 +0,0 @@ ---- -- name: "set 90-9000NPBP01R01.rules" - template: - src: "{{ role_path }}/templates/90-9000NPBP01R01.rules.j2" - dest: /usr/lib/udev/rules.d/90-9000NPBP01R01.rules - mode: 0644 - tags: template - -- name: "set eth_pf_smbio cfg" - template: - src: "{{ role_path }}/templates/ifcfg-eth_pf_smbio.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_pf_smbio - tags: template - -- name: "set eth_vf_raw cfg" - template: - src: "{{ role_path }}/templates/ifcfg-eth_vf_raw.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_vf_raw - tags: template - -- name: "set eth_vf_dign_c cfg" - template: - src: "{{ role_path }}/templates/ifcfg-eth_vf_dign_c.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_vf_dign_c - tags: template - -- name: "set eth_vf_dign_s cfg" - template: - src: "{{ role_path }}/templates/ifcfg-eth_vf_dign_s.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_vf_dign_s - tags: template - -- name: "set set-eth_vf_raw-macaddr.sh" - template: - src: "{{ role_path }}/templates/set-eth_vf_raw-macaddr.sh.toml.j2" - dest: /usr/bin/set-eth_vf_raw-macaddr.sh - mode: 0777 - tags: template - -- name: "set eth_pf_smbcx cfg " - template: - src: "{{ role_path }}/templates/ifcfg-eth_pf_smbcx.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_pf_smbcx - tags: template - -- name: "set eth_vf_kni cfg" - template: - src: "{{ role_path }}/templates/ifcfg-eth_vf_kni.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_vf_kni - tags: template - -- name: "set eth_vf_tfe cfg" - template: - src: "{{ role_path }}/templates/ifcfg-eth_vf_tfe.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_vf_tfe - tags: template - -- name: "set eth_vf_mirr cfg" - template: - src: "{{ role_path }}/templates/ifcfg-eth_vf_mirr.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_vf_mirr - tags: template - -- name: "set eth_vf_ctl cfg" - template: - src: "{{ role_path }}/templates/ifcfg-eth_vf_ctl.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_vf_ctl - tags: template - -- name: "set if-pre-up " - template: - src: "{{ role_path }}/templates/if-pre-up.toml.j2" - dest: /etc/NetworkManager/dispatcher.d/pre-up.d/if-pre-up - mode: 0755 - tags: template - -- name: "copy eth_pf_mgmt0.ips cfg" - template: - src: "{{ role_path }}/templates/setup.eth_pf_mgmt0.ips.toml.j2" - dest: /sbin/setup.eth_pf_mgmt0.ips - mode: 0777 - tags: template - -- name: "copy eth_pf_mgmt1.ips cfg" - template: - src: "{{ role_path }}/templates/setup.eth_pf_mgmt1.ips.toml.j2" - dest: /sbin/setup.eth_pf_mgmt1.ips - mode: 0777 - tags: template - -- name: "copy setup.eth_vf_tfe.ips" - template: - src: "{{ role_path }}/templates/setup.eth_vf_tfe.ips.toml.j2" - dest: /sbin/setup.eth_vf_tfe.ips - mode: 0777 - tags: template - -- name: "set eth_pf_xe0 cfg " - template: - src: "{{ role_path }}/templates/ifcfg-eth_pf_xe0.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_pf_xe0 - tags: template - -- name: "set eth_pf_xe1 cfg " - template: - src: "{{ role_path }}/templates/ifcfg-eth_pf_xe1.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_pf_xe1 - tags: template - -- name: "set eth_pf_mgmt0 cfg " - template: - src: "{{ role_path }}/templates/ifcfg-eth_pf_mgmt0.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_pf_mgmt0 - tags: template - -- name: "set eth_pf_mgmt1 cfg " - template: - src: "{{ role_path }}/templates/ifcfg-eth_pf_mgmt1.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_pf_mgmt1 - tags: template - -- name: "set eth_pf_ge0 cfg " - template: - src: "{{ role_path }}/templates/ifcfg-eth_pf_ge0.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_pf_ge0 - tags: template - -- name: "set eth_pf_ge1 up " - template: - src: "{{ role_path }}/templates/ifcfg-eth_pf_ge1.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-eth_pf_ge1 - tags: template - -# systemctl set-property user.slice CPUShares=1500 MemoryLimit=13G -# systemctl set-property system.slice CPUShares=1000 MemoryLimit=13G -# systemctl set-property workload.slice CPUShares=7500 MemoryLimit=100G - -# workload.slice -- name: "Create /usr/lib/systemd/system/workload.slice.d/ directory if it does not exist" - file: - path: "{{ item }}" - state: directory - mode: '0755' - with_items: - - /usr/lib/systemd/system/workload.slice.d/ - -- name: "copy 50-CPUShares.conf to workload.slice.d" - copy: - src: "{{ role_path }}/templates/override_workload_slice_cpu.conf.j2" - dest: /usr/lib/systemd/system/workload.slice.d/50-CPUShares.conf - mode: 0644 - -- name: "copy 50-MemoryLimit.conf to workload.slice.d" - copy: - src: "{{ role_path }}/templates/override_workload_slice_mem.conf.j2" - dest: /usr/lib/systemd/system/workload.slice.d/50-MemoryLimit.conf - mode: 0644 - -# user.slice -- name: "Create /usr/lib/systemd/system/user.slice.d/ directory if it does not exist" - file: - path: "{{ item }}" - state: directory - mode: '0755' - with_items: - - /usr/lib/systemd/system/user.slice.d/ - -- name: "copy 50-CPUShares.conf to user.slice.d" - copy: - src: "{{ role_path }}/templates/override_user_slice_cpu.conf.j2" - dest: /usr/lib/systemd/system/user.slice.d/50-CPUShares.conf - mode: 0644 - -- name: "copy 50-MemoryLimit.conf to user.slice.d" - copy: - src: "{{ role_path }}/templates/override_user_slice_mem.conf.j2" - dest: /usr/lib/systemd/system/user.slice.d/50-MemoryLimit.conf - mode: 0644 - -# system.slice -- name: "Create /usr/lib/systemd/system/system.slice.d/ directory if it does not exist" - file: - path: "{{ item }}" - state: directory - mode: '0755' - with_items: - - /usr/lib/systemd/system/system.slice.d/ - -- name: "copy 50-CPUShares.conf to system.slice.d" - copy: - src: "{{ role_path }}/templates/override_system_slice_cpu.conf.j2" - dest: /usr/lib/systemd/system/system.slice.d/50-CPUShares.conf - mode: 0644 - -- name: "copy 50-MemoryLimit.conf to system.slice.d" - copy: - src: "{{ role_path }}/templates/override_system_slice_mem.conf.j2" - dest: /usr/lib/systemd/system/system.slice.d/50-MemoryLimit.conf - mode: 0644 - -# 启用 IPMI -- name: "copy ipmi.conf to /etc/sysconfig/ipmi" - copy: - src: "{{ role_path }}/templates/ipmi.conf.j2" - dest: /etc/sysconfig/ipmi - mode: 0644 - -- name: "enable ipmi" - systemd: - name: ipmi - enabled: yes - -# 启用 Watchdog -- name: "copy watchdog.conf to /etc/watchdog.conf" - copy: - src: "{{ role_path }}/templates/watchdog.conf.j2" - dest: /etc/watchdog.conf - mode: 0644 - -- name: "enable watchdog" - systemd: - name: watchdog - enabled: yes - -- name: "enable irqbalance" - systemd: - name: irqbalance - enabled: yes - -# 关闭DHCPDISCOVER -- name: "set 90-9000-dracut.rules" - template: - src: "{{ role_path }}/templates/90-9000-dracut.rules.j2" - dest: /usr/lib/dracut/dracut.conf.d/90-9000-dracut.conf - mode: 0644 - tags: template - -# poweroff guard -- name: "templates poweroff-guard.service.j2" - template: - src: "{{role_path}}/templates/poweroff-guard.service.j2" - dest: /usr/lib/systemd/system/poweroff-guard.service - tags: template - -- name: "templates start-poweroff-guard.service.j2" - template: - src: "{{role_path}}/templates/start-poweroff-guard.service.j2" - dest: /usr/lib/systemd/system/start-poweroff-guard.service - tags: template - -- name: 'poweroff-guard service start' - systemd: - name: poweroff-guard - enabled: yes - -- name: 'start-poweroff-guard service start' - systemd: - name: start-poweroff-guard - enabled: yes -#Set CPU frequency scaling -- name: "copy cpupower.j2 to /etc/sysconfig/cpupower" - copy: - src: "{{ role_path }}/templates/cpupower.j2" - dest: /etc/sysconfig/cpupower - mode: 0644 - -- name: "enable cpupower" - systemd: - name: cpupower - enabled: yes
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/90-9000NPBP01R01.rules.j2 b/ansible/roles/system-init-9140/templates/90-9000NPBP01R01.rules.j2 deleted file mode 100644 index 13011c90..00000000 --- a/ansible/roles/system-init-9140/templates/90-9000NPBP01R01.rules.j2 +++ /dev/null @@ -1,65 +0,0 @@ -# rename enp1s0 to eth_pf_smbio -# rename enp1s2 to eth_vf_raw -# rename enp1s2f1 to eth_vf_dign_c -# rename enp1s2f2 to eth_vf_dign_s -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:00.0", NAME:="eth_pf_smbio" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:00.0",ATTR{device/sriov_numvfs}="3" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.0", NAME:="eth_vf_raw" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.1", NAME:="eth_vf_dign_c" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.2", NAME:="eth_vf_dign_s" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:00.0",ATTR{device/sriov/0/trunk}="add 0,4000,4001" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:00.0",RUN+="/usr/bin/set-eth_vf_raw-macaddr.sh" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbio vf 1 vlan 4000" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.2",PROGRAM+="/usr/sbin/ip link set eth_pf_smbio vf 2 vlan 4001" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbio vf 0 trust on" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbio vf 1 trust on" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.2",PROGRAM+="/usr/sbin/ip link set eth_pf_smbio vf 2 trust on" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbio vf 0 spoofchk off" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbio vf 0 state enable" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbio vf 1 state enable" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:01:02.2",PROGRAM+="/usr/sbin/ip link set eth_pf_smbio vf 2 state enable" - -# rename enp130s0 to eth_pf_smbcx -# rename enp130s2 to eth_vf_kni -# rename enp130s2f1 to eth_vf_tfe -# rename enp130s2f2 to eth_vf_mirr -# rename enp130s2f3 to eth_vf_ctl -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0", NAME:="eth_pf_smbcx" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0",ATTR{device/sriov_numvfs}="4" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0",ATTR{/device/sriov/0/max_tx_rate}="10240" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0",ATTR{/device/sriov/1/max_tx_rate}="10240" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0",ATTR{/device/sriov/2/max_tx_rate}="10240" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0",ATTR{/device/sriov/3/max_tx_rate}="10240" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.0", NAME:="eth_vf_kni" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.1", NAME:="eth_vf_tfe" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.2", NAME:="eth_vf_mirr" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.3", NAME:="eth_vf_ctl" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:00.0",ATTR{device/sriov/2/trunk}="add 2-66,1025-1089" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 0 vlan 4095" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 1 vlan 4095" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.3",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 3 vlan 3817" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 0 trust on" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 1 trust on" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.2",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 2 trust on" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.3",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 3 trust on" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 0 mac 00:0e:c6:d6:72:c1" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 1 mac fe:65:b7:03:50:bd" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.0",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 0 state enable" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.1",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 1 state enable" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.2",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 2 state enable" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.3",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 3 state enable" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:82:02.2",PROGRAM+="/usr/sbin/ip link set eth_pf_smbcx vf 2 spoofchk off" - -# rename enp131s0f0 to eth_pf_mgmt0 -# rename enp131s0f1 to eth_pf_mgmt1 -# rename enp131s0f2 to eth_pf_ge0 -# rename enp131s0f3 to eth_pf_ge1 -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:83:00.0", NAME:="eth_pf_mgmt0" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:83:00.1", NAME:="eth_pf_mgmt1" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:83:00.2", NAME:="eth_pf_ge0" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:83:00.3", NAME:="eth_pf_ge1" - -# rename enp5s0f0 to eth_pf_xe0 -# rename enp5s0f1 to eth_pf_xe1 -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.0", NAME:="eth_pf_xe0" -ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.1", NAME:="eth_pf_xe1"
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/README.md b/ansible/roles/system-init-9140/templates/README.md deleted file mode 100644 index 9af2572c..00000000 --- a/ansible/roles/system-init-9140/templates/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# TSG-9140设备网卡固化列表 - -| 序号 | 原网卡名 | bus-info | 固化网卡名 | 用途 | -| --- | --- | --- | --- | --- | -| 1 | enp1s0 | 0000:01:00.0 | eth_pf_smbio | 与OS3300连接的X710网卡 | -| 2 | enp1s2 | 0000:01:02.0 | eth_vf_raw | 从交换板上获取/转发原始流量 | -| 3 | enp1s2f1 | 0000:01:02.1 | eth_vf_dign_c | 数据面自检模拟客户端 | -| 4 | enp1s2f2 | 0000:01:02.2 | eth_vf_dign_s | 数据面自检模拟服务器 | -| 5 | enp130s0 | 0000:82:00.0 | eth_pf_smbcx | 与OS3200连接的X710网卡 | -| 6 | enp130s2 | 0000:82:02.0 | eth_vf_kni | kni向tfe发送流量的网卡 | -| 7 | enp130s2f1 | 0000:82:02.1 | eth_vf_tfe | tfe向kni发送流量的网卡 | -| 8 | enp130s2f2 | 0000:82:02.2 | eth_vf_mirr | 解密流量转发 | -| 9 | enp130s2f3 | 0000:82:02.3 | eth_vf_ctl | 策略与日志 | -| 10 | enp131s0f0 | 0000:83:00.0 | eth_pf_mgmt0 | 与OS3300连接的base管理网卡 | -| 11 | enp131s0f1 | 0000:83:00.1 | eth_pf_mgmt1 | 与OS3200连接的base管理网卡(暂未使用) | -| 12 | enp131s0f2 | 0000:83:00.2 | eth_pf_ge0 | 前面板的GE电口(预留) | -| 13 | enp131s0f3 | 0000:83:00.3 | eth_pf_ge1 | 前面板的GE电口(预留) | -| 14 | enp5s0f0 | 0000:05:00.0 | eth_pf_xe0 | 前面板的10GE光口(预留) | -| 15 | enp5s0f1 | 0000:05:00.1 | eth_pf_xe0 | 前面板的10GE光口(预留) | diff --git a/ansible/roles/system-init-9140/templates/cpupower.j2 b/ansible/roles/system-init-9140/templates/cpupower.j2 deleted file mode 100644 index 7dcc1ad1..00000000 --- a/ansible/roles/system-init-9140/templates/cpupower.j2 +++ /dev/null @@ -1,3 +0,0 @@ -# See 'cpupower help' and cpupower(1) for more info -CPUPOWER_START_OPTS="frequency-set -g performance" -CPUPOWER_STOP_OPTS="frequency-set -g powersave"
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/if-pre-up.toml.j2 b/ansible/roles/system-init-9140/templates/if-pre-up.toml.j2 deleted file mode 100644 index 6dce8c0c..00000000 --- a/ansible/roles/system-init-9140/templates/if-pre-up.toml.j2 +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -INF="$1" -STA="$2" -if [ "$STA" == "pre-up" ] -then - logger "$0 called for interface named $INF with $STA ..." - case "$INF" in - eth_pf_mgmt0) logger "Setting $STA $INF ipaddr ..."; /sbin/setup.eth_pf_mgmt0.ips $INF $STA;; - eth_pf_mgmt1) logger "Setting $STA $INF ipaddr ..."; /sbin/setup.eth_pf_mgmt1.ips $INF $STA;; - eth_vf_tfe) logger "Setting $STA $INF RPS ..."; /sbin/setup.eth_vf_tfe.ips $INF $STA;; - esac -fi -exit 0 diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_dign_c.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_dign_c.toml.j2 deleted file mode 100644 index 2298b881..00000000 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_dign_c.toml.j2 +++ /dev/null @@ -1,14 +0,0 @@ -TYPE=Ethernet -PROXY_METHOD=none -BROWSER_ONLY=no -BOOTPROTO=none -DEFROUTE=no -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=no -IPV6_DEFROUTE=no -IPV6_FAILURE_FATAL=no -IPV6_ADDR_GEN_MODE=stable-privacy -NAME=eth_vf_dign_c -DEVICE=eth_vf_dign_c -ONBOOT=yes
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_dign_s.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_dign_s.toml.j2 deleted file mode 100644 index 616e9902..00000000 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_dign_s.toml.j2 +++ /dev/null @@ -1,14 +0,0 @@ -TYPE=Ethernet -PROXY_METHOD=none -BROWSER_ONLY=no -BOOTPROTO=none -DEFROUTE=no -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=no -IPV6_DEFROUTE=no -IPV6_FAILURE_FATAL=no -IPV6_ADDR_GEN_MODE=stable-privacy -NAME=eth_vf_dign_s -DEVICE=eth_vf_dign_s -ONBOOT=yes
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_kni.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_kni.toml.j2 deleted file mode 100644 index 551b48d1..00000000 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_kni.toml.j2 +++ /dev/null @@ -1,14 +0,0 @@ -TYPE=Ethernet -PROXY_METHOD=none -BROWSER_ONLY=no -BOOTPROTO=none -DEFROUTE=no -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=no -IPV6_DEFROUTE=no -IPV6_FAILURE_FATAL=no -IPV6_ADDR_GEN_MODE=stable-privacy -NAME=eth_vf_kni -DEVICE=eth_vf_kni -ONBOOT=yes
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_raw.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_raw.toml.j2 deleted file mode 100644 index abb32da9..00000000 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_raw.toml.j2 +++ /dev/null @@ -1,14 +0,0 @@ -TYPE=Ethernet -PROXY_METHOD=none -BROWSER_ONLY=no -BOOTPROTO=none -DEFROUTE=no -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=no -IPV6_DEFROUTE=no -IPV6_FAILURE_FATAL=no -IPV6_ADDR_GEN_MODE=stable-privacy -NAME=eth_vf_raw -DEVICE=eth_vf_raw -ONBOOT=yes
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_tfe.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_tfe.toml.j2 deleted file mode 100644 index f3ca5e74..00000000 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_vf_tfe.toml.j2 +++ /dev/null @@ -1,14 +0,0 @@ -TYPE=Ethernet -PROXY_METHOD=none -BROWSER_ONLY=no -BOOTPROTO=none -DEFROUTE=no -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=no -IPV6_DEFROUTE=no -IPV6_FAILURE_FATAL=no -IPV6_ADDR_GEN_MODE=stable-privacy -NAME=eth_vf_tfe -DEVICE=eth_vf_tfe -ONBOOT=yes
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/ipmi.conf.j2 b/ansible/roles/system-init-9140/templates/ipmi.conf.j2 deleted file mode 100644 index 5634fb41..00000000 --- a/ansible/roles/system-init-9140/templates/ipmi.conf.j2 +++ /dev/null @@ -1,69 +0,0 @@ -## Path: Hardware/IPMI -## Description: Enable standard hardware interfaces (KCS, BT, SMIC) -## Type: yesno -## Default: "yes" -## Config: ipmi -# Enable standard hardware interfaces (KCS, BT, SMIC) -# You probably want this enabled. -# IPMI_SI disabled by OpenIPMI-modalias rpm scriplet -IPMI_SI=no - -## Path: Hardware/IPMI -## Description: Enable /dev/ipmi0 interface, used by ipmitool, ipmicmd, -## Type: yesno -## Default: "yes" -## Config: ipmi -# Enable /dev/ipmi0 interface, used by ipmitool, ipmicmd, -# and other userspace IPMI-using applications. -# You probably want this enabled. -DEV_IPMI=yes - -## Path: Hardware/IPMI -## Description: Enable IPMI_WATCHDOG if you want the IPMI watchdog -## Type: yesno -## Default: "no" -## Config: ipmi -# Enable IPMI_WATCHDOG if you want the IPMI watchdog -# to reboot the system if it hangs -IPMI_WATCHDOG=yes - -## Path: Hardware/IPMI -## Description: Watchdog options - modinfo ipmi_watchdog for details -## Type: string -## Default: "timeout=60" -## Config: ipmi -# Watchdog options - modinfo ipmi_watchdog for details -# watchdog timeout value in seconds -# as there is no userspace ping application that runs during shutdown, -# be sure to give it enough time for any device drivers to -# do their cleanup (e.g. megaraid cache flushes) -# without the watchdog triggering prematurely -IPMI_WATCHDOG_OPTIONS="timeout=600 action=reset" - -## Path: Hardware/IPMI -## Description: Enable IPMI_POWEROFF if you want the IPMI poweroff module to be loaded. -## Type: yesno -## Default: "no" -## Config: ipmi -# Enable IPMI_POWEROFF if you want the IPMI -# poweroff module to be loaded. -IPMI_POWEROFF=no - -## Path: Hardware/IPMI -## Description: Enable IPMI_POWERCYCLE if you want the system to be power-cycled on reboot -## Type: yesno -## Default: "no" -## Config: ipmi -# Enable IPMI_POWERCYCLE if you want the system to be power-cycled (power -# down, delay briefly, power on) rather than power off, on systems -# that support such. IPMI_POWEROFF=yes is also required. -IPMI_POWERCYCLE=no - -## Path: Hardware/IPMI -## Description: Enable "legacy" interfaces for applications -## Type: yesno -## Default: "no" -## Config: ipmi -# Enable "legacy" interfaces for applications -# Intel IMB driver interface -IPMI_IMB=no diff --git a/ansible/roles/system-init-9140/templates/override_system_slice_cpu.conf.j2 b/ansible/roles/system-init-9140/templates/override_system_slice_cpu.conf.j2 deleted file mode 100644 index f28071c2..00000000 --- a/ansible/roles/system-init-9140/templates/override_system_slice_cpu.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -CPUShares=1000 diff --git a/ansible/roles/system-init-9140/templates/override_system_slice_mem.conf.j2 b/ansible/roles/system-init-9140/templates/override_system_slice_mem.conf.j2 deleted file mode 100644 index 38c3bf72..00000000 --- a/ansible/roles/system-init-9140/templates/override_system_slice_mem.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -MemoryLimit=13G diff --git a/ansible/roles/system-init-9140/templates/override_user_slice_cpu.conf.j2 b/ansible/roles/system-init-9140/templates/override_user_slice_cpu.conf.j2 deleted file mode 100644 index bca6bd76..00000000 --- a/ansible/roles/system-init-9140/templates/override_user_slice_cpu.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -CPUShares=1500 diff --git a/ansible/roles/system-init-9140/templates/override_user_slice_mem.conf.j2 b/ansible/roles/system-init-9140/templates/override_user_slice_mem.conf.j2 deleted file mode 100644 index 38c3bf72..00000000 --- a/ansible/roles/system-init-9140/templates/override_user_slice_mem.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -MemoryLimit=13G diff --git a/ansible/roles/system-init-9140/templates/override_workload_slice_cpu.conf.j2 b/ansible/roles/system-init-9140/templates/override_workload_slice_cpu.conf.j2 deleted file mode 100644 index 0ad6b44b..00000000 --- a/ansible/roles/system-init-9140/templates/override_workload_slice_cpu.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -CPUShares=7500 diff --git a/ansible/roles/system-init-9140/templates/override_workload_slice_mem.conf.j2 b/ansible/roles/system-init-9140/templates/override_workload_slice_mem.conf.j2 deleted file mode 100644 index 4d9ac358..00000000 --- a/ansible/roles/system-init-9140/templates/override_workload_slice_mem.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -MemoryLimit=100G diff --git a/ansible/roles/system-init-9140/templates/set-eth_vf_raw-macaddr.sh.toml.j2 b/ansible/roles/system-init-9140/templates/set-eth_vf_raw-macaddr.sh.toml.j2 deleted file mode 100644 index cbc107e9..00000000 --- a/ansible/roles/system-init-9140/templates/set-eth_vf_raw-macaddr.sh.toml.j2 +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -echo -------------------- set eth_vf_raw macaddr -------------------- -output=$(ipmitool picmg addrinfo) -echo $output -substr=${output:21:2} -echo deviceid:$substr -macaddr='90:00:00:91:40:'$substr -echo eth_vf_raw macaddr:$macaddr -echo $macaddr > /sys/class/net/eth_pf_smbio/device/sriov/0/mac
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt0.ips.toml.j2 b/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt0.ips.toml.j2 deleted file mode 100644 index 1283ad96..00000000 --- a/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt0.ips.toml.j2 +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -INF="$1" -STA="$2" - -logger "$0 called for interface named $INF with $STA ..." - -if [ "$INF" == "eth_pf_mgmt0" ] -then - logger "$0: Interface $INF with $STA ,Set $INF ipaddr ..." - output=$(ipmitool picmg addrinfo) - echo $output - substr=${output:22:1} - echo $substr - num=$((16#${substr}+16)) - ipaddr='10.254.'$num'.1' - ifconfig eth_pf_mgmt0 $ipaddr netmask 255.255.0.0 -fi
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt1.ips.toml.j2 b/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt1.ips.toml.j2 deleted file mode 100644 index 7629a413..00000000 --- a/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt1.ips.toml.j2 +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -INF="$1" -STA="$2" - -logger "$0 called for interface named $INF with $STA ..." - -if [ "$INF" == "eth_pf_mgmt1" ] -then - logger "$0: Interface $INF with $STA ,Set $INF ipaddr ..." - output=$(ipmitool picmg addrinfo) - echo $output - substr=${output:22:1} - echo $substr - num=$((16#${substr}+16)) - ipaddr='10.253.'$num'.1' - ifconfig eth_pf_mgmt1 $ipaddr netmask 255.255.0.0 -fi
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/setup.eth_vf_tfe.ips.toml.j2 b/ansible/roles/system-init-9140/templates/setup.eth_vf_tfe.ips.toml.j2 deleted file mode 100644 index c3d4c19b..00000000 --- a/ansible/roles/system-init-9140/templates/setup.eth_vf_tfe.ips.toml.j2 +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -INF="$1" -STA="$2" - -if [ "$INF" == "eth_vf_tfe" ] -then - logger "$0: Interface $INF with $STA ,Set $INF RPS ..." - echo ff0000,00000000 > /sys/class/net/eth_vf_tfe/queues/rx-0/rps_cpus - echo ff0000,00000000 > /sys/class/net/eth_vf_tfe/queues/rx-1/rps_cpus - echo ff0000,00000000 > /sys/class/net/eth_vf_tfe/queues/rx-2/rps_cpus - echo ff0000,00000000 > /sys/class/net/eth_vf_tfe/queues/rx-3/rps_cpus -fi
\ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/watchdog.conf.j2 b/ansible/roles/system-init-9140/templates/watchdog.conf.j2 deleted file mode 100644 index 978c9ed3..00000000 --- a/ansible/roles/system-init-9140/templates/watchdog.conf.j2 +++ /dev/null @@ -1,51 +0,0 @@ -#ping = 172.31.14.1 -#ping = 172.26.1.255 -#interface = eth0 -#file = /var/log/messages -#change = 1407 - -# Uncomment to enable test. Setting one of these values to '0' disables it. -# These values will hopefully never reboot your machine during normal use -# (if your machine is really hung, the loadavg will go much higher than 25) -#max-load-1 = 24 -#max-load-5 = 18 -#max-load-15 = 12 - -# Note that this is the number of pages! -# To get the real size, check how large the pagesize is on your machine. -#min-memory = 1 - -# With enforcing SELinux policy please use the /usr/libexec/watchdog/scripts/ -# or /etc/watchdog.d/ for your test-binary and repair-binary configuration. -#repair-binary = /usr/sbin/repair -#repair-timeout = -#test-binary = -#test-timeout = - -watchdog-device = /dev/watchdog - -# Defaults compiled into the binary -#temperature-device = -#max-temperature = 120 - -# Defaults compiled into the binary -#admin = root -interval = 20 -#logtick = 1 -#log-dir = /var/log/watchdog - -# This greatly decreases the chance that watchdog won't be scheduled before -# your machine is really loaded -realtime = yes -priority = 1 - -# When using custom service pid check with custom service -# systemd unit file please be aware the "Requires=" -# does dependent service deactivation. -# Using "Before=watchdog.service" or "Before=watchdog-ping.service" -# in the custom service unit file may be the desired operation instead. -# See man 5 systemd.unit for more details. -# -# Check if rsyslogd is still running by enabling the following line -#pidfile = /var/run/rsyslogd.pid - diff --git a/ansible/roles/system-init-P0906/tasks/main.yml b/ansible/roles/system-init-P0906/tasks/main.yml index cce6393c..da4825c1 100644 --- a/ansible/roles/system-init-P0906/tasks/main.yml +++ b/ansible/roles/system-init-P0906/tasks/main.yml @@ -3,78 +3,6 @@ # systemctl set-property system.slice CPUShares=1000 MemoryLimit=13G # systemctl set-property workload.slice CPUShares=7500 MemoryLimit=100G -# workload.slice -- name: "Create /usr/lib/systemd/system/workload.slice.d/ directory if it does not exist" - file: - path: "{{ item }}" - state: directory - mode: '0755' - with_items: - - /usr/lib/systemd/system/workload.slice.d/ - when: runtime_env != 'TSG-X-P0906' - -- name: "copy 50-CPUShares.conf to workload.slice.d" - copy: - src: "{{ role_path }}/templates/override_workload_slice_cpu.conf.j2" - dest: /usr/lib/systemd/system/workload.slice.d/50-CPUShares.conf - mode: 0644 - when: runtime_env != 'TSG-X-P0906' - -- name: "copy 50-MemoryLimit.conf to workload.slice.d" - copy: - src: "{{ role_path }}/templates/override_workload_slice_mem.conf.j2" - dest: /usr/lib/systemd/system/workload.slice.d/50-MemoryLimit.conf - mode: 0644 - when: runtime_env != 'TSG-X-P0906' - -# user.slice -- name: "Create /usr/lib/systemd/system/user.slice.d/ directory if it does not exist" - file: - path: "{{ item }}" - state: directory - mode: '0755' - with_items: - - /usr/lib/systemd/system/user.slice.d/ - when: runtime_env != 'TSG-X-P0906' - -- name: "copy 50-CPUShares.conf to user.slice.d" - copy: - src: "{{ role_path }}/templates/override_user_slice_cpu.conf.j2" - dest: /usr/lib/systemd/system/user.slice.d/50-CPUShares.conf - mode: 0644 - when: runtime_env != 'TSG-X-P0906' - -- name: "copy 50-MemoryLimit.conf to user.slice.d" - copy: - src: "{{ role_path }}/templates/override_user_slice_mem.conf.j2" - dest: /usr/lib/systemd/system/user.slice.d/50-MemoryLimit.conf - mode: 0644 - when: runtime_env != 'TSG-X-P0906' - -# system.slice -- name: "Create /usr/lib/systemd/system/system.slice.d/ directory if it does not exist" - file: - path: "{{ item }}" - state: directory - mode: '0755' - with_items: - - /usr/lib/systemd/system/system.slice.d/ - when: runtime_env != 'TSG-X-P0906' - -- name: "copy 50-CPUShares.conf to system.slice.d" - copy: - src: "{{ role_path }}/templates/override_system_slice_cpu.conf.j2" - dest: /usr/lib/systemd/system/system.slice.d/50-CPUShares.conf - mode: 0644 - when: runtime_env != 'TSG-X-P0906' - -- name: "copy 50-MemoryLimit.conf to system.slice.d" - copy: - src: "{{ role_path }}/templates/override_system_slice_mem.conf.j2" - dest: /usr/lib/systemd/system/system.slice.d/50-MemoryLimit.conf - mode: 0644 - when: runtime_env != 'TSG-X-P0906' - # 启用 IPMI - name: "copy ipmi.conf to /etc/sysconfig/ipmi" copy: @@ -149,17 +77,14 @@ mode: '0755' with_items: - /usr/lib/systemd/system/[email protected]/ - when: runtime_env == 'TSG-X-P0906' - name: "copy service_override_RuntimeMaxSec.conf to dest" copy: src: "{{ role_path }}/templates/service_override_RuntimeMaxSec.conf" dest: /usr/lib/systemd/system/[email protected]/service_override_RuntimeMaxSec.conf mode: 0644 - when: runtime_env == 'TSG-X-P0906' - name: "disable sssd" systemd: name: sssd enabled: no - when: runtime_env == 'TSG-X-P0906' diff --git a/ansible/roles/system-init-P0906/templates/override_system_slice_cpu.conf.j2 b/ansible/roles/system-init-P0906/templates/override_system_slice_cpu.conf.j2 deleted file mode 100644 index f28071c2..00000000 --- a/ansible/roles/system-init-P0906/templates/override_system_slice_cpu.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -CPUShares=1000 diff --git a/ansible/roles/system-init-P0906/templates/override_system_slice_mem.conf.j2 b/ansible/roles/system-init-P0906/templates/override_system_slice_mem.conf.j2 deleted file mode 100644 index 38c3bf72..00000000 --- a/ansible/roles/system-init-P0906/templates/override_system_slice_mem.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -MemoryLimit=13G diff --git a/ansible/roles/system-init-P0906/templates/override_user_slice_cpu.conf.j2 b/ansible/roles/system-init-P0906/templates/override_user_slice_cpu.conf.j2 deleted file mode 100644 index bca6bd76..00000000 --- a/ansible/roles/system-init-P0906/templates/override_user_slice_cpu.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -CPUShares=1500 diff --git a/ansible/roles/system-init-P0906/templates/override_user_slice_mem.conf.j2 b/ansible/roles/system-init-P0906/templates/override_user_slice_mem.conf.j2 deleted file mode 100644 index 38c3bf72..00000000 --- a/ansible/roles/system-init-P0906/templates/override_user_slice_mem.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -MemoryLimit=13G diff --git a/ansible/roles/system-init-P0906/templates/override_workload_slice_cpu.conf.j2 b/ansible/roles/system-init-P0906/templates/override_workload_slice_cpu.conf.j2 deleted file mode 100644 index 0ad6b44b..00000000 --- a/ansible/roles/system-init-P0906/templates/override_workload_slice_cpu.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -CPUShares=7500 diff --git a/ansible/roles/system-init-P0906/templates/override_workload_slice_mem.conf.j2 b/ansible/roles/system-init-P0906/templates/override_workload_slice_mem.conf.j2 deleted file mode 100644 index 4d9ac358..00000000 --- a/ansible/roles/system-init-P0906/templates/override_workload_slice_mem.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Slice] -MemoryLimit=100G diff --git a/ansible/roles/telegraf_statistic/tasks/main.yml b/ansible/roles/telegraf_statistic/tasks/main.yml index 0ea65db1..1cb44832 100644 --- a/ansible/roles/telegraf_statistic/tasks/main.yml +++ b/ansible/roles/telegraf_statistic/tasks/main.yml @@ -43,6 +43,7 @@ src: "{{ role_path }}/files/telegraf_statistic.service" dest: /usr/lib/systemd/system mode: 0644 + when: runtime_env != 'TSG-X-P0906' # - name: "copy telegraf_shaping.service to destination server" # copy: @@ -55,12 +56,14 @@ src: "{{ role_path }}/files/telegraf_security.service" dest: /usr/lib/systemd/system mode: 0644 + when: runtime_env != 'TSG-X-P0906' - name: "copy telegraf_proxy.service to destination server" copy: src: "{{ role_path }}/files/telegraf_proxy.service" dest: /usr/lib/systemd/system mode: 0644 + when: runtime_env != 'TSG-X-P0906' - name: "Create /usr/lib/systemd/system/telegraf_statistic.service.d/ and /usr/lib/systemd/system/telegraf_shaping.service.d directory if it does not exist" file: @@ -72,6 +75,7 @@ - /usr/lib/systemd/system/telegraf_security.service.d - /usr/lib/systemd/system/telegraf_proxy.service.d # - /usr/lib/systemd/system/telegraf_shaping.service.d + when: runtime_env != 'TSG-X-P0906' - name: "copy slice file to telegraf_statistic.service.d" copy: @@ -103,11 +107,13 @@ systemd: name: telegraf.service enabled: no + when: runtime_env != 'TSG-X-P0906' - name: "Start telegraf_statistic" systemd: name: telegraf_statistic.service enabled: yes + when: runtime_env != 'TSG-X-P0906' # - name: "Start telegraf_shaping" # systemd: @@ -117,8 +123,10 @@ systemd: name: telegraf_security.service enabled: yes + when: runtime_env != 'TSG-X-P0906' - name: "Start telegraf_proxy" systemd: name: telegraf_proxy.service - enabled: yes
\ No newline at end of file + enabled: yes + when: runtime_env != 'TSG-X-P0906'
\ No newline at end of file diff --git a/ansible/roles/traffic-engine/files/helm/templates/_config.tpl b/ansible/roles/traffic-engine/files/helm/templates/_config.tpl index 62987b12..0694555d 100644 --- a/ansible/roles/traffic-engine/files/helm/templates/_config.tpl +++ b/ansible/roles/traffic-engine/files/helm/templates/_config.tpl @@ -180,8 +180,10 @@ enable_breakpad_upload=0 {{- define "traffic-engine.init" -}} mkdir -p /target_config/opt/tsg/etc mkdir -p /target_config/etc/default - chmod 0755 /opt/tsg/tsg-os-provision/scripts/obtain_sn.sh - /opt/tsg/tsg-os-provision/scripts/obtain_sn.sh + /opt/tsg/scripts/read_sn_to_env.sh + source /etc/profile.d/sn.sh + echo "{\"sn\": \"$SN\"}" > /target_config/opt/tsg/etc/tsg_sn.json + echo "device_id=\"$SN\"" > /target_config/etc/default/telegraf {{- end -}} {{- define "traffic-engine.init.sce" -}} diff --git a/ansible/roles/tsg-diagnose/tasks/main.yml b/ansible/roles/tsg-diagnose/tasks/main.yml index d4d1ca76..5fdac9ab 100644 --- a/ansible/roles/tsg-diagnose/tasks/main.yml +++ b/ansible/roles/tsg-diagnose/tasks/main.yml @@ -27,12 +27,14 @@ src: "{{role_path}}/templates/docker-compose.yml.j2" dest: /opt/tsg/tsg-diagnose/compose/docker-compose.yml tags: template + when: runtime_env != 'TSG-X-P0906' - name: "copy tsg-diagnose.service file to dest" copy: src: "{{ role_path }}/files/tsg-diagnose.service" dest: /usr/lib/systemd/system/tsg-diagnose.service mode: 0644 + when: runtime_env != 'TSG-X-P0906' - name: "Create /usr/lib/systemd/system/tsg-diagnose.service.d/ directory if it does not exist" file: @@ -41,12 +43,14 @@ mode: '0755' with_items: - /usr/lib/systemd/system/tsg-diagnose.service.d + when: runtime_env != 'TSG-X-P0906' - name: "copy prestart file to tsg-diagnose.service.d" copy: src: "{{ role_path }}/files/service_override_prestart.conf" dest: /usr/lib/systemd/system/tsg-diagnose.service.d/ mode: 0644 + when: runtime_env != 'TSG-X-P0906' - name: "replace action: replace service WantedBy from multi-user.target to workload.target" replace: diff --git a/ansible/roles/tsg-exporter-proxy-9140/files/exporter-proxy.tar.gz b/ansible/roles/tsg-exporter-proxy-9140/files/exporter-proxy.tar.gz Binary files differdeleted file mode 100644 index 6f8b96ab..00000000 --- a/ansible/roles/tsg-exporter-proxy-9140/files/exporter-proxy.tar.gz +++ /dev/null diff --git a/ansible/roles/tsg-exporter-proxy-9140/tasks/main.yml b/ansible/roles/tsg-exporter-proxy-9140/tasks/main.yml deleted file mode 100644 index c6780b04..00000000 --- a/ansible/roles/tsg-exporter-proxy-9140/tasks/main.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -# 安装 tsg 9140 exporter proxy -- name: "mkdir /opt/tsg/exporter" - file: - path: /opt/tsg/exporter - state: directory - -- name: "unarchive exporter-proxy(NGINX)" - unarchive: - src: "{{role_path}}/files/exporter-proxy.tar.gz" - dest: /opt/tsg/exporter - -- name: "templates exporter-proxy.service" - template: - src: "{{role_path}}/templates/exporter-proxy.service.j2" - dest: /usr/lib/systemd/system/exporter-proxy.service - tags: template - -- name: "template nginx.conf" - template: - src: "{{role_path}}/templates/nginx.conf.j2" - dest: /opt/tsg/exporter/exporter-proxy/conf/nginx.conf - tags: template - -- name: "Create /usr/lib/systemd/system/exporter-proxy.service.d/ directory if it does not exist" - file: - path: "{{ item }}" - state: directory - mode: '0755' - with_items: - - /usr/lib/systemd/system/exporter-proxy.service.d - -- name: "copy slice file to exporter-proxy.service.d" - copy: - src: "{{ role_path }}/templates/service_override_slice.conf.j2" - dest: /usr/lib/systemd/system/exporter-proxy.service.d/service_override_slice.conf - mode: 0644 - when: runtime_env != 'TSG-X-P0906' - -- name: "replace action: replace service WantedBy from multi-user.target to workload.target" - replace: - path: "{{ item }}" - regexp: 'WantedBy=multi-user.target' - replace: 'WantedBy=workload.target' - with_items: - - /usr/lib/systemd/system/exporter-proxy.service - when: runtime_env == 'TSG-9140' - -- name: 'exporter-proxy service start' - systemd: - name: exporter-proxy - enabled: yes
\ No newline at end of file diff --git a/ansible/roles/tsg-exporter-proxy-9140/templates/exporter-proxy.service.j2 b/ansible/roles/tsg-exporter-proxy-9140/templates/exporter-proxy.service.j2 deleted file mode 100644 index 99ee4cb1..00000000 --- a/ansible/roles/tsg-exporter-proxy-9140/templates/exporter-proxy.service.j2 +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=TSG-9140 Exporter Proxy (NGINX) for NEZHA -After=network.target remote-fs.target nss-lookup.target - -[Service] -Type=simple -ExecStart=/opt/tsg/exporter/exporter-proxy/sbin/nginx -p /opt/tsg/exporter/exporter-proxy -ExecReload=/opt/tsg/exporter/exporter-proxy/sbin/nginx -p /opt/tsg/exporter/exporter-proxy -s reload -ExecStop=/opt/tsg/exporter/exporter-proxy/sbin/nginx -p /opt/tsg/exporter/exporter-proxy -s stop - -[Install] -WantedBy=multi-user.target diff --git a/ansible/roles/tsg-exporter-proxy-9140/templates/nginx.conf.j2 b/ansible/roles/tsg-exporter-proxy-9140/templates/nginx.conf.j2 deleted file mode 100644 index cafefa1b..00000000 --- a/ansible/roles/tsg-exporter-proxy-9140/templates/nginx.conf.j2 +++ /dev/null @@ -1,64 +0,0 @@ - -user nobody; -worker_processes 1; -daemon off; - -error_log logs/error.log; -error_log logs/error.log notice; -error_log logs/error.log info; -pid logs/nginx.pid; - - -events { - worker_connections 1024; -} - -http { - include mime.types; - default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - #access_log logs/access.log main; - - sendfile on; - tcp_nopush on; - - keepalive_timeout 65; - gzip on; - - server { - listen 9000; - server_name localhost; - - location /metrics/blade/node_exporter { - proxy_pass http://127.0.0.1:9100/metrics; - } - - location /metrics/blade/systemd_exporter { - proxy_pass http://127.0.0.1:9558/metrics; - } - - location /metrics/blade/certstore { - proxy_pass http://127.0.0.1:9002/metrics; - } - - location /metrics/blade/tfe { - proxy_pass http://127.0.0.1:9001/metrics; - } - - location /metrics/blade/sapp { - proxy_pass http://127.0.0.1:9273/metrics; - } - - location /metrics/blade/mrapm_device { - proxy_pass http://127.0.0.1:8901/metrics; - } - - location /metrics/blade/mrapm_stream { - proxy_pass http://127.0.0.1:8902/metrics; - } - } -} diff --git a/ansible/roles/tsg-exporter-proxy-9140/templates/service_override_slice.conf.j2 b/ansible/roles/tsg-exporter-proxy-9140/templates/service_override_slice.conf.j2 deleted file mode 100644 index db248c50..00000000 --- a/ansible/roles/tsg-exporter-proxy-9140/templates/service_override_slice.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -Slice=workload.slice
\ No newline at end of file diff --git a/ansible/roles/tsg-os-provision-condition/files/service_add_ConditionPathExists.conf b/ansible/roles/tsg-os-provision-condition/files/service_add_ConditionPathExists.conf deleted file mode 100644 index ef19434e..00000000 --- a/ansible/roles/tsg-os-provision-condition/files/service_add_ConditionPathExists.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Unit] -ConditionPathExists=/data/tsg-os-provision/.provision_succeeded diff --git a/ansible/roles/tsg-os-provision-condition/tasks/main.yml b/ansible/roles/tsg-os-provision-condition/tasks/main.yml deleted file mode 100644 index e487b746..00000000 --- a/ansible/roles/tsg-os-provision-condition/tasks/main.yml +++ /dev/null @@ -1,61 +0,0 @@ -- name: "add condition into service depend provision result - TSG9140" - copy: - src: "{{ role_path }}/files/service_add_ConditionPathExists.conf" - dest: "/usr/lib/systemd/system/{{ item }}.service.d/" - mode: 0644 - with_items: - - cert-redis - - certstore - - mrapm_device - - mrapm_stream - - mrenv - - mrzcpd - - sapp - - telegraf_statistic - - tfe-env - - tfe - when: runtime_env == 'TSG-9140' - -- name: "add condition into service depend provision result TSG7400 MCN0" - copy: - src: "{{ role_path }}/files/service_add_ConditionPathExists.conf" - dest: "/usr/lib/systemd/system/{{ item }}.service.d/" - mode: 0644 - with_items: - - cert-redis - - certstore - - mrapm_device - - mrapm_stream - - mrenv - - mrzcpd - - sapp - - telegraf_statistic - when: runtime_env == 'TSG-7400-mcn0' - -- name: "add condition into service depend provision result TSG7400 MCN0" - copy: - src: "{{ role_path }}/files/service_add_ConditionPathExists.conf" - dest: "/usr/lib/systemd/system/{{ item }}.service.d/" - mode: 0644 - with_items: - - mrapm_device - - mrapm_stream - - mrenv - - mrzcpd - - tfe-env - - tfe - when: runtime_env == 'TSG-7400-mcn123' - -- name: "add condition into service depend provision result TSG-X-P0906" - copy: - src: "{{ role_path }}/files/service_add_ConditionPathExists.conf" - dest: "/usr/lib/systemd/system/{{ item }}.service.d/" - mode: 0644 - with_items: - - mrapm_device - - mrapm_stream - - mrenv - - mrzcpd - - telegraf_statistic - - tsg-traffic-engine - when: runtime_env == 'TSG-X-P0906' diff --git a/ansible/roles/tsg-os-provision/files/config_sample/provision.default.yml.9000NPBP01R01 b/ansible/roles/tsg-os-provision/files/config_sample/provision.default.yml.9000NPBP01R01 deleted file mode 100644 index f2cdb5a4..00000000 --- a/ansible/roles/tsg-os-provision/files/config_sample/provision.default.yml.9000NPBP01R01 +++ /dev/null @@ -1,102 +0,0 @@ -feature: - enable_stream_bypass_under_ddos: 0 - -firewall: - enable: 1 - enable_hos: 1 - rapidjson_chunk_capacity: 2048 - enable_dtls: 1 - enable_sip: 1 - enable_bgp: 1 - -proxy: - enable: 1 - enable_hos: 1 - -sessionrecord: - enable: 1 - enable_dns_record: 1 - enable_rtp_record: 1 - enable_interim_record: 1 - enable_transcation_record: 1 - enable_contains_app_id: 0 - enable_contains_nat_linkinfo: 0 - enable_contains_dns_resource_record: 0 - -capturepacket: - enable: 1 - -radius: - enable: 1 - -app_behavior: - enable: 0 - -gtp: - enable_gtp_c_record: 1 - -wannat: - enable: 0 - nat_gateway_address: "127.0.0.1" - reachability_test_server_address: "127.0.0.1" - reachability_test_server_port: 8888 - feedback_linkinfo_interval: 30 - nat_gateway_broadcast_session_port: 5671 - reachability_test_server_broadcast_session_port: 5672 - reachability_test_server_tunnel_port: 3542 - wan_gateway_listen_port_range_left_edge: 3545 - nat_gateway_listen_port: 3544 - enable_link_info_recording: 1 - -ddossketch: - enable: 1 - tcp_flood_report_thresh: 0.0008 - udp_flood_report_thresh: 0.0008 - icmp_flood_report_thresh: 0.0008 - dns_flood_report_thresh: 0.0008 - -app: - identify_by: - user_defined_signature: 1 - builtin_app_engine: 1 - -coredump: - format: none - collect: local - sentry_url: http://127.0.0.1:9000/api/2/minidump/ - -advanced_settings: - stream_tcp_max: 50000 - stream_tcp_timeout: 30 - stream_udp_max: 50000 - stream_udp_timeout: 60 - stream_bypass_trigger_cpu_usage: 90 - -cm: - policy_server: - port_num: 1 - db_static: 0 - db_dynamic: 1 - -#####session_distribution_policy.hash_key in [outer-most-sip-dip,outer-most-sip-dip-sport-dport,inner-most-sip-dip,inner-most-sip-dip-sport-dport] -session_distribution_policy: - mode: sym-hash - hash_key: inner-most-sip-dip - -olap: - hos_server: - token: "c21f969b5f03d33d43e04f8f136e7682" - -vsys_id: 1 - -consul_agent: - mode: "server" - encrypt: "XN0I7fHIY1+yLWm2PjegZ7U93nI/tmzNvtmBtZLuIfo=" - datacenter: "dc1" - node_name: "" - -shaping: - enable: 0 - -sid: - shaping: 1000
\ No newline at end of file diff --git a/ansible/roles/tsg-os-provision/files/config_sample/provision.yml.sample.9000NPBP01R01 b/ansible/roles/tsg-os-provision/files/config_sample/provision.yml.sample.9000NPBP01R01 deleted file mode 100644 index 6f18f281..00000000 --- a/ansible/roles/tsg-os-provision/files/config_sample/provision.yml.sample.9000NPBP01R01 +++ /dev/null @@ -1,87 +0,0 @@ -version: 1 - -device: - tags: - - key1: value1 - - key2: value2 - -session_id_generator: - snowflake_worker_id_base: 1 - snowflake_worker_id_offset: 1 - - -feature: - enable_stream_bypass_under_ddos: 0 - -firewall: - enable: 0/1 - -proxy: - enable: 0/1 - -sessionrecord: - enable: 0/1 - enable_dns_record: 0/1 - enable_rtp_record: 0/1 - enable_interim_record: 0/1 - enable_transcation_record: 0/1 - -capturepacket: - enable: 0/1 - -radius: - enable: 0/1 - -gtp: - enable_gtp_c_record: 0/1 - -wannat: - enable: 0/1 - nat_gateway_address: "127.0.0.1" - reachability_test_server_address: "127.0.0.1" - -ddossketch: - enable: 0/1 - -app: - identify_by: - user_defined_signature: 0/1 - builtin_app_engine: 0/1 - -cm: - policy_server: - address: "127.0.0.1" - port: 7002 - -olap: - kafka_broker: - address_list: ['1.1.1.1:9092','2.2.2.2:9092'] - hos_server: - address: "127.0.0.1" - port: 9098 - token: "xxxxxxxxxx" - -coredump: - format: minidump/core/none - collect: local/sentry - sentry_url: http://127.0.0.1:9000/api/2/minidump/?sentry_key=3203b43fd5384a7dbe6a48ecb1f3c595 - -vsys_id: 1 - -consul_agent: - mode: client/server - #encrypt: "" - bootstrapExpect: 1 - #node_name: "" - #datacenter: "dc1" - join: - - address: 111.111.111.111 - port: 8301 - - address: 222.222.222.222 - port: 8301 - -shaping: - enable: 1 - -sid: - shaping: 1000 diff --git a/ansible/roles/tsg-os-provision/files/script/guard.sh b/ansible/roles/tsg-os-provision/files/script/guard.sh deleted file mode 100644 index bb24261b..00000000 --- a/ansible/roles/tsg-os-provision/files/script/guard.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -x - -config_path=/data/tsg-os-provision/provision.yml -version_file_path=/usr/lib/os-release -present_version_file_path=/data/tsg-os-provision/.os-release.present - - -if [ ! -f "$config_path" ];then - echo "$config_path is not exists, $config_path need to add and config" - exit 1 -fi - -if [ ! -f "$present_version_file_path" ];then - echo "Error: tsg-os-provision excute failed, Please checkout file $config_path and retry" - exit 1 -fi - -md5_version_file=`md5sum $version_file_path | awk '{print $1}'` -md5_present_version_file=`md5sum $present_version_file_path | awk '{print $1}'` - -if [ "$md5_version_file" != "$md5_present_version_file" ];then - echo "Error: tsg-os-provision excute failed, Please checkout file $config_path and retry" - exit 1 -fi diff --git a/ansible/roles/tsg-os-provision/files/script/obtain_isolate_cpu_range.py b/ansible/roles/tsg-os-provision/files/script/obtain_isolate_cpu_range.py deleted file mode 100644 index 740e5a64..00000000 --- a/ansible/roles/tsg-os-provision/files/script/obtain_isolate_cpu_range.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python3 -import json -import subprocess - -CPU_LAYOUTS_CONF_PATH = "/opt/tsg/tsg-os-provision/.cpu_layouts.json" -PROXY_CONF_PATH = "/opt/tsg/tsg-os-provision/.proxy.json" - -def get_cpu_machine(): - model_info = (subprocess.check_output("lscpu | grep \"Model name:\" | head -n 1 | sed -r \'s/Model name:\s{1,}//g\'", shell=True).strip()).decode() - socket_info = int((subprocess.check_output("lscpu | grep \"Socket(s):\" | head -n 1 | sed -r \'s/Socket\(s\):\s{1,}//g\'", shell=True).strip()).decode()) - return (model_info, socket_info) - -def get_cpu_layouts(): - with open(CPU_LAYOUTS_CONF_PATH, 'r',encoding='utf-8') as f: - temp=json.load(f) - f.close() - return temp - -def get_proxy_config(): - with open(PROXY_CONF_PATH, 'r',encoding='utf-8') as f: - temp=json.load(f) - f.close() - return temp - -def get_cpu_affinity(): - matched = 0 - mrzcpd_cpu_affinity = [] - sapp_cpu_affinity = [] - tfe_cpu_affinity = [] - cpu_machine = get_cpu_machine() - cpu_layouts = get_cpu_layouts() - for layout in cpu_layouts: - if (layout['match']['sockets'] == cpu_machine[1]) and (cpu_machine[0].find(layout['match']['model_name']) != -1): - matched = 1 - sapp_cpu_affinity = layout['sapp_affinity'] - mrzcpd_cpu_affinity = layout['mrzcpd_affinity'] - tfe_cpu_affinity = layout['tfe_affinity'] - break - if matched == 0: - print("Warning: not match cpu model name and sockets,please checkout cpuinfo and cpu_layouts config ...") - exit(1) - return (mrzcpd_cpu_affinity, sapp_cpu_affinity, tfe_cpu_affinity) - -def append_range_list(start,end,rangelist): - if start == end: - rangelist.append(('%d' % start)) - else: - rangelist.append(('%d-%d' % (start,end))) - -def get_range_isolate_cpu(): - proxy_config = get_proxy_config() - isolate_range_cpu_list = [] - range_start = range_end = -1 - cpu_affinity = get_cpu_affinity() - isolate_cpu_list = cpu_affinity[0] + cpu_affinity[1] - if proxy_config['enable'] == 0: - isolate_cpu_list = isolate_cpu_list + cpu_affinity[2] - isolate_cpu_list.sort() - - for i,val in enumerate(isolate_cpu_list): - if i == 0: - range_start = val - range_end = val - continue - if val - range_end == 1: - range_end = val - continue - else: - append_range_list(range_start,range_end,isolate_range_cpu_list) - range_start = val - range_end = val - - append_range_list(range_start,range_end, isolate_range_cpu_list) - print(",".join(isolate_range_cpu_list)) - -if __name__ == '__main__': - get_range_isolate_cpu() diff --git a/ansible/roles/tsg-os-provision/files/script/obtain_rps_mask.py b/ansible/roles/tsg-os-provision/files/script/obtain_rps_mask.py deleted file mode 100644 index 17770c4e..00000000 --- a/ansible/roles/tsg-os-provision/files/script/obtain_rps_mask.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 -import psutil -import platform -import subprocess -import yaml -import math -import json - -CPU_LAYOUTS_CONF_PATH = "/opt/tsg/tsg-os-provision/.cpu_layouts.json" - -def get_cpu_machine(): - model_info = (subprocess.check_output("lscpu | grep \"Model name:\" | head -n 1 | sed -r \'s/Model name:\s{1,}//g\'", shell=True).strip()).decode() - socket_info = int((subprocess.check_output("lscpu | grep \"Socket(s):\" | head -n 1 | sed -r \'s/Socket\(s\):\s{1,}//g\'", shell=True).strip()).decode()) - #return (psutil.cpu_count(), retstr) - return (model_info, socket_info) - -def get_cpu_layouts(): - with open(CPU_LAYOUTS_CONF_PATH, 'r',encoding='utf-8') as f: - temp=json.load(f) - f.close() - return temp - -def get_cpu_affinity(): - matched = 0 - tfe_cpu_affinity = [] - mrzcpd_cpu_affinity = [] - cpu_machine = get_cpu_machine() - cpu_layouts = get_cpu_layouts() - for layout in cpu_layouts: - if (layout['match']['sockets'] == cpu_machine[1]) and (cpu_machine[0].find(layout['match']['model_name']) != -1): - matched = 1 - tfe_cpu_affinity = layout['tfe_affinity'] - mrzcpd_cpu_affinity = layout['mrzcpd_affinity'] - break - if matched == 0: - print("Warning: not match cpu model name and sockets,please checkout cpuinfo and cpu_layouts config ...") - exit(1) - return (mrzcpd_cpu_affinity, tfe_cpu_affinity) - -def calc_rps_mask(): - rps_list_size = math.ceil(psutil.cpu_count()/32) - rps_list = [0] * rps_list_size - cpu_affinity = get_cpu_affinity() - for core in cpu_affinity[1]: - rps_list_index = core // 32 - rps_core_location = core % 32 - rps_list[rps_list_index] = rps_list[rps_list_index] | (2 ** rps_core_location) - - result_queue_rps = "" - is_top = False - for rps in reversed(rps_list): - if is_top == False: - result_queue_rps = ('%x' % rps) - is_top = True - else: - result_queue_rps = result_queue_rps + ',' + ('%08x' % rps) - result_output = {"rps_size": len(cpu_affinity[0]), "rps_mask": result_queue_rps} - print(json.dumps(result_output)) - -if __name__ == '__main__': - calc_rps_mask() diff --git a/ansible/roles/tsg-os-provision/files/script/provision-config-apply b/ansible/roles/tsg-os-provision/files/script/provision-config-apply deleted file mode 100644 index 7e8b19e0..00000000 --- a/ansible/roles/tsg-os-provision/files/script/provision-config-apply +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -e -reboot_required=0 -ARGS=`getopt -a -o r -l reboot,help -- "$@"` -eval set -- "${ARGS}" -usage(){ - echo "" - echo "usage: provision-config-apply [option]" - echo "" - echo "Options:" - echo " -h --help Detailed usage syntax" - echo " -r --reboot Reboot make configuration take effect" - exit 0 -} - -function get_args(){ - while true - do - case "$1" in - -r|--reboot) - reboot_required=1 - ;; - -h|--help) - usage - ;; - --) - shift - break - ;; - esac - shift - done -} - -get_args $@ - -if [ "$(id -u)" != 0 ]; then - echo "Root privilege is required, Please checkout the privilege" - exit 1 -fi - -if [ $reboot_required == 1 ]; then - /opt/tsg/tsg-os-provision/scripts/provision.sh 2 - echo "Reboot..." - reboot -else - /opt/tsg/tsg-os-provision/scripts/provision.sh 1 -fi diff --git a/ansible/roles/tsg-os-provision/files/service/tsg-os-provision.service.TSG9140 b/ansible/roles/tsg-os-provision/files/service/tsg-os-provision.service.TSG9140 deleted file mode 100644 index c054c10a..00000000 --- a/ansible/roles/tsg-os-provision/files/service/tsg-os-provision.service.TSG9140 +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Tsg os provision -DefaultDependencies=no -Conflicts=shutdown.target -After=local-fs.target -Before=sysinit.target shutdown.target systemd-update-done.service -ConditionNeedsUpdate=|/etc -ConditionFileNotEmpty=|/usr - -[Service] -ExecStart=/bin/sh -c "/opt/tsg/tsg-os-provision/scripts/provision.sh 0" -Type=oneshot -RemainAfterExit=yes diff --git a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.9000NPBP01R01 b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.9000NPBP01R01 deleted file mode 100644 index 23e2bf11..00000000 --- a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.9000NPBP01R01 +++ /dev/null @@ -1,330 +0,0 @@ ---- -- hosts: provision - tasks: - - name: Delete porvision successed sign - file: - path: /data/tsg-os-provision/.provision_succeeded - state: absent - - - name: Load default config file variable - include_vars: - file: /opt/tsg/tsg-os-provision/provision.default.yml - - - name: Load general config file variable - include_vars: - file: /data/tsg-os-provision/provision.yml - - - name: Load provision.yml.d config file variable - include_vars: - dir: /data/tsg-os-provision/provision.yml.d/ - ignore_unknown_extensions: yes - extensions: - - 'yml' - - 'yaml' - - - name: "mkdir /opt/tsg/etc/" - file: - path: /opt/tsg/etc - state: directory - - - name: "tsg-os-provision: obtain sn" - shell: /opt/tsg/tsg-os-provision/scripts/obtain_sn.sh - register: result_exec_obtain_sn_and_write_sn_in_file - - - name: "tsg-os-provision: check result_exec_obtain_sn_and_write_sn_in_file" - assert: - that: - - result_exec_obtain_sn_and_write_sn_in_file.rc == 0 - - result_exec_obtain_sn_and_write_sn_in_file.failed == False - fail_msg: "error:{{ result_exec_obtain_sn_and_write_sn_in_file.stderr }},stdout:{{ result_exec_obtain_sn_and_write_sn_in_file.stdout_lines }}" - success_msg: "Successded: obtain the sn and write sn into tsg_sn.json" - - - name: "tsg-os-provision: obtain result_exec_obtain_keepalive_subnet" - shell: ipmitool picmg addrinfo | grep "Hardware Address" | sed 's/^Hardware Address.*0x4\(.*\)/\1/' | awk '{print strtonum("0x"$1)+16'} - register: result_exec_obtain_keepalive_subnet - - - name: "tsg-os-provision: output results that executes command that gets the result_exec_obtain_keepalive_subnet" - debug: - msg: "{{ result_exec_obtain_keepalive_subnet }}" - - - name: "tsg-os-provision: check result_exec_obtain_keepalive_subnet" - assert: - that: - - result_exec_obtain_keepalive_subnet.rc == 0 - - result_exec_obtain_keepalive_subnet.failed == False - - result_exec_obtain_keepalive_subnet.stdout_lines | length == 1 - - result_exec_obtain_keepalive_subnet.stdout_lines[0] | int >= 16 - - result_exec_obtain_keepalive_subnet.stdout_lines[0] | int <= 31 - fail_msg: "error:{{ result_exec_obtain_keepalive_subnet.stderr }},stdout:{{ result_exec_obtain_keepalive_subnet.stdout_lines }}" - success_msg: "{{ result_exec_obtain_keepalive_subnet.stdout_lines[0] }}" - - - name: "set cm_policy_server_ip and cm_policy_server_port" - set_fact: - cm_policy_server_ip: "{{cm.policy_server.address}}" - cm_policy_server_port: "{{ cm.policy_server.port }}" - - - name: "tsg-os-provision: Set fact for field gdev_conf_keep_alive_ip" - set_fact: - gdev_conf_keep_alive_ip: "10.252.{{ result_exec_obtain_keepalive_subnet.stdout_lines[0] }}.1" - - - name: "tsg-os-provision: Template the conflist.inf" - template: - src: ../templates/conflist.inf.j2 - dest: /opt/tsg/sapp/plug/conflist.inf - tags: sapp - - - name: "tsg-os-provision: template gdev.conf file" - template: - src: "../templates/gdev.conf.j2" - dest: /opt/tsg/sapp/etc/gdev.conf - tags: sapp - - - name: "tsg-os-provision: template mrglobal.conf file" - template: - src: "../templates/mrglobal.conf.j2" - dest: /opt/tsg/mrzcpd/etc/mrglobal.conf - tags: mrzcpd - - - name: "tsg-os-provision: template certstore configure file" - template: - src: "../templates/cert_store.ini.j2" - dest: /opt/tsg/certstore/conf/cert_store.ini - tags: certstore - - - name: "tsg-os-provision: Template the tsgconf/main.conf" - template: - src: "../templates/main.conf.j2" - dest: /opt/tsg/sapp/tsgconf/main.conf - tags: firewall - - - name: "tsg-os-provision: Template the tsgconf/maat.conf" - template: - src: "../templates/maat.conf.j2" - dest: /opt/tsg/sapp/tsgconf/maat.conf - tags: firewall - - - name: "tsg-os-provision: Template the session_record.inf" - template: - src: "../templates/session_record.inf.j2" - dest: /opt/tsg/sapp/plug/business/session_record/session_record.inf - tags: firewall - - - name: "tsg-os-provision: Template the firewall.inf" - template: - src: "../templates/firewall.inf.j2" - dest: /opt/tsg/sapp/plug/business/firewall/firewall.inf - tags: firewall - - - name: "tsg-os-provision: Template the sapp.toml" - template: - src: "../templates/sapp.toml.j2" - dest: /opt/tsg/sapp/etc/sapp.toml - tags: sapp - - - name: "tsg-os-provision: Templates telegraf.conf" - template: - src: "../templates/telegraf_statistic.conf.j2" - dest: /etc/telegraf/telegraf_statistic.conf - tags: telegraf_statistic - - # - name: "tsg-os-provision: Templates telegraf.conf" - # template: - # src: "../templates/telegraf_shaping.conf.j2" - # dest: /etc/telegraf/telegraf_shaping.conf - # tags: telegraf_shaping - - - name: "tsg-os-provision: Templates telegraf_security.conf" - template: - src: "../templates/telegraf_security.conf.j2" - dest: /etc/telegraf/telegraf_security.conf - tags: telegraf_security - - - name: "tsg-os-provision: Templates telegraf_proxy.conf" - template: - src: "../templates/telegraf_proxy.conf.j2" - dest: /etc/telegraf/telegraf_proxy.conf - tags: telegraf_security - - - name: "tsg-os-provision: template the tfe.conf" - template: - src: "../templates/tfe.conf.j2" - dest: /opt/tsg/tfe/conf/tfe/tfe.conf - tags: tfe - - - name: "tsg-os-provision: template the pangu_pxy.conf" - template: - src: "../templates/pangu_pxy.conf.j2" - dest: /opt/tsg/tfe/conf/pangu/pangu_pxy.conf - tags: tfe - - - name: "tsg-os-provision: template consul" - template: - src: "../templates/consul.hcl.j2" - dest: /etc/consul.d/consul.hcl - tags: consul - when: shaping.enable == 1 - - - name: "mkdir /opt/tsg/etc/" - file: - path: /opt/tsg/etc - state: directory - - - name: "tsg-os-provision: template the tsg_device_tag" - template: - src: "../templates/tsg_device_tag.json.j2" - dest: /opt/tsg/etc/tsg_device_tag.json - tags: tsg_device_tag - - - name: "tsg-os-provision: template wannat wangw.conf file" - template: - src: "../templates/wangw.conf.j2" - dest: /opt/tsg/sapp/etc/wannat/wangw.conf - tags: wangw - - - name: "tsg-os-provision: template wire_graft.conf file" - template: - src: "../templates/wire_graft.conf.j2" - dest: /opt/tsg/sapp/etc/wire_graft/wire_graft.conf - tags: wire_graft - - - name: "tsg-os-provision: coredump setup override - mkdir" - file: - path: /usr/lib/systemd/coredump.conf.d/ - state: directory - - - name: "tsg-os-provision: coredump setup override - override" - template: - src: "../templates/coredump_setup_override.conf.j2" - dest: /usr/lib/systemd/coredump.conf.d/coredump_setup_override.conf - - - name: 'tsg-os-provision: execute command - systemctl daemon-reload' - systemd: - daemon_reload: yes - - - name: "tsg-os-provision: snapshot the stage2 config files" - copy: - src: /data/tsg-os-provision/provision.yml - dest: /data/tsg-os-provision/provision.yml.snapshot - - - name: "tsg-os-provision: rewrite sapp.toml bind_mask" - lineinfile: - path: "/opt/tsg/sapp/etc/sapp.toml" - regexp: '^(.*)bind_mask=(.*)$' - line: 'bind_mask="5-55"' - backrefs: yes - when: proxy.enable == 0 - - - name: "tsg-os-provision: rewrite sapp.toml worker_threads" - lineinfile: - path: "/opt/tsg/sapp/etc/sapp.toml" - regexp: '^(.*)worker_threads=(.*)$' - line: 'worker_threads=51' - backrefs: yes - when: proxy.enable == 0 - - - name: "tsg-os-provision: disable enable service step 1:mount partition to mnt_tmp" - mount: - path: /tmp/mnt_tmp - src: /dev/sda4 - fstype: ext4 - state: mounted - - - name: "tsg-os-provision: disable service step 2:disable tfe service" - shell: systemctl --root=/tmp/mnt_tmp disable tfe.service - when: proxy.enable == 0 - - - name: "tsg-os-provision: enable service step 2:enable tfe service" - shell: systemctl --root=/tmp/mnt_tmp enable tfe.service - when: proxy.enable == 1 - - - name: "tsg-os-provision: disable enable service step 3:umount mnt_tmp" - mount: - path: /tmp/mnt_tmp - state: absent - - - name: "tsg-os-provision: stop tfe" - systemd: - name: tfe - state: stopped - when: proxy.enable == 0 - - - name: add porvision successed sign - file: - path: /data/tsg-os-provision/.provision_succeeded - state: touch - - - name: "tsg-os-provision: restart consul" - systemd: - name: consul - state: restarted - when: - - enable_config_apply == '1' - - shaping.enable == 1 - - - name: "tsg-os-provision: start mrenv" - systemd: - name: mrenv - state: started - when: enable_config_apply == '1' - - - name: "tsg-os-provision: start mrzcpd" - systemd: - name: mrzcpd - state: started - when: enable_config_apply == '1' - - - name: "tsg-os-provision: restart mrapm_device" - systemd: - name: mrapm_device - state: restarted - when: enable_config_apply == '1' - - - name: "tsg-os-provision: restart mrapm_stream" - systemd: - name: mrapm_stream - state: restarted - when: enable_config_apply == '1' - - - name: "tsg-os-provision: restart telegraf_statistic" - systemd: - name: telegraf_statistic - state: restarted - when: enable_config_apply == '1' - - - name: "tsg-os-provision: restart certstore" - systemd: - name: certstore - state: restarted - when: enable_config_apply == '1' - - - name: "tsg-os-provision: restart cert-redis" - systemd: - name: cert-redis - state: restarted - when: enable_config_apply == '1' - - - name: "tsg-os-provision: restart sapp" - systemd: - name: sapp - state: restarted - when: enable_config_apply == '1' - - - name: "tsg-os-provision: restart tfe" - systemd: - name: tfe - state: restarted - when: - - enable_config_apply == '1' - - proxy.enable == 1 - - - name: "tsg-os-provision: restart telegraf_security" - systemd: - name: telegraf_security - state: restarted - when: enable_config_apply == '1' - - - name: "tsg-os-provision: restart telegraf_proxy" - systemd: - name: telegraf_proxy - state: restarted - when: enable_config_apply == '1'
\ No newline at end of file diff --git a/ansible/roles/tsg-os-provision/tasks/main.yml b/ansible/roles/tsg-os-provision/tasks/main.yml index fbf6f8f3..7b161fdf 100644 --- a/ansible/roles/tsg-os-provision/tasks/main.yml +++ b/ansible/roles/tsg-os-provision/tasks/main.yml @@ -1,6 +1,5 @@ - name: "set system default.target" shell: ln -vfs /usr/lib/systemd/system/workload.target /etc/systemd/system/default.target - when: runtime_env != 'TSG-X-P0906' - name: "tsg-os-provision: build tsg-os-provision directory and sub directory" file: @@ -27,13 +26,6 @@ - adapt_tera_network_setting.sh.j2 - setup_policy_log_nic_network.sh.j2 -- name: "tsg-os-provision: copy tasks file that excutes provision to dest - tsg9140" - copy: - src: "{{ role_path }}/files/tasks/provision.yml.9000NPBP01R01" - dest: /opt/tsg/tsg-os-provision/tasks/provision.yml - mode: 0644 - when: runtime_env == 'TSG-9140' - - name: "tsg-os-provision: copy tasks file that excutes provision to dest - tsg7400 mcn0" copy: src: "{{ role_path }}/files/tasks/provision.yml.7400MCN0P01R01" @@ -48,13 +40,6 @@ mode: 0644 when: runtime_env == 'TSG-7400-mcn123' -- name: "tsg-os-provision: copy provision.yml.sample file to dest - tsg9140" - copy: - src: "{{ role_path }}/files/config_sample/provision.yml.sample.9000NPBP01R01" - dest: /opt/tsg/tsg-os-provision/provision.yml.sample - mode: 0644 - when: runtime_env == 'TSG-9140' - - name: "tsg-os-provision: copy provision.default.yml - tsg7400 mcn0" copy: src: "{{ role_path }}/files/config_sample/provision.default.yml.7400MCN0P01R01" @@ -69,13 +54,6 @@ mode: 0644 when: runtime_env == 'TSG-7400-mcn123' -- name: "tsg-os-provision: copy provision.default.yml - tsg9140" - copy: - src: "{{ role_path }}/files/config_sample/provision.default.yml.9000NPBP01R01" - dest: /opt/tsg/tsg-os-provision/provision.default.yml - mode: 0644 - when: runtime_env == 'TSG-9140' - - name: "tsg-os-provision: copy provision.yml.sample to dest - tsg7400 mcn0" copy: src: "{{ role_path }}/files/config_sample/provision.yml.sample.7400MCN0P01R01" @@ -125,28 +103,6 @@ - tsg-os-provision when: runtime_env == 'TSG-7400-mcn0' or runtime_env == 'TSG-7400-mcn123' -- name: "install tsg-os-provision.service -- TSG9140" - copy: - src: "{{ role_path }}/files/service/{{ item.src }}" - dest: /usr/lib/systemd/system/{{ item.dest }} - mode: 0644 - with_items: - - { "src": tsg-os-provision.service.TSG9140, "dest": tsg-os-provision.service } - when: runtime_env == 'TSG-9140' - -- name: "replace action: add service into sysinit.target --TSG9140" - shell: ln -vfs --relative /usr/lib/systemd/system/{{item}} /usr/lib/systemd/system/sysinit.target.wants/{{item}} - with_items: - - tsg-os-provision.service - when: runtime_env == 'TSG-9140' - -- name: "tsg-os-provision: copy tsg-start.sh to dest - tsg9140" - copy: - src: "{{ role_path }}/files/script/provision-config-apply" - dest: /opt/tsg/tsg-os-provision/ - mode: 0755 - when: runtime_env == 'TSG-9140' - - name: "copy tsg-os-provision.sh to destination" copy: src: "{{ role_path }}/files/script/tsg-os-provision.sh" diff --git a/ansible/roles/tsg_device_tag/tasks/main.yml b/ansible/roles/tsg_device_tag/tasks/main.yml index 164ea1c3..7f9699c3 100644 --- a/ansible/roles/tsg_device_tag/tasks/main.yml +++ b/ansible/roles/tsg_device_tag/tasks/main.yml @@ -4,4 +4,3 @@ src: "{{ role_path }}/templates/tsg_device_tag.json.j2.j2" dest: /opt/tsg/tsg-os-provision/templates/tsg_device_tag.json.j2 tags: template - when: runtime_env != 'TSG-X-P0906' diff --git a/ansible/roles/tsg_sn/files/obtain_sn.sh.TSG9140 b/ansible/roles/tsg_sn/files/obtain_sn.sh.TSG9140 deleted file mode 100644 index 96c96afa..00000000 --- a/ansible/roles/tsg_sn/files/obtain_sn.sh.TSG9140 +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -x - -output=`ipmitool fru -t 130 | awk 'NR==12'` -if [ -z "$output" ];then - echo "{\"sn\": \"unknown\"}" > /opt/tsg/etc/tsg_sn.json - echo "device_id=\"unknown\"" > /etc/default/telegraf - exit 0 -fi -sn=`echo $output | awk '{print $4}'` -if [ -z "$sn" ];then - echo "{\"sn\": \"unknown\"}" > /opt/tsg/etc/tsg_sn.json - echo "device_id=\"unknown\"" > /etc/default/telegraf - exit 0 -fi -echo "{\"sn\": \"$sn\"}" > /opt/tsg/etc/tsg_sn.json -echo "device_id=\"$sn\"" > /etc/default/telegraf diff --git a/ansible/roles/tsg_sn/files/obtain_sn.sh.TSGSERVER b/ansible/roles/tsg_sn/files/obtain_sn.sh.TSGSERVER deleted file mode 100644 index ed38b215..00000000 --- a/ansible/roles/tsg_sn/files/obtain_sn.sh.TSGSERVER +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -x - -sn=`ipmitool fru list |grep 'Product Serial' | awk '{ print $4}'` -if [ -z "$sn" ];then - echo "{\"sn\": \"unknown\"}" > /opt/tsg/etc/tsg_sn.json - echo "device_id=\"unknown\"" > /etc/default/telegraf - exit 0 -fi -echo "{\"sn\": \"$sn\"}" > /opt/tsg/etc/tsg_sn.json -echo "device_id=\"$sn\"" > /etc/default/telegraf diff --git a/ansible/roles/tsg_sn/files/obtain_sn.sh.TSGXP0906-init b/ansible/roles/tsg_sn/files/obtain_sn.sh.TSGXP0906-init deleted file mode 100644 index 113c4f16..00000000 --- a/ansible/roles/tsg_sn/files/obtain_sn.sh.TSGXP0906-init +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -x - -sn=`ipmitool fru list |grep 'Product Serial' | awk '{ print $4}'` -if [ -z "$sn" ];then - echo "{\"sn\": \"unknown\"}" > /target_config/opt/tsg/etc/tsg_sn.json - echo "device_id=\"unknown\"" > /target_config/etc/default/telegraf - exit 0 -fi -echo "{\"sn\": \"$sn\"}" > /target_config/opt/tsg/etc/tsg_sn.json -echo "device_id=\"$sn\"" > /target_config/etc/default/telegraf diff --git a/ansible/roles/tsg_sn/files/obtain_sn.sh.TSGXP1403 b/ansible/roles/tsg_sn/files/obtain_sn.sh.TSGXP1403 deleted file mode 100644 index ed38b215..00000000 --- a/ansible/roles/tsg_sn/files/obtain_sn.sh.TSGXP1403 +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -x - -sn=`ipmitool fru list |grep 'Product Serial' | awk '{ print $4}'` -if [ -z "$sn" ];then - echo "{\"sn\": \"unknown\"}" > /opt/tsg/etc/tsg_sn.json - echo "device_id=\"unknown\"" > /etc/default/telegraf - exit 0 -fi -echo "{\"sn\": \"$sn\"}" > /opt/tsg/etc/tsg_sn.json -echo "device_id=\"$sn\"" > /etc/default/telegraf diff --git a/ansible/roles/tsg_sn/files/read_sn_to_env.sh b/ansible/roles/tsg_sn/files/read_sn_to_env.sh new file mode 100644 index 00000000..a4dbd9e8 --- /dev/null +++ b/ansible/roles/tsg_sn/files/read_sn_to_env.sh @@ -0,0 +1,39 @@ +#!/bin/bash -x +DEVICE_TYPE= +SN= + +function read_device_type() +{ + product_name_9000_NPB=("ACB300") + + product_name=`ipmitool fru list | grep 'Board Product' | awk '{print $4}'` + if [[ "${product_name_9000_NPB[@]}" =~ "${product_name}" ]]; then + DEVICE_TYPE="9000-NPB" + fi +} + +function read_sn() +{ + if [ ${DEVICE_TYPE} == "9000-NPB" ]; then + SN=`ipmitool fru -t 130 | awk 'NR==12' | awk '{ print $4}'` + else + SN=`ipmitool fru list | grep 'Product Serial' | awk '{ print $4}'` + fi + + if [ -z "${SN}" ]; then + SN="unknown" + fi +} + +function add_sn_env() +{ + env_profile="/etc/profile.d/sn.sh" + + #export SN=${SN}. Not set in present session. + echo "export SN=${SN}" > ${env_profile} + chmod 0755 ${env_profile} +} + +read_device_type +read_sn +add_sn_env
\ No newline at end of file diff --git a/ansible/roles/tsg_sn/tasks/main.yml b/ansible/roles/tsg_sn/tasks/main.yml index aae45cd7..e4f15687 100644 --- a/ansible/roles/tsg_sn/tasks/main.yml +++ b/ansible/roles/tsg_sn/tasks/main.yml @@ -1,10 +1,11 @@ --- -- name: "Create /opt/tsg/tsg-os-provision/scripts/" +- name: "7400-mcn0 & 7400-mcn123: Create /opt/tsg/tsg-os-provision/scripts/" file: path: "/opt/tsg/tsg-os-provision/scripts/" state: directory + when: runtime_env == 'TSG-7400-mcn0' or runtime_env == 'TSG-7400-mcn123' -- name: "deploy obtain sn tsg-7400" +- name: "7400-mcn0 & 7400-mcn123: Deploy obtain_sn.sh" copy: src: "{{ role_path }}/files/{{ item.src }}" dest: "/opt/tsg/tsg-os-provision/scripts/{{ item.dest }}" @@ -14,24 +15,15 @@ - { "src": "cmm_api_tst", "dest": "cmm_api_tst" } when: runtime_env == 'TSG-7400-mcn0' or runtime_env == 'TSG-7400-mcn123' -- name: "deploy obtain sn - tsg-9140" - copy: - src: "{{ role_path }}/files/obtain_sn.sh.TSG9140" - dest: /opt/tsg/tsg-os-provision/scripts/obtain_sn.sh - mode: 0755 - when: runtime_env == 'TSG-9140' - -- name: "deploy obtain sn - tsg-x-P0906" - copy: - src: "{{ role_path }}/files/obtain_sn.sh.TSGXP1403" - dest: /opt/tsg/tsg-os-provision/scripts/obtain_sn.sh - mode: 0755 +- name: "TSG-X: Create /opt/tsg/scripts/" + file: + path: "/opt/tsg/scripts/" + state: directory when: runtime_env == 'TSG-X-P0906' - -- name: "deploy obtain sn - tsg-x-p0906" +- name: "TSG-X: Deploy obtain-sn.sh" copy: - src: "{{ role_path }}/files/obtain_sn.sh.TSGXP0906-init" - dest: /opt/tsg/tsg-os-provision/scripts/obtain_sn.sh + src: "{{ role_path }}/files/read_sn_to_env.sh" + dest: /opt/tsg/scripts/read_sn_to_env.sh mode: 0755 - when: runtime_env == 'TSG-X-P0906' and PROFILE_ID == 'TSG-X-NXR620G40-R01-P0906-init'
\ No newline at end of file + when: runtime_env == 'TSG-X-P0906'
\ No newline at end of file diff --git a/ansible/roles/tuned/tasks/main.yml b/ansible/roles/tuned/tasks/main.yml index f933b1bb..d6479c49 100644 --- a/ansible/roles/tuned/tasks/main.yml +++ b/ansible/roles/tuned/tasks/main.yml @@ -5,8 +5,6 @@ mode: 0755 with_items: - 371.patch - when: runtime_env == 'TSG-X-P0906' - - name: "Create /etc/tuned/tsg-os-cpu-partitioning directory if it does not exist" file: @@ -23,17 +21,12 @@ mode: 0755 with_items: - tuned.conf - when: runtime_env == 'TSG-X-P0906' - - name: "patch plugin_scheduler.py" shell: cd /usr/lib/python3.6/site-packages && patch -p1 -t < /tmp/371.patch || true - when: runtime_env == 'TSG-X-P0906' - name: "apply tsg-os-cpu-partitioning profile" shell: tuned-adm profile tsg-os-cpu-partitioning - when: runtime_env == 'TSG-X-P0906' - name: "make tuned server run after HAL" shell: sed -i 's/After=/&tsg-os-HAL.service /' /usr/lib/systemd/system/tuned.service - when: runtime_env == 'TSG-X-P0906' diff --git a/ansible/roles/wannat_common/tasks/main.yml b/ansible/roles/wannat_common/tasks/main.yml index efdf5e2d..5914419c 100644 --- a/ansible/roles/wannat_common/tasks/main.yml +++ b/ansible/roles/wannat_common/tasks/main.yml @@ -10,7 +10,7 @@ - /tmp/nanomsg-1.1.5-6.el7.x86_64.rpm state: present disable_gpg_check: yes - when: runtime_env == 'TSG-7400-mcn0' or runtime_env == 'TSG-7400-mcn123' or runtime_env == 'TSG-9140' + when: runtime_env == 'TSG-7400-mcn0' or runtime_env == 'TSG-7400-mcn123' - name: "install nanomsg library rockylinux8" yum: diff --git a/installer/install.sh b/installer/install.sh index 5fdb0245..c55c0128 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -27,6 +27,7 @@ distro_mnt=/mnt/distro onie_root_dir=/mnt/onie-boot/onie kernel_args="%%KERNAL_ARGS%%" +kernel_args_device_9000="%%KERNEL_ARGS_9000_NPB%%" grub_serial_command="%%GRUB_SERIAL_COMMAND%%" DISTR0_VER="%%DISTR0_VER%%" MACHINE_ID="%%MACHINE_ID%%" @@ -210,6 +211,32 @@ install_uefi_grub() } +# patch install. +DEVICE_TYPE= +read_device_type() +{ + product_name=`ipmitool fru list | grep 'Board Product' | awk '{print $4}'` + if [[ "${product_name}" == "ACB300" ]]; then + DEVICE_TYPE="9000-NPB" + fi +} + +install_patches() +{ + if [ ${DEVICE_TYPE} == "9000-NPB" ]; then + chmod 0755 ./tsg-os_9000-NPB-P01R01_patch.bin + cp ./tsg-os_9000-NPB-P01R01_patch.bin ${distro_mnt}/tmp + chroot ${distro_mnt} /tmp/tsg-os_9000-NPB-P01R01_patch.bin + rm ${distro_mnt}/tmp/tsg-os_9000-NPB-P01R01_patch.bin + fi +} + +append_kernel_args() +{ + if [ ${DEVICE_TYPE} == "9000-NPB" ]; then + kernel_args="${kernel_args} ${kernel_args_device_9000}" + fi +} ############################### START AT HERE ######################################### lib_dir="/lib/onie" . $lib_dir/onie-blkdev-common @@ -281,6 +308,10 @@ mount -t ext4 ${blk_dev}${exp_part_tsg_os_data} ${distro_mnt}/data echo "Setting up TSG-OS sysroot .." chroot ${distro_mnt} /distro-setup.sh ${blk_dev} +read_device_type +install_patches +append_kernel_args + [ -e ${distro_mnt}/dev/pts ] && { umount ${distro_mnt}/dev/pts } diff --git a/make/Makefile.9000NPBP01R01 b/make/Makefile.9000NPBP01R01 deleted file mode 100644 index a7e38956..00000000 --- a/make/Makefile.9000NPBP01R01 +++ /dev/null @@ -1,72 +0,0 @@ - -PROFILE_ID := 9000-NPB-P01R01 -SUPPORTED_MACHINE_ID := 9000-NPB-P01R01 -KERNEL_ARGS := console=ttyS0,115200n8 crashkernel=512M default_hugepagesz=1G hugepagesz=1G hugepages=16 intel_iommu=on iommu=pt mitigations=off pci=realloc,assign-busses psi=1 isolcpus=1-47 selinux=0 transparent_hugepage=never processor.max_cstate=0 intel_idle.max_cstate=0 intel_pstate=disable -GRUB_SERIAL_COMMAND := -SIZE_PART_SYSROOT := 16384M -SIZE_PART_UPDATE := 16384M - -PROFILE_ID_IN_SHORT := $(subst -,$e,$(PROFILE_ID)) -CHROOT_PKG := tsg-os-${OS_RELEASE_VER}-${PROFILE_ID_IN_SHORT}-chroot.tar.bz2 -CHROOT_BIN := tsg-os-${OS_RELEASE_VER}-${PROFILE_ID_IN_SHORT}-ONIE.bin - -TARGET_BUILD_DIR := $(BUILDDIR_BASE)/$(PROFILE_ID) -TARGET_INSTALLER_DIR := $(TARGET_BUILD_DIR)/installer -TARGET_SYSROOT_DIR := $(TARGET_BUILD_DIR)/sysroot - -.PHONY: all builddir installer sysroot-base sysroot-ansible sysroot-cleanup sysroot-archive sysroot-binary clean - -all: sysroot-binary - -builddir: - mkdir -p $(TARGET_BUILD_DIR) - -installer: builddir - rm -rf $(TARGET_INSTALLER_DIR) - mkdir -p $(TARGET_INSTALLER_DIR) - cp $(INSTALLERDIR)/install.sh $(TARGET_INSTALLER_DIR)/install.sh - cp $(INSTALLERDIR)/distro-setup.sh $(TARGET_INSTALLER_DIR)/distro-setup.sh - chmod +x $(TARGET_INSTALLER_DIR)/install.sh - chmod +x $(TARGET_INSTALLER_DIR)/distro-setup.sh - - sed -i -e "s/%%DISTR0_VER%%/$(OS_RELEASE_VER)/" $(TARGET_INSTALLER_DIR)/install.sh - sed -i -e "s/%%MACHINE_ID%%/$(SUPPORTED_MACHINE_ID)/" $(TARGET_INSTALLER_DIR)/install.sh - sed -i -e "s/%%CHROOT_PKG%%/$(CHROOT_PKG)/" $(TARGET_INSTALLER_DIR)/install.sh - sed -i -e "s/%%KERNAL_ARGS%%/$(KERNEL_ARGS)/" $(TARGET_INSTALLER_DIR)/install.sh - sed -i -e "s/%%GRUB_SERIAL_COMMAND%%/$(GRUB_SERIAL_COMMAND)/" $(TARGET_INSTALLER_DIR)/install.sh - sed -i -e "s/%%SIZE_PART_SYSROOT%%/$(SIZE_PART_SYSROOT)/" $(TARGET_INSTALLER_DIR)/install.sh - sed -i -e "s/%%SIZE_PART_UPDATE%%/$(SIZE_PART_UPDATE)/" $(TARGET_INSTALLER_DIR)/install.sh - - sed -i '/sapp-pr:/d;/tfe-pr:/d;/mrzcpd-icelake-server:/d;/mrzcpd-znver1:/d;/mrzcpd-corei7:/d' $(PROJECTDIR)/ansible/install_config/group_vars/rpm_version.yml - -sysroot-base: builddir - $(TOOLSDIR)/mk-base-image $(CONFDIR)/yum-CentOS-7.conf $(TARGET_SYSROOT_DIR) $(PROJECTDIR) $(PROFILE_ID) - -sysroot-verfile: sysroot-base - sed -i -e "s/^NAME=.*/NAME=\"TSG-OS\"/" $(TARGET_SYSROOT_DIR)/usr/lib/os-release - sed -i -e "s/^VERSION=.*/VERSION=\"$(OS_RELEASE_VER) ($(PROFILE_ID_IN_SHORT))\"/" $(TARGET_SYSROOT_DIR)/usr/lib/os-release - sed -i -e "s/^PRETTY_NAME=.*/PRETTY_NAME=\"TSG-OS $(OS_RELEASE_VER) ($(PROFILE_ID_IN_SHORT))\"/" $(TARGET_SYSROOT_DIR)/usr/lib/os-release - -sysroot-ansible: sysroot-verfile sysroot-base - cp $(CONFDIR)/yum-CentOS-7.conf $(TARGET_SYSROOT_DIR)/tmp/ -r - cp /etc/resolv.conf $(TARGET_SYSROOT_DIR)/etc/ -r - cp $(TARGET_SYSROOT_DIR)/etc/hosts $(TARGET_SYSROOT_DIR)/tmp/ -r - cp /etc/hosts $(TARGET_SYSROOT_DIR)/etc/ -r - $(TOOLSDIR)/ansible-HAL $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR) /tmp/yum-CentOS-7.conf $(OS_RELEASE_VER) - cp $(TARGET_SYSROOT_DIR)/tmp/hosts $(TARGET_SYSROOT_DIR)/etc/ -r - rm -rf $(TARGET_SYSROOT_DIR)/etc/resolv.conf - -sysroot-cleanup: - rm -rf $(TARGET_SYSROOT_DIR)/tmp/* - rm -rf $(TARGET_SYSROOT_DIR)/dev/* - -sysroot-archive: installer sysroot-ansible sysroot-cleanup - tar --exclude=*~ --exclude-backups --owner=root --group=root -c -C $(TARGET_SYSROOT_DIR) . | pbzip2 -p9 > $(TARGET_INSTALLER_DIR)/$(CHROOT_PKG) - -sysroot-binary: sysroot-archive - mkdir -p $(TARGET_BUILD_DIR)/cook-bits - $(TOOLSDIR)/cook-bits $(TARGET_BUILD_DIR) $(TARGET_BUILD_DIR)/cook-bits $(IMAGEDIR_BASE)/$(CHROOT_BIN) - sha256sum $(IMAGEDIR_BASE)/$(CHROOT_BIN) | awk '{print $$1}' > $(IMAGEDIR_BASE)/$(CHROOT_BIN).sha256sum.txt - -clean: - rm -rf $(TARGET_BUILD_DIR)
\ No newline at end of file diff --git a/make/Makefile.TSGXNXR620G40R01P0906 b/make/Makefile.TSGXNXR620G40R01P0906 index 7db8fa4f..ed2e0a88 100644 --- a/make/Makefile.TSGXNXR620G40R01P0906 +++ b/make/Makefile.TSGXNXR620G40R01P0906 @@ -2,6 +2,7 @@ PROFILE_ID := TSG-X-NXR620G40-R01-P0906 SUPPORTED_MACHINE_ID := TSG-X-NXR620G40-R01-P0906 KERNEL_ARGS := crashkernel=512M default_hugepagesz=1G intel_iommu=on iommu=pt mitigations=off psi=1 selinux=0 quiet splash transparent_hugepage=never processor.max_cstate=0 intel_idle.max_cstate=0 intel_pstate=disable +KERNEL_ARGS_9000_NPB := console=ttyS0,115200n8 pci=realloc,assign-busses GRUB_SERIAL_COMMAND := SIZE_PART_SYSROOT := 16384M SIZE_PART_UPDATE := 16384M @@ -17,7 +18,7 @@ MRZCPD_DEVICE_PLUGIN_FILE_PATH := /ansible/roles/k3s-install/files/daemonset-mr MRZCPD_DEVICE_PLUGIN_IMAGE_TAG := ${OS_RELEASE_VER} TARGET_SYSROOT_DIR := $(TARGET_BUILD_DIR)/sysroot -.PHONY: all builddir installer sysroot-base sysroot-cleanup sysroot-archive sysroot-binary add-images-into-sysroot clean +.PHONY: all builddir installer sysroot-base sysroot-cleanup sysroot-archive sysroot-binary add-images-into-installer-dir add-patch-into-installer-dir clean all: sysroot-binary @@ -36,6 +37,7 @@ installer: builddir sed -i -e "s/%%MACHINE_ID%%/$(SUPPORTED_MACHINE_ID)/" $(TARGET_INSTALLER_DIR)/install.sh sed -i -e "s/%%CHROOT_PKG%%/$(CHROOT_PKG)/" $(TARGET_INSTALLER_DIR)/install.sh sed -i -e "s/%%KERNAL_ARGS%%/$(KERNEL_ARGS)/" $(TARGET_INSTALLER_DIR)/install.sh + sed -i -e "s/%%KERNEL_ARGS_9000_NPB%%/$(KERNEL_ARGS_9000_NPB)/" $(TARGET_INSTALLER_DIR)/install.sh sed -i -e "s/%%GRUB_SERIAL_COMMAND%%/$(GRUB_SERIAL_COMMAND)/" $(TARGET_INSTALLER_DIR)/install.sh sed -i -e "s/%%SIZE_PART_SYSROOT%%/$(SIZE_PART_SYSROOT)/" $(TARGET_INSTALLER_DIR)/install.sh sed -i -e "s/%%SIZE_PART_UPDATE%%/$(SIZE_PART_UPDATE)/" $(TARGET_INSTALLER_DIR)/install.sh @@ -68,10 +70,13 @@ sysroot-cleanup: rm -rf $(TARGET_SYSROOT_DIR)/tmp/* rm -rf $(TARGET_SYSROOT_DIR)/dev/* -add-images-into-sysroot: builddir sysroot-verfile sysroot-ansible +add-patch-into-installer-dir: + cp $(TARGET_SYSROOT_DIR)/tmp/9000_NPB/tsg-os_9000-NPB-P01R01_patch.bin $(TARGET_INSTALLER_DIR)/tsg-os_9000-NPB-P01R01_patch.bin + +add-images-into-installer-dir: builddir sysroot-verfile sysroot-ansible cp $(IMAGEDIR_BASE)/$(APP_BUNDLE_BIN) $(TARGET_INSTALLER_DIR)/$(APP_BUNDLE_BIN) -sysroot-archive: installer add-images-into-sysroot sysroot-cleanup +sysroot-archive: installer add-images-into-installer-dir add-patch-into-installer-dir sysroot-cleanup cp $(IMAGEDIR_BASE)/80-tfe.conf $(TARGET_SYSROOT_DIR)/usr/lib/sysctl.d/ tar --exclude=*~ --exclude-backups --owner=root --group=root -c -C $(TARGET_SYSROOT_DIR) . | pbzip2 -p9 > $(TARGET_INSTALLER_DIR)/$(CHROOT_PKG) diff --git a/tools/ansible-HAL-server b/tools/ansible-HAL-server deleted file mode 100644 index d2acc80a..00000000 --- a/tools/ansible-HAL-server +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -PROFILE_ID=$1 -PROJECTDIR=$2 -TARGET_DIR=$3 -YUM_CONF_PATH=$4 - -echo "----------------------------- Ansible HAL-server ----------------------------" -echo "$PROFILE_ID" - -echo "[$PROFILE_ID]" > $PROJECTDIR/ansible/install_config/hosts -echo "server ansible_connection=local" >> $PROJECTDIR/ansible/install_config/hosts -ansible-playbook -i $PROJECTDIR/ansible/install_config/hosts $PROJECTDIR/ansible/HAL_deploy.yml -e "rpm_repo_config_path=$YUM_CONF_PATH PROFILE_ID=$PROFILE_ID path_download=$TARGET_DIR" |
