Update hostname files before multistrap in image-builder

This change adds to the multistrap playbook to ensure that the
hostname files are correct when multistrap installs packages. This
can be an issue when installing packages such as ssmtp. A later step
will override the hosts and hostname files so these changes will be
temporary in the overall build process.

Change-Id: I61124a4e991e4aaedadc9c6ef211b574178fb411
This commit is contained in:
Michael Beaver 2021-03-23 00:49:52 -05:00
parent 9066690daf
commit 2a70f431cc
1 changed files with 8 additions and 0 deletions

View File

@ -57,6 +57,14 @@
set -e
chattr +i "{{ rootfs_root }}/etc/kernel/postinst.d/kdump-tools"
# Setting up a dummy hostname required for some packages to properly install
- name: "hostname and hosts | write out hostname file"
shell:
cmd: "echo \"$(hostname)\" > {{rootfs_root}}/etc/hostname"
- name: "hostname and hosts | write out hosts file"
shell:
cmd: "echo \"127.0.0.1 localhost $(hostname)\" > {{rootfs_root}}/etc/hosts"
- name: "Running multistrap"
shell:
cmd: "multistrap -f {{ multistrap_tempdir.path }}/multistrap.conf"