Commit 05a167c0 authored by Simon Redman's avatar Simon Redman

Restructure configure_nodes

parent 6bb91967
......@@ -186,38 +186,33 @@ def configure_nodes(netgraph):
disable_integrated_commands = [DISABLE_INTEGRATED_COMMAND for host in hosts]
outputs = ssh_helper.run_commands_on_many_hosts(sessions, disable_integrated_commands)
# Push ospf6d configurations to all nodes
# Push ospf6d and zebra configurations to all nodes, then enable both services
for host in hosts:
push_command = CONFIG_PUSH_COMMAND_TEMPLATE.format(
ospfd_push_command = CONFIG_PUSH_COMMAND_TEMPLATE.format(
config=ospf_confs[host],
filename=OSPF_CONF_FILENAME,
)
ospf_push_commands.append(push_command)
outputs = ssh_helper.run_commands_on_many_hosts(sessions, ospf_push_commands)
ospf_push_commands.append(ospfd_push_command)
# Enable ospf6d
for host in hosts:
enable_command = ENABLE_DAEMON_COMMAND_TEMPLATE.format(
ospf_enable_command = ENABLE_DAEMON_COMMAND_TEMPLATE.format(
daemon="ospf6d"
)
ospf_enable_commands.append(enable_command)
outputs = ssh_helper.run_commands_on_many_hosts(sessions, ospf_enable_commands)
ospf_enable_commands.append(ospf_enable_command)
# Push zebra configurations to all nodes
for host in hosts:
push_command = CONFIG_PUSH_COMMAND_TEMPLATE.format(
zebra_push_command = CONFIG_PUSH_COMMAND_TEMPLATE.format(
config=zebra_confs[host],
filename=ZEBRA_CONF_FILENAME,
)
zebra_push_commands.append(push_command)
outputs = ssh_helper.run_commands_on_many_hosts(sessions, zebra_push_commands)
zebra_push_commands.append(zebra_push_command)
# Enable zebra
for host in hosts:
enable_command = ENABLE_DAEMON_COMMAND_TEMPLATE.format(
zebra_enable_command = ENABLE_DAEMON_COMMAND_TEMPLATE.format(
daemon="zebra"
)
zebra_enable_commands.append(enable_command)
zebra_enable_commands.append(zebra_enable_command)
outputs = ssh_helper.run_commands_on_many_hosts(sessions, ospf_push_commands)
outputs = ssh_helper.run_commands_on_many_hosts(sessions, ospf_enable_commands)
outputs = ssh_helper.run_commands_on_many_hosts(sessions, zebra_push_commands)
outputs = ssh_helper.run_commands_on_many_hosts(sessions, zebra_enable_commands)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment