#!/bin/sh
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html


#-------------------------------------------------------------------------------
#=head1  server.rpm_post
#=head2  This command configures the puppet server on a xCAT server or node.
#        It is used as a post install script for puppet_server_kit.rpm
#=cut
#-------------------------------------------------------------------------------

if [ -f "/proc/cmdline" ]; then   # prevent running it during install into chroot image
    #Now configure the pupper server
    /xcatpost/config_puppet_server "$@"
    
        #restart puppet master
    service puppetmaster stop
    kill $(ps auxww | grep puppet | grep master | grep -v grep | awk '{print $2}') 
    service puppetmaster start
fi

exit 0

