2016-12-13 13:56:01 +00:00
|
|
|
# Like the Atomic Host cloud image, but tuned for vagrant: enable the
|
|
|
|
# vagrant user, disable cloud-init.
|
2015-02-25 22:26:42 +00:00
|
|
|
|
2016-04-11 19:09:19 +00:00
|
|
|
%include fedora-atomic.ks
|
2015-02-25 22:26:42 +00:00
|
|
|
|
|
|
|
user --name=vagrant --password=vagrant
|
2015-05-13 21:33:07 +00:00
|
|
|
rootpw vagrant
|
2015-02-25 22:26:42 +00:00
|
|
|
|
2015-12-09 16:36:17 +00:00
|
|
|
# The addition of the net.ifnames=0 and biosdevnames=0 option ensures that
|
|
|
|
# even on VirtualBox virt, we get a primary network device with "eth0" as the name
|
|
|
|
# This simplifies things and allows a single disk image for both supported Vagrant
|
|
|
|
# platforms (virtualbox and kvm)
|
|
|
|
bootloader --timeout=1 --append="no_timer_check console=tty1 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0"
|
|
|
|
|
2015-02-25 22:26:42 +00:00
|
|
|
%post --erroronfail
|
|
|
|
|
|
|
|
# Work around cloud-init being both disabled and enabled; need
|
|
|
|
# to refactor to a common base.
|
2015-03-04 16:58:01 +00:00
|
|
|
systemctl mask cloud-init cloud-init-local cloud-config cloud-final
|
2015-02-25 22:26:42 +00:00
|
|
|
|
2016-12-13 13:56:01 +00:00
|
|
|
# The inherited cloud %post locks the passwd, but we want it
|
|
|
|
# unlocked for vagrant, just like downstream.
|
|
|
|
passwd -u root
|
|
|
|
|
2015-02-25 22:26:42 +00:00
|
|
|
# Vagrant setup
|
|
|
|
sed -i 's,Defaults\\s*requiretty,Defaults !requiretty,' /etc/sudoers
|
2017-02-20 14:00:14 +00:00
|
|
|
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd
|
2015-02-25 22:26:42 +00:00
|
|
|
sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config
|
|
|
|
mkdir -m 0700 -p ~vagrant/.ssh
|
|
|
|
cat > ~vagrant/.ssh/authorized_keys << EOKEYS
|
|
|
|
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
|
|
|
|
EOKEYS
|
|
|
|
chmod 600 ~vagrant/.ssh/authorized_keys
|
|
|
|
chown -R vagrant:vagrant ~vagrant/.ssh/
|
|
|
|
|
|
|
|
%end
|
|
|
|
|