On Tue, Mar 12, 2013 at 7:34 AM, Personal Técnico tecnicos@caos.uab.eswrote:
Hi,
We're trying to run a command from the server to the new node, after the post-install in a kickstart file. We have tried to create a bash script file and copy it into the triggers folder (/var/lib/cobbler/triggers/) or into a subfolder of them, but this script is not executed in the kickstart.
What is the correct way for telling Cobbler that I want to execute a script (trigger)* from the server* (not from the new node)? My purpose is execute a tool for synchronize some files from the server to the nove (we're testing a free tool called Synctool --> http://www.heiho.net/synctool).
"run_install_triggers:1" in settings, but we don't get what we want. We have copied our script in /var/lib/cobbler/triggers/install/firstboot and /var/lib/cobbler/triggers/install/post, but not work (script is not executed)
Are you including the $SNIPPET("kickstart_done") line at the end of your %post section? That is what triggers the post snippets to run on the server.
On Tue, Mar 12, 2013 at 8:38 AM, Personal Técnico tecnicos@caos.uab.eswrote:
Yes, my kickstart file includes a $SNIPPET('kickstart_done'):
[...] %post $SNIPPET('log_ks_post') # Start yum configuration $yum_config_stanza # End yum configuration $SNIPPET('post_install_kernel_options') $SNIPPET('post_install_network_config') $SNIPPET('func_register_if_enabled') $SNIPPET('puppet_register_if_enabled') $SNIPPET('download_config_files') $SNIPPET('koan_environment') $SNIPPET('redhat_register') $SNIPPET('cobbler_register') # Enable post-install boot notification $SNIPPET('post_anamon') # Start final steps* **$SNIPPET('kickstart_done')* # End final steps
# Testing new config service postfix stop chkconfig postfix off sed -i '/^server/d' /etc/ntp.conf echo "server myntpserver" >> /etc/ntp.conf mkdir /SRC mkdir /soft echo "myNFSserver:/SRC/SL-6.3 /SRC nfs defaults,noauto 0 0" >> /etc/fstab echo "myNFSserver:/soft/SL-6.3 /soft nfs defaults 0 0" >> /etc/fstab mount /soft $SNIPPET('adding_SSH_key') # End testing new config
So, with this kickstart file, what is the problem?
The kickstart_done snippet should be the last thing in the %post section. In your case, you're adding the SSH key after the kickstart_done snippet is run, so that may be the issue - you're running into a race condition.
Move the kickstart_done down under the last part, and re-test. You can always test using wget to trigger the post install events, which should work even after the system reboots for the first time.
cobbler@lists.fedorahosted.org