Skip to content

Commit

Permalink
Remove hard-coded bgp speaker asn number, fetch from DUT (#329)
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Luo <[email protected]>
  • Loading branch information
qiluo-msft authored Nov 2, 2017
1 parent 7672138 commit b541434
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 10 additions & 3 deletions ansible/roles/test/tasks/bgp_speaker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
- fail: msg="Invalid testbed_type value '{{testbed_type}}'"
when: testbed_type not in ['t0', 't0-64']

- include_vars: "vars/deployment_id_asn_map.yml"

- name: Gather minigraph facts about the device
minigraph_facts: host={{inventory_hostname}}
become: no
Expand All @@ -18,9 +16,13 @@
- name: print deployment id
debug: msg="{{deployment_id}}"

- name: fetch bgp speaker asn number from DUT
shell: sonic-cfggen -m -d -y /etc/sonic/deployment_id_asn_map.yml -v "deployment_id_asn_map[DEVICE_METADATA['localhost']['deployment_id']]"
register: cfggen_out

- name: set bgp speaker asn number
set_fact:
bgp_speaker_asn={{deployment_id_asn_map[deployment_id]}}
bgp_speaker_asn={{cfggen_out.stdout}}

- name: print bgp speaker asn number
debug: msg="{{bgp_speaker_asn}}"
Expand Down Expand Up @@ -89,6 +91,11 @@
- {file_name: 'start.sh', config_file_1: 'config_1.ini', config_file_2: 'config_2.ini', config_file_3: 'config_3.ini', phy_ip: '{{vlan_ips[0]}}', logical_ip_1: '{{speaker_ips[0]}}', logical_ip_2: '{{speaker_ips[1]}}'}
delegate_to: "{{ptf_host}}"

- name: Kill exabgp instances if existing
shell: pkill exabgp
delegate_to: "{{ptf_host}}"
ignore_errors: yes

- name: Start exabgp instances
shell: sh {{exabgp_dir}}/start.sh
delegate_to: "{{ptf_host}}"
Expand Down
2 changes: 0 additions & 2 deletions ansible/vars/deployment_id_asn_map.yml

This file was deleted.

0 comments on commit b541434

Please sign in to comment.