diff --git a/cdist/conf/type/__interface/files/backends/ifupdown.d/manifest b/cdist/conf/type/__interface/files/backends/ifupdown.d/manifest index 6b9af804..69cd515d 100755 --- a/cdist/conf/type/__interface/files/backends/ifupdown.d/manifest +++ b/cdist/conf/type/__interface/files/backends/ifupdown.d/manifest @@ -92,6 +92,11 @@ then set -- "$@" --comment "$(cat "${__object}/parameter/comment")" fi +if test -s "${__object}/parameter/onchange" +then + set -- "$@" --onchange "$(cat "${__object}/parameter/onchange")" +fi + if test -s "${__object}/parameter/extra-config" then while read -r _opt diff --git a/cdist/conf/type/__interface/man.rst b/cdist/conf/type/__interface/man.rst index fc0772cf..3dc35f87 100644 --- a/cdist/conf/type/__interface/man.rst +++ b/cdist/conf/type/__interface/man.rst @@ -57,6 +57,17 @@ extra-config Using this option makes the configuration non-portable to other backends. If this option is used extensively, it is recommended to use the respective backend type directly. +onchange + The action to perform if the interface configuration has changed. + Available options are: + leave (default) + Do nothing. + up + Bring the interface up if it is down. + down + Bring the interface down if it is up. + refresh + Refresh the interface (down && up). BOOLEAN PARAMETERS diff --git a/cdist/conf/type/__interface/parameter/default/onchange b/cdist/conf/type/__interface/parameter/default/onchange new file mode 100644 index 00000000..e8f9c907 --- /dev/null +++ b/cdist/conf/type/__interface/parameter/default/onchange @@ -0,0 +1 @@ +leave diff --git a/cdist/conf/type/__interface/parameter/optional b/cdist/conf/type/__interface/parameter/optional index c17ca504..0af245b0 100644 --- a/cdist/conf/type/__interface/parameter/optional +++ b/cdist/conf/type/__interface/parameter/optional @@ -3,5 +3,6 @@ comment gateway name netmask +onchange state type