Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions ansible/roles/eos/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,28 @@
copy: src=boot-config
dest=/mnt/flash/boot-config

- name: build spine startup config
template: src=spine.j2
dest=/mnt/flash/startup-config
- block:
- name: build spine startup config
template: src=spine.j2
dest=/mnt/flash/startup-config
notify:
- Restart the box
- name: Dump all routes to ~/.ansible/state/{{ hostname }}_routes.txt
template: src=spine_routes.j2 dest="~/.ansible/state/{{ hostname }}_routes.txt" mode=0600
connection: local

when: swrole == "spine"
notify:
- Restart the box

- name: build tor startup config
template: src=tor.j2
dest=/mnt/flash/startup-config
- block:
- name: build tor startup config
template: src=tor.j2
dest=/mnt/flash/startup-config
notify:
- Restart the box
- name: Dump all routes to ~/.ansible/state/{{ hostname }}_routes.txt
template: src=tor_routes.j2 dest="~/.ansible/state/{{ hostname }}_routes.txt" mode=0600
connection: local

when: swrole == "tor"
notify:
- Restart the box

8 changes: 8 additions & 0 deletions sonic/ansible/roles/eos/templates/spine_routes.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% for podset in range(0, podset_number) %}
{% for tor in range(0, tor_number) %}
{% for subnet in range(0, tor_subnet_number) %}
192.168.{{ podset }}.{{ tor * 16 + subnet }}/32,{{ hostname }}
20C0:A8{{ '%02X' % podset }}:0:{{ '%02X' % (tor * 16 + subnet)}}::/64,{{ hostname }}
{% endfor %}
{% endfor %}
{% endfor %}
4 changes: 4 additions & 0 deletions sonic/ansible/roles/eos/templates/tor_routes.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% for subnet in range(0, tor_subnet_number) %}
172.16.{{ tornum }}.{{ subnet }}/32,{{ hostname }}
20AC:10{{ '%02X' % tornum }}:0:{{ '%02X' % subnet }}::/64,{{ hostname }}
{% endfor %}