Hide Forgot
Description of problem: When you create a bootstrap file using the webui or 'rhn-bootstrap' and you do not select remote commands or config files, the code to do the config files or remote commands does not get populated in the bootstrap file. Version-Release number of selected component (if applicable): spacewalk-certs-tools-1.1.1-1.el5sat How reproducible: Everytime Steps to Reproduce: 1. Generate a bootstrap using the webui or CLI 2. Be sure to check remote commands or config management 3. Generate another bootstrap using the webui or CLI 4. This time do NOT check remote commands or config management See term output below: [root@satellite bootstrap]# rhn-bootstrap --allow-config-actions * bootstrap overrides (written): '/var/www/html/pub/bootstrap/client-config-overrides.txt' Values written: enableProxy '0' serverURL 'https://satellite.example.com/XMLRPC' proxyPassword '' proxyUser '' sslCACert '/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT' httpProxy '' noSSLServerURL 'http://satellite.example.com/XMLRPC' enableProxyAuth '0' useGPG 1 * bootstrap script (written): '/var/www/html/pub/bootstrap/bootstrap.sh' [root@satellite bootstrap]# rhn-bootstrap * WARNING: if there were hand edits to the rotated (backed up) file, some settings may need to be migrated. * bootstrap overrides (written): '/var/www/html/pub/bootstrap/client-config-overrides.txt' Values written: enableProxy '0' serverURL 'https://satellite.example.com/XMLRPC' proxyPassword '' proxyUser '' sslCACert '/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT' httpProxy '' noSSLServerURL 'http://satellite.example.com/XMLRPC' enableProxyAuth '0' useGPG 1 * rotating /var/www/html/pub/bootstrap/bootstrap.sh --> /var/www/html/pub/bootstrap/bootstrap.sh.1 * bootstrap script (written): '/var/www/html/pub/bootstrap/bootstrap.sh' [root@satellite bootstrap]# diff -u bootstrap.sh bootstrap.sh.1 --- bootstrap.sh 2011-03-22 17:10:22.000000000 -0400 +++ bootstrap.sh.1 2011-03-22 17:10:20.000000000 -0400 @@ -87,7 +87,7 @@ REGISTER_THIS_BOX=1 -ALLOW_CONFIG_ACTIONS=0 +ALLOW_CONFIG_ACTIONS=1 ALLOW_REMOTE_COMMANDS=0 FULLY_UPDATE_THIS_BOX=1 @@ -240,6 +240,30 @@ echo "* explicitely not registering" fi +if [ $ALLOW_CONFIG_ACTIONS -eq 1 ] ; then + echo + echo "* setting permissions to allow configuration management" + echo " NOTE: use an activation key to subscribe to the tools" + if [ "$YUM" == yum ] ; then + echo " channel and yum upgrade rhncfg-actions" + else + echo " channel and up2date rhncfg-actions" + fi + if [ -x "/usr/bin/rhn-actions-control" ] ; then + rhn-actions-control --enable-all + rhn-actions-control --disable-run + else + echo "Error setting permissions for configuration management." + echo " Please ensure that the activation key subscribes the" + if [ "$YUM" == yum ] ; then + echo " system to the tools channel and yum updates rhncfg-actions." + else + echo " system to the tools channel and up2dates rhncfg-actions." + fi + exit + fi +fi + echo echo "OTHER ACTIONS" echo "------------------------------------------------------" [root@satellite bootstrap]#
This is a problem if you generate a bootstrap w/o any params (--allow-config-actions), then want to allow config actions after the fact. The variable ALLOW_CONFIG_ACTIONS exists, but the code is not there to use the variable. Technically there is code there, but it doesn't work. Namely this code. if [ $ALLOW_CONFIG_ACTIONS -eq 1 ] ; then for i in "/etc/sysconfig/rhn/allowed-actions /etc/sysconfig/rhn/allowed-actions/configfiles"; do [ -d "$i" ] || (mkdir -p $i && directories="$directories $i") done [ -f /etc/sysconfig/rhn/allowed-actions/configfiles/all ] || files="$files /etc/sysconfig/rhn/allowed-actions/configfiles/all" [ -n "$files" ] && touch $files fi That doesn't work correctly and should be removed.