<p dir="ltr">Excellent!! Thanks :)</p>
<div class="gmail_quote">Op 11 aug. 2014 22:25 schreef  &lt;<a href="mailto:alastair@alastair-munro.com">alastair@alastair-munro.com</a>&gt;:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All<br>
<br>
I updated the wiki: <a href="https://github.com/cobbler/cobbler/wiki" target="_blank">https://github.com/cobbler/<u></u>cobbler/wiki</a><br>
<br>
Hopefully it will help someone out there (as lots of googling helps me) :)<br>
<br>
Alastair<br>
<br>
On 2014-08-10 06:39, Jörgen Maas wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Alastair,<br>
<br>
Great writeup. We do have a wiki where Cobbler users can share their<br>
solutions/experiences<br>
It would be great if you would be willing to put this information up<br>
there: <a href="https://github.com/cobbler/cobbler/wiki" target="_blank">https://github.com/cobbler/<u></u>cobbler/wiki</a> [4]<br>
<br>
I hope other users will be inspired to do the same :)<br>
<br>
On Sat, Aug 9, 2014 at 9:39 PM, &lt;<a href="mailto:alastair@alastair-munro.com" target="_blank">alastair@alastair-munro.com</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
Just wanted to share something with the list. When creating<br>
triggers to say run a &#39;cobbler replicate&#39; via ssh, etc, to remote<br>
cobbler servers, the web page waits for the ssh at the remote end to<br>
complete. This produced quite a delay if you are say updating a<br>
system and waiting for the webpage to refresh. The reason for this<br>
is it waits for the ssh to complete, even if you background it or<br>
nohup/at/etc it.<br>
<br>
I found a way to daemonize the remote command. Using daemon from<br>
here: <a href="http://libslack.org/daemon/" target="_blank">http://libslack.org/daemon/</a> [1]. This daemonizes the ssh<br>
command, thus giving an instant response. On centos/rhel 6, just<br>
install the rpm.<br>
<br>
The other nice thing about daemon is the --name=something switch;<br>
daemon will only allow the command to run if there is not another<br>
daemon running with the same name. Thus you could put the same<br>
command in cron to run every so often on the slave, to ensure its<br>
kept up to date. This means the cron and trigger runs would never<br>
clash, or subsequent cron runs would not clash with an earlier run.<br>
For example if you add a new distro, the replicate command could<br>
take a while to run to rsync across the new distro and the next cron<br>
run may run into it.<br>
<br>
>From our setup we have one master and three slaves. In effect one<br>
cobbler server per site/data center. This means no installs across<br>
wan links and our server builds are always setup with their yum<br>
repos in the local site. However we have simple admin; only one<br>
cobbler web and a standard config across all servers. Only have to<br>
remember to set the server override for systems for the local site<br>
cobbler server. We do a mix of pxe and generated.iso builds (both<br>
are quite easy)<br>
<br>
# mkdir /usr/local/cobbler<br>
# cd /var/lib/cobbler/triggers/add/<u></u>system/post/<br>
# cat sync-slaves.sh<br>
#!/bin/bash<br>
<br>
# A Munro 6 Aug 2014: sync slaves<br>
# make sure you set up ssh keys for this...<br>
<br>
# space delimited list of slaves<br>
SLAVES=&quot;gb-wat-svv-0600 us-ham-svv-0600 us-lou-svv-0600&quot;<br>
MASTER=cobbler<br>
SSH=&quot;ssh -oConnectTimeout=2 -oStrictHostKeyChecking=no<br>
-oUserKnownHostsFile=/dev/null -oBatchMode=yes -oLogLevel=quiet&quot;<br>
LOG=/var/log/cobbler/triggers.<u></u>log<br>
<br>
[ -f $LOG ] &amp;&amp; rm -f $LOG<br>
<br>
for h in $SLAVES<br>
do<br>
#   slow way:background so they are done in parallel<br>
#   however ssh still waits for all the commands to complete<br>
#    $SSH $h &quot;cobbler replicate --master=$MASTER --systems=*<br>
--profiles=* --prune&quot; 2&gt;&amp;1 &gt;&gt; $LOG  &amp;<br>
#   using daemon from <a href="http://libslack.org/daemon" target="_blank">http://libslack.org/daemon</a> [2] is fast and<br>
instantaneous. The run gets daemonized remotely and returns<br>
instantly<br>
    $SSH $h &quot;daemon --name=cob /usr/local/cobbler/sync-<u></u>master.sh&quot;<br>
2&gt;&amp;1 &gt;&gt; $LOG  &amp;<br>
done<br>
<br>
# chmod u+x sync-slaves.sh<br>
<br>
On the slave:<br>
<br>
# cat /usr/local/cobbler/sync-<u></u>master.sh<br>
cobbler replicate --master=cobbler --systems=* --profiles=* --prune<br>
<br>
# chmod u+x /usr/local/cobbler/sync-<u></u>master.sh<br>
<br>
______________________________<u></u>_________________<br>
cobbler mailing list<br>
<a href="mailto:cobbler@lists.fedorahosted.org" target="_blank">cobbler@lists.fedorahosted.org</a><br>
<a href="https://lists.fedorahosted.org/mailman/listinfo/cobbler" target="_blank">https://lists.fedorahosted.<u></u>org/mailman/listinfo/cobbler</a> [3]<br>
</blockquote>
<br>
--<br>
Grtz,<br>
Jörgen Maas<br>
<br>
Links:<br>
------<br>
[1] <a href="http://libslack.org/daemon/" target="_blank">http://libslack.org/daemon/</a><br>
[2] <a href="http://libslack.org/daemon" target="_blank">http://libslack.org/daemon</a><br>
[3] <a href="https://lists.fedorahosted.org/mailman/listinfo/cobbler" target="_blank">https://lists.fedorahosted.<u></u>org/mailman/listinfo/cobbler</a><br>
[4] <a href="https://github.com/cobbler/cobbler/wiki" target="_blank">https://github.com/cobbler/<u></u>cobbler/wiki</a><br>
<br>
______________________________<u></u>_________________<br>
cobbler mailing list<br>
<a href="mailto:cobbler@lists.fedorahosted.org" target="_blank">cobbler@lists.fedorahosted.org</a><br>
<a href="https://lists.fedorahosted.org/mailman/listinfo/cobbler" target="_blank">https://lists.fedorahosted.<u></u>org/mailman/listinfo/cobbler</a><br>
</blockquote>
______________________________<u></u>_________________<br>
cobbler mailing list<br>
<a href="mailto:cobbler@lists.fedorahosted.org" target="_blank">cobbler@lists.fedorahosted.org</a><br>
<a href="https://lists.fedorahosted.org/mailman/listinfo/cobbler" target="_blank">https://lists.fedorahosted.<u></u>org/mailman/listinfo/cobbler</a><br>
</blockquote></div>