From 3110c9e1dddcc4213bf95aa971574d5d3f375e9d Mon Sep 17 00:00:00 2001 From: fumingwei Date: Wed, 27 Apr 2022 16:46:04 +0800 Subject: [PATCH] =?UTF-8?q?feature:=E5=9C=A8TSG-X-P0804=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=B8=8B,=E4=BF=AE=E5=A4=8Dprovision-config-apply=E5=9C=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B9proxy.enable=3D0=E6=97=B6sapp?= =?UTF-8?q?=E9=85=8D=E7=BD=AEcpu=20affinity=E9=94=99=E8=AF=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/provision.yml.TSGXNXR620G40R01P0804 | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) 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 67e55eb4..d78bfaa7 100644 --- a/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P0804 +++ b/ansible/roles/tsg-os-provision/files/tasks/provision.yml.TSGXNXR620G40R01P0804 @@ -34,6 +34,12 @@ workload_proxy_cpu_affinity: "{{ cpu_layout_obtained.tfe_affinity | join(',') }}" workload_proxy_worker_thread: "{{ cpu_layout_obtained.tfe_affinity | length | int - 1 }}" + - name: "tsg-os-provision: rewrite sapp_cpu_affinity and sapp_worker_threads" + set_fact: + workload_firewall_cpu_affinity: "{{ (cpu_layout_obtained.sapp_affinity + cpu_layout_obtained.tfe_affinity) | join(',') }}" + workload_firewall_worker_threads: "{{ (cpu_layout_obtained.sapp_affinity + cpu_layout_obtained.tfe_affinity) | length }}" + when: proxy.enable == 0 + ######setting cpu affinity end###### ######setting nic cpu affinity mask start###### @@ -244,12 +250,6 @@ src: /data/tsg-os-provision/provision.yml dest: /data/tsg-os-provision/provision.yml.snapshot - - name: "tsg-os-provision: rewrite sapp_cpu_affinity and sapp_worker_threads" - set_fact: - workload_firewall_cpu_affinity: "{{ cpu_layout_obtained.sapp_affinity + cpu_layout_obtained.sapp_affinity | join(',') }}" - workload_firewall_worker_threads: "{{ cpu_layout_obtained.sapp_affinity + cpu_layout_obtained.sapp_affinity | length }}" - when: proxy.enable == 0 - - name: "tsg-os-provision: disable enable service step 1:mount partition to mnt_tmp" mount: path: /tmp/mnt_tmp @@ -258,11 +258,17 @@ state: mounted - name: "tsg-os-provision: disable service step 2:disable tfe service" - shell: systemctl --root=/tmp/mnt_tmp disable tfe.service + shell: "{{ item }}" + with_items: + - systemctl --root=/tmp/mnt_tmp disable tfe.service + - systemctl --root=/tmp/mnt_tmp disable tfe-env.service when: proxy.enable == 0 - name: "tsg-os-provision: enable service step 2:enable tfe service" - shell: systemctl --root=/tmp/mnt_tmp enable tfe.service + shell: "{{ item }}" + with_items: + - systemctl --root=/tmp/mnt_tmp enable tfe.service + - systemctl --root=/tmp/mnt_tmp enable tfe-env.service when: proxy.enable == 1 - name: "tsg-os-provision: disable enable service step 3:umount mnt_tmp" @@ -270,12 +276,6 @@ path: /tmp/mnt_tmp state: absent - - name: "tsg-os-provision: stop tfe" - systemd: - name: tfe - state: stopped - when: proxy.enable == 0 - - name: add porvision successed sign file: path: /data/tsg-os-provision/.provision_succeeded @@ -329,6 +329,17 @@ state: restarted when: enable_config_apply == '1' + - name: "tsg-os-provision: stop tfe" + systemd: + name: "{{ item }}" + state: stopped + with_items: + - tfe + - tfe-env + when: + - enable_config_apply == '1' + - proxy.enable == 0 + - name: "tsg-os-provision: restart tfe-env" systemd: name: tfe-env