diff --git a/install_config/group_vars/platform.yml b/install_config/group_vars/platform.yml index f8a2627..b312d31 100644 --- a/install_config/group_vars/platform.yml +++ b/install_config/group_vars/platform.yml @@ -36,8 +36,10 @@ sapp: ######################################### #Sapp Double-Arm Config packet_io: - internal_interface: eth2 - external_interface: eth3 + internal_interface: + - eth2 + external_interface: + - eth3 ######################################### @@ -49,11 +51,20 @@ mrtunnat: lcore_id: 38 ######################################### -#Inline Device Config -inline_device_config: - keepalive_ip: 192.168.1.30 - keepalive_mask: 255.255.255.252 - data_incoming: eth5 +#Inline Device Config list +inline_device_config_list: + - keepalive_ip: 192.168.1.30 + keepalive_mask: 255.255.255.252 + data_incoming: eth5 + +####for example: +#inline_device_config_list: +# - keepalive_ip: 192.168.1.30 +# keepalive_mask: 255.255.255.252 +# data_incoming: eth5 +# - keepalive_ip: 192.168.1.30 +# keepalive_mask: 255.255.255.252 +# data_incoming: eth6 ######################################### diff --git a/roles/mrzcpd/templates/server_inline/mrglobal.conf.server_inline.j2 b/roles/mrzcpd/templates/server_inline/mrglobal.conf.server_inline.j2 index 2c87167..7c011d6 100644 --- a/roles/mrzcpd/templates/server_inline/mrglobal.conf.server_inline.j2 +++ b/roles/mrzcpd/templates/server_inline/mrglobal.conf.server_inline.j2 @@ -1,16 +1,22 @@ +{% set data_incoming_list = [] %} +{% for device_config in inline_device_config_list %} +{% set tmp = data_incoming_list.append(device_config.data_incoming) %} +{% endfor %} [device] -device={{inline_device_config.data_incoming}},vxlan_user,vxlan_fwd +device={{ data_incoming_list | join(",") }},vxlan_user,vxlan_fwd sz_tunnel=8192 sz_buffer=0 -[device:{{inline_device_config.data_incoming}}] +{% for device_config in inline_device_config_list %} +[device:{{device_config.data_incoming}}] {% if traffic_attr_type == 0 %} -in_addr={{inline_device_config.keepalive_ip}} -in_mask={{inline_device_config.keepalive_mask}} +in_addr={{device_config.keepalive_ip}} +in_mask={{device_config.keepalive_mask}} {% endif %} jumbo_frame=1 max_rx_pkt_len=15360 clear_tx_flags=1 +{% endfor %} #[device:] #jumbo_frame=1 @@ -42,8 +48,8 @@ sz_cache=256 sz_data=4096 [forward] -nr_forward_rule=4 -forward_rule_0=pv,{{inline_device_config.data_incoming}},{{inline_device_config.data_incoming}} -forward_rule_1=vp,{{inline_device_config.data_incoming}},{{inline_device_config.data_incoming}} -forward_rule_2=vv,vxlan_fwd,vxlan_user -forward_rule_3=vv,vxlan_user,vxlan_fwd +#nr_forward_rule=4 +#forward_rule_0=pv,{{inline_device_config.data_incoming}},{{inline_device_config.data_incoming}} +#forward_rule_1=vp,{{inline_device_config.data_incoming}},{{inline_device_config.data_incoming}} +#forward_rule_2=vv,vxlan_fwd,vxlan_user +#forward_rule_3=vv,vxlan_user,vxlan_fwd diff --git a/roles/sapp/templates/sapp.toml.j2 b/roles/sapp/templates/sapp.toml.j2 index 3bb7e31..bf66320 100644 --- a/roles/sapp/templates/sapp.toml.j2 +++ b/roles/sapp/templates/sapp.toml.j2 @@ -81,7 +81,7 @@ dictator_enable=0 [packet_io.internal.interface] {% if capture_packet_type == 0 %} type=pcap - name={{packet_io.internal_interface}} + name={{packet_io.internal_interface | join(",")}} {% else %} type=marsio name={{nic_data_incoming.name}} @@ -90,7 +90,7 @@ dictator_enable=0 [packet_io.external.interface] {% if capture_packet_type == 0 %} type=pcap - name={{packet_io.external_interface}} + name={{packet_io.external_interface | join(",")}} {% else %} type=pcap name=lo diff --git a/tasks/collect/collect_rpm_info.yml b/tasks/collect/collect_rpm_info.yml new file mode 100644 index 0000000..cdacf85 --- /dev/null +++ b/tasks/collect/collect_rpm_info.yml @@ -0,0 +1,41 @@ +- hosts: platform + remote_user: root + tasks: + - name: "collect rpm info: excute shell to get rpm install info" + shell: rpm -q {{item}} + with_items: + - libcjson + - libdocumentanalyze + - libmaatframe + - libMESA_field_stat + - libMESA_field_stat2 + - libMESA_handle_logger + - libMESA_htable + - libMESA_prof_load + - librdkafka + - librulescan + - libtsglua + - libwiredcfg + - libWiredLB + - lz4 + - libbreakpad_mini + - dns + - ftp + - http + - mail + - quic + - ssl + - mrzcpd + - sapp + register: rpm_results + ignore_errors: yes + + - name: "collect rpm info: combine list format for output rpm install infomation" + set_fact: + install_info: '{{ install_info | default([]) + [{"name": item.item, "uninstall": item.failed, "version": item.stdout}] | list }}' + with_items: "{{ rpm_results.results }}" + + + - name: "collect rpm info: output rpm install infomation" + debug: + var: install_info \ No newline at end of file diff --git a/tasks/unistall/uninstall_firewall.yml b/tasks/unistall/uninstall_firewall.yml new file mode 100644 index 0000000..7f43e70 --- /dev/null +++ b/tasks/unistall/uninstall_firewall.yml @@ -0,0 +1,14 @@ +- hosts: platform + remote_user: root + tasks: + - name: "uninstall firewall: absent firewall rpm packages" + yum: + name: "{{ item }}" + state: absent + with_items: + - dns + - ftp + - http + - mail + - quic + - ssl \ No newline at end of file diff --git a/tasks/unistall/uninstall_framework.yml b/tasks/unistall/uninstall_framework.yml new file mode 100644 index 0000000..e2fc4fd --- /dev/null +++ b/tasks/unistall/uninstall_framework.yml @@ -0,0 +1,24 @@ +- hosts: paltform + remote_user: root + tasks: + - name: "uninstall framework: absent framework rpm packages" + yum: + name: "{{ item }}" + state: absent + #skip_broken: yes + with_items: + - libcjson + - libdocumentanalyze + - libmaatframe + - libMESA_field_stat + - libMESA_field_stat2 + - libMESA_handle_logger + - libMESA_htable + - libMESA_prof_load + - librdkafka + - librulescan + - libtsglua + - libwiredcfg + - libWiredLB + - lz4 + - libbreakpad_mini \ No newline at end of file diff --git a/tasks/unistall/uninstall_mrzcpd.yml b/tasks/unistall/uninstall_mrzcpd.yml new file mode 100644 index 0000000..adfc137 --- /dev/null +++ b/tasks/unistall/uninstall_mrzcpd.yml @@ -0,0 +1,14 @@ +- hosts: platform + remote_user: root + tasks: + - name: "uninstall mrzcpd: stop mrzcpd.service" + systemd: + name: "{{ item }}" + state: stopped + with_items: + - mrzcpd.service + + - name: "uninstall mrzcpd:absent mrzcpd rpm package" + yum: + name: mrzcpd + state: absent \ No newline at end of file diff --git a/tasks/unistall/uninstall_platform.yml b/tasks/unistall/uninstall_platform.yml new file mode 100644 index 0000000..74f31d6 --- /dev/null +++ b/tasks/unistall/uninstall_platform.yml @@ -0,0 +1,5 @@ +--- +- include: uninstall_firewall.yml +- include: uninstall_sapp.yml +- include: uninstall_mrzcpd.yml +- include: uninstall_framework.yml \ No newline at end of file diff --git a/tasks/unistall/uninstall_sapp.yml b/tasks/unistall/uninstall_sapp.yml new file mode 100644 index 0000000..08e9a0e --- /dev/null +++ b/tasks/unistall/uninstall_sapp.yml @@ -0,0 +1,14 @@ +- hosts: platform + remote_user: root + tasks: + - name: "uninstall sapp: stop sapp.service" + systemd: + name: "{{ item }}" + state: stopped + with_items: + - sapp.service + + - name: "uninstall sapp:absent sapp rpm package" + yum: + name: sapp + state: absent \ No newline at end of file