Skip to content
Snippets Groups Projects
Commit bafe8aeb authored by Rafael Da Silveira Santos's avatar Rafael Da Silveira Santos
Browse files

Rewrite ansible deployment

parent f6a6c32a
No related branches found
No related tags found
No related merge requests found
File added
---
- name: Configure Interface
loop: "{{ service.fabric[hostname].interfaces }}"
loop_control:
loop_var: interface
arista.eos.eos_command:
commands:
- "conf t"
- "interface {{ interface.name }}"
- "description {{ interface.description }}"
- "switchport access vlan {{ service.fabric[hostname].vlan }}"
- name: Configure VxLAN
when: device.key != hostname
loop: "{{ lookup('ansible.builtin.dict', service.fabric) }}"
loop_control:
loop_var: device
arista.eos.eos_command:
commands:
- "conf t"
- "interface vxlan 1"
- "vxlan source-interface Loopback0"
- "vxlan vlan {{ service.fabric[hostname].vlan }} vni {{ service.vni }}"
- "vxlan vlan {{ service.fabric[hostname].vlan }} flood vtep fc00:0:0:2{{ device.key.split('L')[-1] }}::"
- "exit"
\ No newline at end of file
...@@ -20,30 +20,37 @@ ...@@ -20,30 +20,37 @@
set_fact: set_fact:
host_services: >- host_services: >-
{{ services | selectattr('fabric', 'defined') | selectattr('fabric', 'contains', hostname) | list }} {{ services | selectattr('fabric', 'defined') | selectattr('fabric', 'contains', hostname) | list }}
- name: Configure Interface - name: Configure Interface
when: host_services | length > 0 when: host_services | length > 0
ansible.builtin.include_tasks: interface.yaml ansible.builtin.include_tasks: configure_service.yaml
loop: "{{ host_services }}" loop: "{{ host_services }}"
loop_control: loop_control:
loop_var: service loop_var: service
# - name: Configure Interface
# when: host_services | length > 0
# ansible.builtin.include_tasks: interface.yaml
# loop: "{{ host_services }}"
# loop_control:
# loop_var: service
- name: Configure VxLan # - name: Configure VxLan
when: host_services | length > 0 # when: host_services | length > 0
loop: "{{ host_services }}" # loop: "{{ host_services }}"
loop_control: # loop_control:
loop_var: service # loop_var: service
arista.eos.eos_command: # arista.eos.eos_command:
commands: # commands:
- "conf t" # - "conf t"
- "interface vxlan 1" # - "interface vxlan 1"
- "vxlan source-interface Loopback0" # - "vxlan source-interface Loopback0"
- "vxlan vlan {{ service.fabric[hostname].vlan }} vni {{ service.vni }}" # - "vxlan vlan {{ service.fabric[hostname].vlan }} vni {{ service.vni }}"
- "exit" # - "exit"
- name: Configure VTEP flooding # - name: Configure VTEP flooding
when: host_services | length > 0 # when: host_services | length > 0
ansible.builtin.include_tasks: vtep.yaml # ansible.builtin.include_tasks: vtep.yaml
loop: "{{ host_services }}" # loop: "{{ host_services }}"
loop_control: # loop_control:
loop_var: service # loop_var: service
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment