Update initramfs when links change

In order to make the default link take effect initramfs needs to be
updated. This change also updates the default link to use the
recommended defaults from the systemd-networkd documentation.

Default link config:
- https://www.freedesktop.org/software/systemd/man/systemd.link.html#Examples

See this thread for bug info:
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=793374

Change-Id: I5430da4acad1e36b7593ad6791afbebf9e730bba
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-04-11 23:11:57 -05:00
parent 25048240b4
commit d8bcdc0341
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3
6 changed files with 39 additions and 0 deletions

View File

@ -22,3 +22,6 @@
- systemd_run_networkd | bool
tags:
- systemd-networkd
- name: Update initramfs
command: "{{ systemd_networkd_update_initramfs }}"

View File

@ -57,6 +57,7 @@
config_type: "ini"
notify:
- Restart systemd-networkd
- Update initramfs
tags:
- systemd-networkd

View File

@ -1,4 +1,5 @@
# {{ ansible_managed }}
[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent

View File

@ -15,3 +15,5 @@
systemd_networkd_distro_packages:
- systemd-networkd
systemd_networkd_update_initramfs: "dracut -f"

16
vars/suse-42.yml Normal file
View File

@ -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"

16
vars/ubuntu-16.04.yml Normal file
View File

@ -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"