I used remote HTTP server to install CentOS 7. Following is my kickstart file code for setting hostname, but it didn't work.
%post --nochroot --interpreter=/bin/bash --log=/var/log/hostname_post.log
hostnamectl set-hostname f10web01
%end
%post --interpreter=/bin/bash --log=/var/log/another.log
# did something else successfully here
%end
Any clue why set hostname didn't do the work? Also, log file hostname_post.log was not generated, so seem like the first post section was not executed at all.
Use this instead:
This is the recommended way to do this according to Red Hat.