190 lines
5.6 KiB
YAML
190 lines
5.6 KiB
YAML
---
|
|
- 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: "Install python module"
|
|
shell: pip2 install -i https://pypi.tuna.tsinghua.edu.cn/simple PrettyTable==0.7.2
|
|
when: runtime_env == 'TSG-X-P0906'
|
|
|
|
- name: "Install python3 module and dependent package"
|
|
shell: yum install -y lshw python3 which pciutils iproute vim kmod libnl3-devel perl-generators iptables-devel numactl-libs
|
|
when: runtime_env == 'TSG-X-P0906'
|
|
|
|
- name: "Install mrzcpd rpm package"
|
|
shell: rpm -i /tmp/rpm_download/{{ item.value }}* --prefix {{ prefix_path.mrzcpd }}
|
|
with_dict: "{{ mrzcpd_rpm_version }}"
|
|
|
|
- name: "Install mlnx-ofed-user-space rpm package"
|
|
yum:
|
|
name: "{{ item.value }}"
|
|
conf_file: "{{ rpm_repo_config_path }}"
|
|
state: present
|
|
with_dict: "{{ mlnx_ofed_user_space_only_rpm_version }}"
|
|
when: runtime_env == 'TSG-X-P0906'
|
|
|
|
- name: "update /etc/ld.so.conf.d/mrzcpd.conf"
|
|
template:
|
|
src: "{{ role_path }}/templates/mrzcpd.conf.j2"
|
|
dest: /etc/ld.so.conf.d/mrzcpd.conf
|
|
|
|
- name: "update sysconfig/mrzcpd"
|
|
template:
|
|
src: "{{ role_path }}/templates/mrzcpd.j2"
|
|
dest: /etc/sysconfig/mrzcpd
|
|
|
|
- name: "replace action: replace /opt/mrzcpd to /opt/tsg/mrzcpd"
|
|
replace:
|
|
path: "{{ item }}"
|
|
regexp: '/opt/mrzcpd'
|
|
replace: '{{ prefix_path.mrzcpd }}'
|
|
with_items:
|
|
- /etc/profile.d/mrzcpd.sh
|
|
- /opt/tsg/mrzcpd/lib/pkgconfig/mrzcpd.pc
|
|
- /usr/lib/systemd/system/mrapm_device.service
|
|
- /usr/lib/systemd/system/mrapm_stream.service
|
|
- /usr/lib/systemd/system/mrtunnat.service
|
|
- /usr/lib/systemd/system/mrzcpd.service
|
|
|
|
- name: "replace action: replace /opt/mrzcpd to /opt/tsg/mrzcpd"
|
|
replace:
|
|
path: "{{ item }}"
|
|
regexp: '/opt/mrzcpd'
|
|
replace: '{{ prefix_path.mrzcpd }}'
|
|
with_items:
|
|
- /usr/lib/systemd/system/mrenv.service
|
|
when: runtime_env != 'TSG-X-P0906'
|
|
|
|
- name: "replace action: replace /opt/mrzcpd to /opt/tsg/mrzcpd"
|
|
replace:
|
|
path: "{{ item }}"
|
|
regexp: '/opt/mrzcpd'
|
|
replace: '{{ prefix_path.mrzcpd }}'
|
|
with_items:
|
|
- /usr/lib/systemd/system/mrzcpd_hugepages_setup.service
|
|
- /usr/lib/systemd/system/mrzcpd_hwdb_setup.service
|
|
when: runtime_env == 'TSG-X-P0906'
|
|
|
|
- name: "copy replace.sh to dest"
|
|
copy:
|
|
src: "{{ role_path }}/files/replaceconf.sh"
|
|
dest: /opt/tsg/mrzcpd/bin/replaceconf.sh
|
|
mode: 0644
|
|
when: runtime_env == 'TSG-X-P0906'
|
|
|
|
|
|
|
|
- name: "replace action: replace Requires to Wants"
|
|
replace:
|
|
path: "{{ item }}"
|
|
regexp: 'Requires'
|
|
replace: 'Wants'
|
|
with_items:
|
|
- /usr/lib/systemd/system/mrapm_device.service
|
|
- /usr/lib/systemd/system/mrapm_stream.service
|
|
|
|
- name: "Create /usr/lib/systemd/system/mrzcpd.service.d directory if it does not exist"
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: '0755'
|
|
with_items:
|
|
- /usr/lib/systemd/system/mrzcpd.service.d
|
|
|
|
- name: "copy slice file to mrzcpd.service.d"
|
|
copy:
|
|
src: "{{ role_path }}/templates/service_override_slice.conf.j2"
|
|
dest: /usr/lib/systemd/system/mrzcpd.service.d/service_override_slice.conf
|
|
mode: 0644
|
|
when: runtime_env != 'TSG-X-P0906'
|
|
|
|
- name: "update mrglobal.conf - TSG7400 - mcn0"
|
|
template:
|
|
src: "{{ role_path }}/templates/mrglobal.conf.j2.j2.7400MCN0P01R01"
|
|
dest: /opt/tsg/tsg-os-provision/templates/mrglobal.conf.j2
|
|
when:
|
|
- runtime_env == 'TSG-7400-mcn0'
|
|
|
|
- name: "update mrglobal.conf - TSG7400 - mcn1 mcn2 mcn3"
|
|
template:
|
|
src: "{{ role_path }}/templates/mrglobal.conf.j2.7400MCN123P01R01"
|
|
dest: /opt/tsg/mrzcpd/etc/mrglobal.conf
|
|
when:
|
|
- runtime_env == 'TSG-7400-mcn123'
|
|
|
|
- name: "update mrglobal.conf - TSG-X-P0906"
|
|
copy:
|
|
src: "{{ role_path }}/templates/mrglobal.conf.TSGXNXR620G40R01P0906"
|
|
dest: /opt/tsg/mrzcpd/etc/mrglobal.conf
|
|
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/mrapm_device.service
|
|
- /usr/lib/systemd/system/mrapm_stream.service
|
|
- /usr/lib/systemd/system/mrenv.service
|
|
- /usr/lib/systemd/system/mrtunnat.service
|
|
- /usr/lib/systemd/system/mrzcpd.service
|
|
when: runtime_env != 'TSG-X-P0906'
|
|
|
|
- name: "copy add_dev_to_bridge to mrzcpd.service.d"
|
|
copy:
|
|
src: "{{ role_path }}/templates/service_add_dev_to_bridge.conf"
|
|
dest: /usr/lib/systemd/system/mrzcpd.service.d/
|
|
mode: 0644
|
|
when: runtime_env == 'TSG-X-P0906'
|
|
|
|
- name: "copy add_timeout_setting to mrzcpd.service.d"
|
|
copy:
|
|
src: "{{ role_path }}/templates/service_add_timeout_setting.conf"
|
|
dest: /usr/lib/systemd/system/mrzcpd.service.d/
|
|
mode: 0644
|
|
|
|
##################### mrzcpd #####################
|
|
- name: "enable mrenv"
|
|
systemd:
|
|
name: mrenv
|
|
enabled: yes
|
|
when: runtime_env != 'TSG-X-P0906'
|
|
|
|
- name: "enable mrzcpd_hugepages_setup"
|
|
systemd:
|
|
name: mrzcpd_hugepages_setup
|
|
enabled: yes
|
|
when: runtime_env == 'TSG-X-P0906'
|
|
|
|
|
|
- name: "enable mrzcpd_hwdb_setup"
|
|
systemd:
|
|
name: mrzcpd_hwdb_setup
|
|
enabled: yes
|
|
when: runtime_env == 'TSG-X-P0906'
|
|
|
|
- name: "enable mrzcpd"
|
|
systemd:
|
|
name: mrzcpd
|
|
enabled: yes
|
|
when: runtime_env != 'TSG-X-P0906'
|
|
|
|
- name: "enable prometheus output - monit_device"
|
|
systemd:
|
|
name: mrapm_device
|
|
enabled: yes
|
|
when: runtime_env != 'TSG-X-P0906'
|
|
|
|
- name: "enable prometheus output - monit_stream"
|
|
systemd:
|
|
name: mrapm_stream
|
|
enabled: yes
|
|
when: runtime_env != 'TSG-X-P0906'
|