dresden-weekly / ansible-network-interfaces

Ansible roles to manage Ubuntu network interface configuration
MIT License
86 stars 62 forks source link

is it possible not to try to restart interfaces after configuration? #53

Closed ashak closed 7 years ago

ashak commented 7 years ago

I see there's a variable network_allow_service_restart, but this only seems to cover part of restarting things after interfaces are configured.

Is it (or could it be) possible to also have a way to not to try and restart the interfaces after their configuration is put in place?

The task i'm thinking of specifically is 'network restart interface command'. I want to not run this task at all and then simply reboot the machine afterwards.

arBmind commented 7 years ago

as documented in the defaults/main.yml you might set network_restart_method to nothing. So nothing is done.

arBmind commented 7 years ago

To elaborate a bit more... We have two situations.

  1. When applied first, we change the main interface description, to include all our details from the directory. In order to make this effective we use the network_allow_service_restart. You set this to no and nothing will happen in this case.

  2. When only one of the interfaces is changed later, just the individual interface requires a restart. You can control how this is done with the network_restart_method. The content of this variable is used to index the network_interface_restart_commands hash. If it is service we use the service module of Ansible.

ashak commented 7 years ago

Thanks for this, I will try it out. I had not spotted the defaults/main.yml file.