Skip to content

Instantly share code, notes, and snippets.

@YungSang
Last active August 29, 2015 14:06
Show Gist options
  • Save YungSang/6bd6c8f2e2f7b04dde3d to your computer and use it in GitHub Desktop.
Save YungSang/6bd6c8f2e2f7b04dde3d to your computer and use it in GitHub Desktop.
Anaconda/Kickstart Config for Fedora Atomic
install
cdrom
text
firstboot --enabled
shutdown
lang en_US.UTF-8
keyboard us
timezone --utc Etc/UTC
zerombr
clearpart --all --initlabel
autopart --fstype=xfs
rootpw --plaintext vagrant
user --name=vagrant --groups=vagrant --password=vagrant --plaintext
services --disabled=cloud-init,cloud-init-local,cloud-config,cloud-final
bootloader --timeout=3 --extlinux
ostreesetup --nogpg --osname=fedora-atomic --remote=fedora-atomic --url=http://dl.fedoraproject.org/pub/alt/fedora-atomic/repo --ref=fedora-atomic/rawhide/x86_64/docker-host
%post --erroronfail
cat <<EOF > /etc/sudoers.d/vagrant
Defaults:vagrant !requiretty
Defaults:vagrant exempt_group += vagrant
vagrant ALL=(ALL) NOPASSWD: ALL
EOF
chmod 440 /etc/sudoers.d/vagrant
mkdir -p /home/vagrant/.ssh
curl -fsSLo /home/vagrant/.ssh/authorized_keys https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub
chmod 700 /home/vagrant/.ssh/
chmod 600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh/
cat <<EOF > /etc/systemd/system/docker-tcp.socket
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=2375
Service=docker.service
BindIPv6Only=both
[Install]
WantedBy=sockets.target
EOF
systemctl enable docker-tcp.socket
cat <<EOF > /etc/sysconfig/docker
OPTIONS=--selinux-enabled --storage-opt dm.fs=xfs
EOF
systemctl enable docker.service
cat <<EOF > /etc/systemd/system/systemd-machine-id-setup.service
[Unit]
Description=Setup Machine ID
Documentation=man:systemd-machine-id-setup(1)
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service systemd-sysusers.service
Before=sysinit.target shutdown.target
ConditionPathIsReadWrite=/etc
ConditionPathExists=!/etc/machine-id
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/systemd-machine-id-setup
StandardOutput=tty
StandardInput=tty
StandardError=tty
[Install]
WantedBy=sysinit.target
EOF
systemctl enable systemd-machine-id-setup.service
rm -f /etc/machine-id
%end
@YungSang
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment