diff --git a/ansible/roles/consul/tasks/main.yml b/ansible/roles/consul/tasks/main.yml index 54dd07ce..76d14636 100644 --- a/ansible/roles/consul/tasks/main.yml +++ b/ansible/roles/consul/tasks/main.yml @@ -16,6 +16,7 @@ file: path: /etc/consul.d/ state: directory + mode: 0777 when: runtime_env != 'TSG-X-P0906' - name: "mkdir -p /opt/tsg/consul/bin" diff --git a/ansible/roles/sapp/files/start.sh b/ansible/roles/sapp/files/start.sh index c957d292..236bb880 100644 --- a/ansible/roles/sapp/files/start.sh +++ b/ansible/roles/sapp/files/start.sh @@ -17,6 +17,7 @@ copyConfigmap2Dest(){ /usr/bin/cp /opt/tsg/config/app_sketch_local.inf /opt/tsg/sapp/plug/business/app_sketch_local/app_sketch_local.inf /usr/bin/cp /opt/tsg/config/vlan_flipping_map.conf /opt/tsg/sapp/etc/vlan_flipping_map.conf /usr/bin/cp /opt/tsg/config/firewall.inf /opt/tsg/sapp/plug/business/firewall/firewall.inf + /usr/bin/cp /opt/tsg/config/necessary_plug_list.conf /opt/tsg/sapp/etc/necessary_plug_list.conf } prestart(){ diff --git a/ansible/roles/sapp/templates/necessary_plug_list.conf.j2 b/ansible/roles/sapp/templates/necessary_plug_list.conf.j2 index 965b51b7..817ac589 100644 --- a/ansible/roles/sapp/templates/necessary_plug_list.conf.j2 +++ b/ansible/roles/sapp/templates/necessary_plug_list.conf.j2 @@ -23,17 +23,13 @@ ./plug/business/tsg_conn_sketch/tsg_conn_sketch.inf ./plug/business/capture_packet_plug/capture_packet_plug.inf ./plug/business/kni/kni.inf -./plug/business/fw_ssl_plug/fw_ssl_plug.inf -./plug/business/fw_http_plug/fw_http_plug.inf ./plug/business/fw_dns_plug/fw_dns_plug.inf -./plug/business/fw_mail_plug/fw_mail_plug.inf -./plug/business/fw_ftp_plug/fw_ftp_plug.inf -./plug/business/fw_quic_plug/fw_quic_plug.inf -./plug/business/fw_voip_plug/fw_voip_plug.inf ./plug/business/conn_telemetry/conn_telemetry.inf ./plug/business/app_sketch_local/app_sketch_local.inf ./plug/protocol/gtp/gtp.inf ./plug/business/gtp_signaling_plug/gtp_signaling_plug.inf ./plug/business/http_healthcheck/http_healthcheck.inf ./plug/platform/tsg_ddos_sketch/tsg_ddos_sketch.inf -./plug/business/radius_collect_plug/radius_collect_plug.inf \ No newline at end of file +./plug/business/radius_collect_plug/radius_collect_plug.inf +./plug/platform/shaping_master/shaping_master.inf +./plug/business/firewall/firewall.inf \ No newline at end of file diff --git a/ansible/roles/sapp/templates/service_startpre.conf.j2 b/ansible/roles/sapp/templates/service_startpre.conf.j2 index 75b1d1a2..5553e725 100644 --- a/ansible/roles/sapp/templates/service_startpre.conf.j2 +++ b/ansible/roles/sapp/templates/service_startpre.conf.j2 @@ -1,2 +1,2 @@ [Service] -ExecStartPre=/opt/tsg/consul/bin/set_shaping_addr.sh \ No newline at end of file +ExecStartPre=/opt/tsg/sapp/bin/set_shaping_addr.sh \ No newline at end of file diff --git a/ansible/roles/shaping_master/task/main.yml b/ansible/roles/shaping_master/tasks/main.yml similarity index 100% rename from ansible/roles/shaping_master/task/main.yml rename to ansible/roles/shaping_master/tasks/main.yml diff --git a/ansible/roles/telegraf_statistic/files/telegraf-1.13.0-1.x86_64.rpm b/ansible/roles/telegraf_statistic/files/telegraf-1.13.0-1.x86_64.rpm deleted file mode 100644 index 0bb36814..00000000 Binary files a/ansible/roles/telegraf_statistic/files/telegraf-1.13.0-1.x86_64.rpm and /dev/null differ diff --git a/ansible/roles/telegraf_statistic/files/telegraf-1.25.0-1.x86_64.rpm b/ansible/roles/telegraf_statistic/files/telegraf-1.25.0-1.x86_64.rpm new file mode 100644 index 00000000..edeab546 Binary files /dev/null and b/ansible/roles/telegraf_statistic/files/telegraf-1.25.0-1.x86_64.rpm differ diff --git a/ansible/roles/telegraf_statistic/tasks/main.yml b/ansible/roles/telegraf_statistic/tasks/main.yml index 163f8a78..7e95d7d6 100644 --- a/ansible/roles/telegraf_statistic/tasks/main.yml +++ b/ansible/roles/telegraf_statistic/tasks/main.yml @@ -1,12 +1,12 @@ - name: "copy telegraf.rpm to destination server" copy: - src: "{{ role_path }}/files/telegraf-1.13.0-1.x86_64.rpm" + src: "{{ role_path }}/files/telegraf-1.25.0-1.x86_64.rpm" dest: /tmp - name: "install telegraf" yum: name: - - /tmp/telegraf-1.13.0-1.x86_64.rpm + - /tmp/telegraf-1.25.0-1.x86_64.rpm state: present disable_gpg_check: yes diff --git a/ansible/roles/telegraf_statistic/templates/telegraf_shaping.conf.j2.j2 b/ansible/roles/telegraf_statistic/templates/telegraf_shaping.conf.j2.j2 index ff089e95..8fc56038 100644 --- a/ansible/roles/telegraf_statistic/templates/telegraf_shaping.conf.j2.j2 +++ b/ansible/roles/telegraf_statistic/templates/telegraf_shaping.conf.j2.j2 @@ -2,13 +2,19 @@ [global_tags] device_id = "${device_id}" vsys_id = "{% raw %}{{ vsys_id }}{% endraw %}" -{% raw %}{% for device_tag in device.tags %} +{% raw %}{% if data_center.name is defined %} + data_center = "{{ data_center.name }}" +{% endif %} +{% if device.tags is defined %} +{% for device_tag in device.tags %} {% for key,value in device_tag.items() %} {{ key }} = "{{value}}" {% endfor %} {% endfor %} +{% endif %} {% endraw %} + [agent] interval = "1s" round_interval = true diff --git a/ansible/roles/telegraf_statistic/templates/telegraf_statistic.conf.j2.j2 b/ansible/roles/telegraf_statistic/templates/telegraf_statistic.conf.j2.j2 index 90a5f687..cd5325e8 100644 --- a/ansible/roles/telegraf_statistic/templates/telegraf_statistic.conf.j2.j2 +++ b/ansible/roles/telegraf_statistic/templates/telegraf_statistic.conf.j2.j2 @@ -1,11 +1,16 @@ [global_tags] device_id = "${device_id}" vsys_id = "{% raw %}{{ vsys_id }}{% endraw %}" -{% raw %}{% for device_tag in device.tags %} +{% raw %}{% if data_center.name is defined %} + data_center = "{{ data_center.name }}" +{% endif %} +{% if device.tags is defined %} +{% for device_tag in device.tags %} {% for key,value in device_tag.items() %} {{ key }} = "{{value}}" {% endfor %} {% endfor %} +{% endif %} {% endraw %} [agent] diff --git a/ansible/roles/traffic-engine/files/helm/conf/necessary_plug_list.conf b/ansible/roles/traffic-engine/files/helm/conf/necessary_plug_list.conf new file mode 100644 index 00000000..817ac589 --- /dev/null +++ b/ansible/roles/traffic-engine/files/helm/conf/necessary_plug_list.conf @@ -0,0 +1,35 @@ +#以下插件如果加载,初始化失败, sapp平台会退出; +#插件的路径来自配置文件 ./plug/conflist.inf, 不需要加段落标识[platform],[protocol],[business]等. +#If the following plugins fail to initialize, the sapp platform will exit. +#The name of the plugin comes from the configuration ./plug/conflist.inf, section identification is not required. + +./plug/platform/wannat/wangw.inf +./plug/platform/wire_graft/wire_graft.inf +./plug/platform/app_proto_identify/app_proto_identify.inf +./plug/platform/tsg_master/tsg_master.inf +./plug/protocol/sip/sip.inf +./plug/protocol/rtp/rtp.inf +./plug/protocol/ssl/ssl.inf +./plug/protocol/ssh/ssh.inf +./plug/protocol/http/http.inf +./plug/protocol/dns/dns.inf +./plug/protocol/mail/mail.inf +./plug/protocol/ftp/ftp.inf +./plug/protocol/quic/quic.inf +./plug/protocol/radius/radius.inf +./plug/protocol/rdp/rdp.inf +./plug/protocol/bgp/bgp.inf +./plug/protocol/l2tp_protocol_plug/l2tp_protocol_plug.inf +./plug/business/tsg_conn_sketch/tsg_conn_sketch.inf +./plug/business/capture_packet_plug/capture_packet_plug.inf +./plug/business/kni/kni.inf +./plug/business/fw_dns_plug/fw_dns_plug.inf +./plug/business/conn_telemetry/conn_telemetry.inf +./plug/business/app_sketch_local/app_sketch_local.inf +./plug/protocol/gtp/gtp.inf +./plug/business/gtp_signaling_plug/gtp_signaling_plug.inf +./plug/business/http_healthcheck/http_healthcheck.inf +./plug/platform/tsg_ddos_sketch/tsg_ddos_sketch.inf +./plug/business/radius_collect_plug/radius_collect_plug.inf +./plug/platform/shaping_master/shaping_master.inf +./plug/business/firewall/firewall.inf \ No newline at end of file diff --git a/ansible/roles/traffic-engine/files/helm/templates/sapp.yaml b/ansible/roles/traffic-engine/files/helm/templates/sapp.yaml index 0ca138e8..34891d1c 100644 --- a/ansible/roles/traffic-engine/files/helm/templates/sapp.yaml +++ b/ansible/roles/traffic-engine/files/helm/templates/sapp.yaml @@ -20,3 +20,4 @@ data: tsg_device_tag.json: {{ tpl (.Files.Get "conf/tsg_device_tag.json") . | quote }} app_sketch_local.inf: {{ tpl (.Files.Get "conf/app_sketch_local.inf") . | quote }} firewall.inf: {{ tpl (.Files.Get "conf/firewall.inf") . | quote }} + necessary_plug_list.conf: {{ tpl (.Files.Get "conf/necessary_plug_list.conf") . | quote }} \ No newline at end of file diff --git a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.7400MCN0P01R01 b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.7400MCN0P01R01 index dd1e6d71..1e68d67f 100644 --- a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.7400MCN0P01R01 +++ b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.7400MCN0P01R01 @@ -171,6 +171,12 @@ 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: template wannat wangw.conf file" template: src: "../templates/wangw.conf.j2" diff --git a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.9000NPBP01R01 b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.9000NPBP01R01 index c5bd72be..63df860b 100644 --- a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.9000NPBP01R01 +++ b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.9000NPBP01R01 @@ -120,7 +120,13 @@ 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: template the tfe.conf" template: src: "../templates/tfe.conf.j2" diff --git a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.SERVER b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.SERVER index 5888dcc0..d5dd09a3 100644 --- a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.SERVER +++ b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.SERVER @@ -104,7 +104,13 @@ 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: template the tfe.conf" template: src: "../templates/tfe.conf.j2" diff --git a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P0804 b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P0804 index 4ea742b0..2ca0850f 100644 --- a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P0804 +++ b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P0804 @@ -189,6 +189,12 @@ 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: "template tfe-env service for rps mask" template: src: ../templates/service_add_StartPostForRps.conf.j2 diff --git a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P1403 b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P1403 index 2d912d1c..48287e90 100644 --- a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P1403 +++ b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P1403 @@ -96,6 +96,12 @@ 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: template consul" template: src: "../templates/consul.hcl.j2"