diff --git a/handlers/main.yml b/handlers/main.yml index 0d0ba9f..b335cfa 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -22,3 +22,6 @@ - systemd_run_networkd | bool tags: - systemd-networkd + +- name: Update initramfs + command: "{{ systemd_networkd_update_initramfs }}" diff --git a/tasks/main.yml b/tasks/main.yml index 869a5a5..32fd86b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -57,6 +57,7 @@ config_type: "ini" notify: - Restart systemd-networkd + - Update initramfs tags: - systemd-networkd diff --git a/templates/systemd-network-link.j2 b/templates/systemd-network-link.j2 index 99e55d9..147d224 100644 --- a/templates/systemd-network-link.j2 +++ b/templates/systemd-network-link.j2 @@ -1,4 +1,5 @@ # {{ ansible_managed }} [Link] +NamePolicy=kernel database onboard slot path MACAddressPolicy=persistent diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 2aaa301..637de9d 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -15,3 +15,5 @@ systemd_networkd_distro_packages: - systemd-networkd + +systemd_networkd_update_initramfs: "dracut -f" diff --git a/vars/suse-42.yml b/vars/suse-42.yml new file mode 100644 index 0000000..474d5ca --- /dev/null +++ b/vars/suse-42.yml @@ -0,0 +1,16 @@ +--- +# Copyright 2018, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +systemd_networkd_update_initramfs: "dracut -f" diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml new file mode 100644 index 0000000..1648a41 --- /dev/null +++ b/vars/ubuntu-16.04.yml @@ -0,0 +1,16 @@ +--- +# Copyright 2018, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +systemd_networkd_update_initramfs: "/usr/sbin/update-initramfs -u"