summaryrefslogtreecommitdiff
path: root/roles/preseed/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/preseed/tasks')
-rw-r--r--roles/preseed/tasks/main.yml19
1 files changed, 19 insertions, 0 deletions
diff --git a/roles/preseed/tasks/main.yml b/roles/preseed/tasks/main.yml
index 8e00fb82..33248b94 100644
--- a/roles/preseed/tasks/main.yml
+++ b/roles/preseed/tasks/main.yml
@@ -17,6 +17,21 @@
path: "{{ preseed_tmpdir }}/authorized_keys"
key: "{{ ssh_keys_root | join('\n') }}"
+- name: force net interface name policy
+ when: preseed_force_net_ifnames_policy is defined
+ block:
+ - name: prepare directories to force network interface name policy
+ file:
+ path: "{{ preseed_tmpdir }}/etc/systemd/network"
+ state: directory
+
+ - name: install link unit to force network interface name policy
+ copy:
+ dest: "{{ preseed_tmpdir }}/etc/systemd/network/90-namepolicy.link"
+ content: |
+ [Link]
+ NamePolicy={{ preseed_force_net_ifnames_policy }}
+
- name: Inject files into initramfs
shell: cpio -H newc -o | gzip -9 >> 'initrd.preseed.gz'
args:
@@ -24,5 +39,9 @@
stdin: |
preseed.cfg
authorized_keys
+ etc/
+ etc/systemd/
+ etc/systemd/network/
+ etc/systemd/network/90-namepolicy.link
tags:
- skip_ansible_lint