修改双臂模式部署部分内容

This commit is contained in:
zhangzhihan
2020-03-28 14:37:28 +08:00
parent dbb89f7b7e
commit f498412f66
6 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
[Unit]
Description=tsg tun mode env init
Requires=network.target
After=network.target
Before=mrenv.service
[Service]
ExecStart=/opt/tsg/env/setup
ExecStop=/opt/tsg/env/tsg-env_stop
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
RequiredBy=mrenv.service

Binary file not shown.

View File

@@ -0,0 +1,36 @@
---
- name: "copy vconfig-1.9-16.el7.x86_64.rpm"
copy:
src: "{{ role_path }}/files/vconfig-1.9-16.el7.x86_64.rpm"
dest: /tmp
- name: "template setup script"
template:
src: "{{ role_path }}/files/setup.j2"
dest: "/opt/tsg/env/setup"
mode: 0755
- name: "copy tsg-env-tun-mode.service"
copy:
src: "{{ role_path }}/files/tsg-env-tun-mode.service"
dest: "/usr/lib/systemd/system/"
mode: 0644
- name: "template tsg-env_stop"
template:
src: "{{ role_path }}/files/tsg-env_stop.j2"
dest: "/opt/tsg/env/tsg-env_stop"
mode: 0755
- name: "install vconfig rpms from localhost"
yum:
name:
- /tmp/vconfig-1.9-16.el7.x86_64.rpm
state: present
- name: "enable tsg-env-tun-mode"
systemd:
name: tsg-env-tun-mode
enabled: yes
daemon_reload: yes

View File

@@ -0,0 +1,5 @@
#!/bin/bash
modprobe 8021q
vconfig add {{ nic_mgr.name }} 100
vconfig set_flag {{ nic_mgr.name }}.100 1 1
ifconfig {{ nic_mgr.name }}.100 192.168.100.1 netmask 255.255.255.0 up

View File

@@ -0,0 +1,5 @@
#!/bin/bash
#
echo 0 >/sys/class/net/ens1/device/sriov_numvfs
ifconfig {{ nic_mgr.name }}.100 down
vconfig rem {{ nic_mgr.name }}.100