7400 adapt:修改stage2阶段根据NPB设备类型确定的配置项的操作

This commit is contained in:
fumingwei
2021-06-18 11:22:44 +08:00
parent 8999bc0805
commit e4aa2f778d
8 changed files with 42 additions and 53 deletions

View File

@@ -8,6 +8,8 @@ firewall:
main_conf:
TSG_LOG:
NIC_NAME: eth_ctl
SYSTEM:
NIC_NAME: eth_ctl
kni:
kni_conf:
@@ -48,6 +50,7 @@ sapp:
Module:
pcapdevice: eth_raw
sendto_gdev_card: eth_raw
sendto_gdev_ip: '{% raw %}{{ keep_alive_ip }}{% endraw %}'
sapp_toml:
CPU:
worker_threads: 42
@@ -56,6 +59,8 @@ sapp:
PACKET_IO:
packet_io_internal_interface:
name: eth_raw
overlay_tunnel_definition:
overlay_mode: '{% raw %}{{ sapp_overlay_mode }}{% endraw %}'
tfe:
tfe_env_config:
@@ -73,6 +78,10 @@ tfe:
cert_store_host: 192.168.100.1
kafka:
NIC_NAME: eth_ctl
traffic_mirror:
enable: 1
device: '{% raw %}{{ tfe_traffic_mirror_device }}{% endraw %}'
type: '{% raw %}{{ tfe_traffic_mirror_type }}{% endraw %}'
tsg_diagnose:
docker_compose_yml:

View File

@@ -8,6 +8,8 @@ firewall:
main_conf:
TSG_LOG:
NIC_NAME: enp130s2f3
SYSTEM:
NIC_NAME: enp130s2f3
kni:
kni_conf:
@@ -35,6 +37,7 @@ sapp:
Module:
pcapdevice: enp1s2
sendto_gdev_card: enp1s2
sendto_gdev_ip: '{% raw %}10.253.{{ keepalive_subnet_ip }}.1{% endraw %}'
sapp_toml:
CPU:
worker_threads: 22
@@ -43,6 +46,8 @@ sapp:
PACKET_IO:
packet_io_internal_interface:
name: enp1s2
overlay_tunnel_definition:
overlay_mode: vxlan
tfe:
tfe_env_config:
@@ -60,6 +65,10 @@ tfe:
cert_store_host: 127.0.0.1
kafka:
NIC_NAME: enp130s2f3
traffic_mirror:
enable: 0
device: lo
type: 0
tsg_diagnose:
docker_compose_yml:

View File

@@ -63,12 +63,7 @@ OUTPUT_PATH="./tsg_stat.log"
APP_NAME="tsg_master"
[SYSTEM]
{% if PROFILE_ID == '9000-NPB-P01R01' %}
NIC_NAME="enp130s2f3"
{% endif %}
{% if PROFILE_ID == '7400-MCN0-P01R01' %}
NIC_NAME="eth_ctl"
{% endif %}
NIC_NAME="{{ firewall.main_conf.SYSTEM.NIC_NAME }}"
{% raw %}
ENTRANCE_ID={{ tsg_master_entrance_id }}
{% endraw %}

View File

@@ -1,21 +1,5 @@
[Module]
pcapdevice={{ sapp.gdev_conf.Module.pcapdevice }}
sendto_gdev_card={{ sapp.gdev_conf.Module.sendto_gdev_card }}
{% if PROFILE_ID == '9000-NPB-P01R01' %}
{% raw %}
sendto_gdev_ip=10.253.{{ keepalive_subnet_ip }}.1
{% endraw %}
{% endif %}
{% if PROFILE_ID == '7400-MCN0-P01R01' %}
{% raw %}
{% if NPB_device == 'tera' %}
sendto_gdev_ip=192.0.2.253
{% endif %}
{% if NPB_device == 'inline_device' %}
sendto_gdev_ip={{ keep_alive_ip }}
{% endif %}
{% endraw %}
{% endif %}
sendto_gdev_ip={{ sapp.gdev_conf.Module.sendto_gdev_ip }}
gdev_status_switch=1

View File

@@ -25,19 +25,7 @@ dictator_enable=1
l2_l3_tunnel_support=1
### note, optional value is [none, vxlan]
{% if PROFILE_ID == '9000-NPB-P01R01' %}
overlay_mode=vxlan
{% endif %}
{% if PROFILE_ID == '7400-MCN0-P01R01' %}
{% raw %}
{% if NPB_device == 'inline_device' %}
overlay_mode=vxlan
{% endif %}
{% if NPB_device == 'tera' %}
overlay_mode=none
{% endif %}
{% endraw %}
{% endif %}
overlay_mode={{ sapp.sapp_toml.PACKET_IO.overlay_tunnel_definition.overlay_mode }}
[packet_io.feature]

View File

@@ -152,23 +152,10 @@ statsd_set_prometheus_port=9001
statsd_set_prometheus_url_path=/metrics
[traffic_mirror]
{% if PROFILE_ID == '9000-NPB-P01R01' %}
enable=0
device=lo
type=0
{% endif %}
{% if PROFILE_ID == '7400-MCN123-P01R01' %}
enable=1
{% raw %}
{% if NPB_device == 'tera' %}
device=eth_mirr_d
type=1
{% else %}
device=lo
type=0
{% endif %}
{% endraw %}
{% endif %}
enable={{ tfe.tfe_conf.traffic_mirror.enable }}
device={{ tfe.tfe_conf.traffic_mirror.device }}
type={{ tfe.tfe_conf.traffic_mirror.type }}
# 0:TRAFFIC_MIRROR_ETHDEV_AF_PACKET; 1:TRAFFIC_MIRROR_ETHDEV_MARSIO
type=0
table_info=resource/pangu/table_info_traffic_mirror.conf

View File

@@ -3,6 +3,14 @@
vars_files:
- '{{var_files_path}}'
tasks:
- name: "set sapp_overlay_mode var depend on NPB device"
set_fact:
sapp_overlay_mode: item.sapp_overlay_mode
when: NPB_device == item.NPB_device
with_items:
- { "sapp_overlay_mode": none, "NPB_device": tera }
- { "sapp_overlay_mode": vxlan, "NPB_device": inline_device }
- name: "tsg-os-provision: Template the asymmetric_presence_layer.conf.j2"
template:
src: ../templates/asymmetric_presence_layer.conf.j2

View File

@@ -8,6 +8,15 @@
path: /opt/tsg/etc
state: directory
- name: "set tfe.traffic_mirror device and type vars depend on NPB device"
set_fact:
tfe_traffic_mirror_device: item.tfe_traffic_mirror_device
tfe_traffic_mirror_type: item.tfe_traffic_mirror_type
when: NPB_device == item.NPB_device
with_items:
- { "tfe_traffic_mirror_device": eth_mirr_d, "tfe_traffic_mirror_type": 1, "NPB_device": tera }
- { "tfe_traffic_mirror_device": lo, "tfe_traffic_mirror_type": 0, "NPB_device": inline_device }
- name: "tsg-os-provision: obtain sn from mxn and write sn to tsg_sn.json"
shell: /opt/tsg/tsg-os-provision/tsg7400_obtain_sn_from_mxn.sh
register: result_exec_obtain_sn_and_write_sn_in_file