diff --git a/tsg-9140-scripts/roles/init_runtime/files/init_runtime/tasks/init_runtime.yml b/tsg-9140-scripts/roles/init_runtime/files/init_runtime/tasks/init_runtime.yml index c66daca1..ae23dd20 100644 --- a/tsg-9140-scripts/roles/init_runtime/files/init_runtime/tasks/init_runtime.yml +++ b/tsg-9140-scripts/roles/init_runtime/files/init_runtime/tasks/init_runtime.yml @@ -3,6 +3,41 @@ vars_files: - '{{var_files_path}}' tasks: + - name: "init_runtime: obtain result_exec_obtain_keepalive_subnet" + shell: ipmitool picmg addrinfo | grep "Hardware Address" | sed 's/^Hardware Address.*0x4\(.*\)/\1/' | awk '{print strtonum("0x"$1)+16'} + register: result_exec_obtain_keepalive_subnet + + - name: "init_runtime: output results that executes command that gets the result_exec_obtain_keepalive_subnet" + debug: + msg: "{{ result_exec_obtain_keepalive_subnet }}" + + - name: "init_runtime: check result_exec_obtain_keepalive_subnet" + assert: + that: + - result_exec_obtain_keepalive_subnet.rc == 0 + - result_exec_obtain_keepalive_subnet.failed == False + - result_exec_obtain_keepalive_subnet.stdout_lines | length == 1 + - result_exec_obtain_keepalive_subnet.stdout_lines[0] | int >= 16 + - result_exec_obtain_keepalive_subnet.stdout_lines[0] | int <= 31 + fail_msg: "error:{{ result_exec_obtain_keepalive_subnet.stderr }},stdout:{{ result_exec_obtain_keepalive_subnet.stdout_lines }}" + success_msg: "{{ result_exec_obtain_keepalive_subnet.stdout_lines[0] }}" + + - name: "init_runtime: Set fact for field keepalive_subnet_ip" + set_fact: + keepalive_subnet_ip: "{{ result_exec_obtain_keepalive_subnet.stdout_lines[0] }}" + + - name: "init_runtime: template gdev.conf file" + template: + src: "../templates/gdev.conf.j2" + dest: /home/mesasoft/sapp_run/etc/gdev.conf + tags: sapp + + - name: "init_runtime: template mrglobal.conf file" + template: + src: "../templates/mrglobal.conf.j2" + dest: /opt/mrzcpd/etc/mrglobal.conf + tags: mrzcpd + - name: "init_runtime: template certstore configure file" template: src: "../templates/cert_store.ini.j2" @@ -51,6 +86,12 @@ dest: /opt/tsg/tfe/conf/pangu/pangu_pxy.conf tags: tfe + - name: "Restart mrzcpd" + systemd: + name: mrzcpd + state: restarted + tags: mrzcpd + - name: "Restart certstore" systemd: name: certstore diff --git a/tsg-9140-scripts/roles/mrzcpd/tasks/main.yml b/tsg-9140-scripts/roles/mrzcpd/tasks/main.yml index 0d56363a..16a08c52 100644 --- a/tsg-9140-scripts/roles/mrzcpd/tasks/main.yml +++ b/tsg-9140-scripts/roles/mrzcpd/tasks/main.yml @@ -12,8 +12,8 @@ - name: "update mrglobal.conf - TSG9140" template: - src: "{{ role_path }}/templates/tsg_9140/mrglobal.conf.tsg_9140.j2" - dest: /opt/mrzcpd/etc/mrglobal.conf + src: "{{ role_path }}/templates/tsg_9140/mrglobal.conf.tsg_9140.j2.j2" + dest: /opt/tsg/init_runtime/templates/mrglobal.conf.j2 ##################### mrzcpd ##################### - name: "enable mrenv" diff --git a/tsg-9140-scripts/roles/mrzcpd/templates/tsg_9140/mrglobal.conf.tsg_9140.j2 b/tsg-9140-scripts/roles/mrzcpd/templates/tsg_9140/mrglobal.conf.tsg_9140.j2.j2 similarity index 94% rename from tsg-9140-scripts/roles/mrzcpd/templates/tsg_9140/mrglobal.conf.tsg_9140.j2 rename to tsg-9140-scripts/roles/mrzcpd/templates/tsg_9140/mrglobal.conf.tsg_9140.j2.j2 index 9a0b0c7c..4a9b3fa6 100644 --- a/tsg-9140-scripts/roles/mrzcpd/templates/tsg_9140/mrglobal.conf.tsg_9140.j2 +++ b/tsg-9140-scripts/roles/mrzcpd/templates/tsg_9140/mrglobal.conf.tsg_9140.j2.j2 @@ -7,7 +7,9 @@ sz_buffer=32 mtu=4096 clear_tx_flags=1 hw_strip_crc=1 -in_addr=10.254.19.1 +{% raw %} +in_addr={{ keepalive_subnet_ip }} +{% endraw %} in_mask=255.255.255.252 #rssmode=3 diff --git a/tsg-9140-scripts/roles/sapp/tasks/main.yml b/tsg-9140-scripts/roles/sapp/tasks/main.yml index 10f67f0c..e10f0e99 100644 --- a/tsg-9140-scripts/roles/sapp/tasks/main.yml +++ b/tsg-9140-scripts/roles/sapp/tasks/main.yml @@ -60,8 +60,8 @@ - name: Template the gdev.conf template: - src: "{{ role_path }}/templates/gdev.conf.j2" - dest: /home/mesasoft/sapp_run/etc/gdev.conf + src: "{{ role_path }}/templates/gdev.conf.j2.j2" + dest: /opt/tsg/init_runtime/templates/gdev.conf.j2 tags: template - name: "sapp: service adapts runtimes" diff --git a/tsg-9140-scripts/roles/sapp/templates/gdev.conf.j2 b/tsg-9140-scripts/roles/sapp/templates/gdev.conf.j2.j2 similarity index 60% rename from tsg-9140-scripts/roles/sapp/templates/gdev.conf.j2 rename to tsg-9140-scripts/roles/sapp/templates/gdev.conf.j2.j2 index 2e125c8f..0fe0755c 100644 --- a/tsg-9140-scripts/roles/sapp/templates/gdev.conf.j2 +++ b/tsg-9140-scripts/roles/sapp/templates/gdev.conf.j2.j2 @@ -1,5 +1,7 @@ [Module] pcapdevice={{ nic_mgr.name }} sendto_gdev_card={{ nic_mgr.name }} -sendto_gdev_ip={{ inline_device_config.keepalive_ip }} +{% raw %} +sendto_gdev_ip={{ keepalive_subnet_ip }} +{% endraw %} gdev_status_switch=1