network/roles/firewall/tasks/mgmt.yml

26 lines
579 B
YAML
Raw Normal View History

2023-12-18 10:22:14 +00:00
- name: Set up management interfaces
template:
dest: /etc/network/interfaces.d/mgmt.intf
src: mgmt.intf.j2
mode: 0644
register: task_mgmt_interface
- name: Run SSH in management VRF
lineinfile:
path: /etc/conf.d/sshd
line: "vrf=\"mgmt\""
register: task_ssh_vrf
- name: Reboot for new VRF
reboot:
when: task_mgmt_interface.changed or task_ssh_vrf.changed
register: task_reboot
- name: Reset the connection
meta: reset_connection
- name: Wait for the network device to reload
wait_for_connection:
delay: 10
when: task_reboot.changed