Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Debian: avoid misconfigured interfaces on up/down script errors #312

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions templates/interface/Debian.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# File Managed by Puppet
# Interface <%= @name %>
<% if @description and ! @description.empty? -%>
# <%= @description %>
Expand Down
2 changes: 2 additions & 0 deletions templates/route_down-Debian.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ if [ "$IFACE" = "<%= @interface -%>" ] || [ "$IFACE" = "--all" ]; then
fi
<%- end -%>
fi
# non-zero exit code causes ifupdown to leave the interface partly configured, which may result in connectivity loss
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly to the above I'd prefer to add a parameter to the route define like $clean_exit_on_failure , undef by default. to allow users to decide the intended behaviour, then , possibly, in the define code set a variable like $real_clean_exit_on_failure than, in case the parameter is not set tries to do the sanest thing (ie set to true if ipv4 is not configured but ipv6 is) and then, if this $real_clean_exit_on_failure is true, then add the above 2 lines otherwise template remains as before

exit 0
2 changes: 2 additions & 0 deletions templates/route_up-Debian.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ if [ "$IFACE" = "<%= @interface -%>" ] || [ "$IFACE" = "--all" ]; then
fi
<%- end -%>
fi
# non-zero exit code causes ifupdown to leave the interface partly configured, which may result in connectivity loss
exit 0
2 changes: 2 additions & 0 deletions templates/rule_down-Debian.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ if [ "$IFACE" = "<%= @interface -%>" ] || [ "$IFACE" = "--all" ]; then
fi
<%- end -%>
fi
# non-zero exit code causes ifupdown to leave the interface partly configured, which may result in connectivity loss
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for the route define.

exit 0
2 changes: 2 additions & 0 deletions templates/rule_up-Debian.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ if [ "$IFACE" = "<%= @interface -%>" ] || [ "$IFACE" = "--all" ]; then
fi
<%- end -%>
fi
# non-zero exit code causes ifupdown to leave the interface partly configured, which may result in connectivity loss
exit 0