compass-adapters/cobbler/snippets/kickstart_chef_init
xiaodongwang ae44332c69 update snippet to support preseed
Change-Id: I8442758ffaf3a55ec4773bf820bc4cdefb2e6452
2014-05-19 10:47:36 -07:00

23 lines
515 B
Plaintext

## A self-destruct service to boot chef client and register cron job
cat << EOF > /etc/init.d/chef
#raw
#!/bin/bash
# chkconfig: 2345 99 20
# description: Description of the script
# processname: chef-agent
rm -rf /var/lib/rsyslog/firstboot_log
service rsyslog restart
/etc/chef/firstrun.sh
crontab -l > /tmp/mycron
echo "*/30 * * * * /etc/chef/rerun.sh" >> /tmp/mycron
crontab /tmp/mycron
rm /tmp/mycron
chkconfig chef off
mv /etc/init.d/chef /tmp/chef
#end raw
EOF
chmod +x /etc/init.d/chef
chkconfig chef on