diff --git a/ansible/roles/system-init-9140/tasks/main.yml b/ansible/roles/system-init-9140/tasks/main.yml index bccd873c..7c70b45f 100644 --- a/ansible/roles/system-init-9140/tasks/main.yml +++ b/ansible/roles/system-init-9140/tasks/main.yml @@ -81,6 +81,13 @@ mode: 0777 tags: template +- name: "copy eth_pf_mgmt1.ips cfg" + template: + src: "{{ role_path }}/templates/setup.eth_pf_mgmt1.ips.toml.j2" + dest: /sbin/setup.eth_pf_mgmt1.ips + mode: 0777 + tags: template + - name: "copy setup.eth_vf_tfe.ips" template: src: "{{ role_path }}/templates/setup.eth_vf_tfe.ips.toml.j2" diff --git a/ansible/roles/system-init-9140/templates/if-pre-up.toml.j2 b/ansible/roles/system-init-9140/templates/if-pre-up.toml.j2 index d1758e81..6dce8c0c 100644 --- a/ansible/roles/system-init-9140/templates/if-pre-up.toml.j2 +++ b/ansible/roles/system-init-9140/templates/if-pre-up.toml.j2 @@ -7,6 +7,7 @@ then logger "$0 called for interface named $INF with $STA ..." case "$INF" in eth_pf_mgmt0) logger "Setting $STA $INF ipaddr ..."; /sbin/setup.eth_pf_mgmt0.ips $INF $STA;; + eth_pf_mgmt1) logger "Setting $STA $INF ipaddr ..."; /sbin/setup.eth_pf_mgmt1.ips $INF $STA;; eth_vf_tfe) logger "Setting $STA $INF RPS ..."; /sbin/setup.eth_vf_tfe.ips $INF $STA;; esac fi diff --git a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_mgmt1.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_mgmt1.toml.j2 index 6fd7dd19..fff6fcc0 100644 --- a/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_mgmt1.toml.j2 +++ b/ansible/roles/system-init-9140/templates/ifcfg-eth_pf_mgmt1.toml.j2 @@ -11,4 +11,4 @@ IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=eth_pf_mgmt1 DEVICE=eth_pf_mgmt1 -ONBOOT=no \ No newline at end of file +ONBOOT=yes \ No newline at end of file diff --git a/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt1.ips.toml.j2 b/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt1.ips.toml.j2 new file mode 100644 index 00000000..7629a413 --- /dev/null +++ b/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt1.ips.toml.j2 @@ -0,0 +1,18 @@ +#!/bin/bash + +INF="$1" +STA="$2" + +logger "$0 called for interface named $INF with $STA ..." + +if [ "$INF" == "eth_pf_mgmt1" ] +then + logger "$0: Interface $INF with $STA ,Set $INF ipaddr ..." + output=$(ipmitool picmg addrinfo) + echo $output + substr=${output:22:1} + echo $substr + num=$((16#${substr}+16)) + ipaddr='10.253.'$num'.1' + ifconfig eth_pf_mgmt1 $ipaddr netmask 255.255.0.0 +fi \ No newline at end of file