[Pulp-list] puppet friendly install process (rc script patch)

Ryan Bowlby rbowlby83 at yahoo.com
Mon Feb 27 01:51:14 UTC 2012



Hi All,

I'm performing an initial Pulp install and decided to create a puppet module at the same time. The install instructions call for running "/etc/init.d/pulp init" before initial start. This is not very puppet friendly and also doing so manually seems like a superfluous step. Instead, why not just have the rc script perform this step if the init_file is not present? I've created the below patch, as this would make the install process more intuitive and the puppet module cleaner.

--- pulp-server    2012-02-24 11:34:11.000000000 -0800
+++ pulp-server.new    2012-02-24 23:24:46.984969522 -0800
@@ -30,16 +30,14 @@
     $SERVICE mongod start
     /usr/bin/pulp-migrate
     RETVAL=$?
-    [ $RETVAL = 0 ] && touch ${init_file}
+    if [ $RETVAL = 0 ]; then
+        touch ${init_file}
+        echo "Initialized Pulp database."
     return $RETVAL
 }
 
 start() {
-    if [ ! -f $init_file ]; then
-        echo $"Pulp database not initialized, please run: $0 init"
-        RETVAL=2
-        return $RETVAL
-    fi
+    [ ! -f $init_file ] && init 
     $SERVICE mongod start || RETVAL=$?
     [ $RETVAL = 0 ] && $SERVICE qpidd start || RETVAL=$?
     [ $RETVAL = 0 ] && $SERVICE httpd start || RETVAL=$?


Thanks,
Ryan Bowlby




More information about the Pulp-list mailing list