proxy/installer/configure-proxy.sh | 26 ++++++++++++++++++++++---- proxy/installer/configure-proxy.sh.sgml | 24 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-)
New commits: commit 436d16359ede3af9966c11b92c961b6c14debbc2 Author: Dimitar Yordanov dyordano@redhat.com Date: Fri Oct 4 16:28:55 2013 +0200
516296 - Allow truly non-interactive proxy install
diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh index 03603ba..af40a92 100755 --- a/proxy/installer/configure-proxy.sh +++ b/proxy/installer/configure-proxy.sh @@ -43,6 +43,10 @@ options: Configuration channel name is rhn_proxy_config_${SYSTEM_ID}. --rhn-parent=RHN_PARENT Your parent Spacewalk server. + --rhn-password=RHN_PASSWORD + Red Hat Network or Spacewalk password. + --rhn-user=RHN_USER + Red Hat Network or Spacewalk user acount. --ssl-build-dir=SSL_BUILD_DIR The directory where we build SSL certificate. Default is /root/ssl-build --ssl-city=SSL_CITY @@ -142,6 +146,8 @@ while : ; do --monitoring-parent-ip) set_value "$1" MONITORING_PARENT_IP "$2"; shift;; --populate-config-channel) POPULATE_CONFIG_CHANNEL="${2:-Y}"; shift;; --start-services) START_SERVICES="${2:-Y}"; shift;; + --rhn-user) set_value "$1" RHN_USER "$2"; shift;; + --rhn-password) set_value "$1" RHN_PASSWORD "$2"; shift;; --) shift; if [ $# -gt 0 ] ; then echo "Error: Extra arguments found: $@" @@ -154,6 +160,14 @@ while : ; do shift done
+# params dep check +if [[ $INTERACTIVE == 0 \ + && ( -z $POPULATE_CONFIG_CHANNEL || $( yes_no $POPULATE_CONFIG_CHANNEL ) == 1 ) \ + && ( -z $RHN_USER || -z $RHN_PASSWORD ) ]]; then + echo "Error: When --populate-config-channel is set to Yes both --rhn-user and --rhn-password have to be provided." + exit 1 +fi + ACCUMULATED_ANSWERS=""
generate_answers() { @@ -574,9 +588,13 @@ default_or_input "Create and populate configuration channel $CHANNEL_LABEL?" POP POPULATE_CONFIG_CHANNEL=$(yes_no $POPULATE_CONFIG_CHANNEL) if [ "$POPULATE_CONFIG_CHANNEL" = "1" ]; then RHNCFG_STATUS=1 + default_or_input "RHN username:" RHN_USER '' while [ $RHNCFG_STATUS != 0 ] ; do - CONFIG_CHANNELS=$(rhncfg-manager list-channels --server-name "$RHN_PARENT") + CONFIG_CHANNELS=$(rhncfg-manager list-channels ${RHN_USER:+--username="${RHN_USER}"} ${RHN_PASSWORD:+--password="${RHN_PASSWORD}"} --server-name="$RHN_PARENT") RHNCFG_STATUS=$? + # In case of incorrect username/password, we want to re-ask user + unset RHN_USER + unset RHN_PASSWORD done if ! grep -q -E "^ +$CHANNEL_LABEL$" <<<"$CONFIG_CHANNELS" ; then rhncfg-manager create-channel --server-name "$RHN_PARENT" "$CHANNEL_LABEL" diff --git a/proxy/installer/configure-proxy.sh.sgml b/proxy/installer/configure-proxy.sh.sgml index 84cb473..ea22ccd 100644 --- a/proxy/installer/configure-proxy.sh.sgml +++ b/proxy/installer/configure-proxy.sh.sgml @@ -130,6 +130,18 @@ provide a required response, default answer is used.</para> </listitem> </varlistentry> <varlistentry> + <term>--rhn-password=RHN_PASSWORD</term> + <listitem> + <para>Red Hat Network or Spacewalk password.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>--rhn-user=RHN_USER</term> + <listitem> + <para>Red Hat Network or Spacewalk user acount.</para> + </listitem> + </varlistentry> + <varlistentry> <term>--ssl-build-dir=SSL_BUILD_DIR</term> <listitem> <para>The directory where we build SSL certificate. Default is /root/ssl-build.</para> @@ -234,6 +246,18 @@ provide a required response, default answer is used.</para> </listitem> </varlistentry> <varlistentry> + <term>RHN_PASSWORD</term> + <listitem> + <para>Red Hat Network or Spacewalk password.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>RHN_USER</term> + <listitem> + <para>Red Hat Network or Spacewalk user acount.</para> + </listitem> + </varlistentry> + <varlistentry> <term>TRACEBACK_EMAIL</term> <listitem> <para>Email to which tracebacks should be sent.</para>
commit 1a49f35d2832d98170921a45dd0225815eb7750d Author: Matej Kollar mkollar@redhat.com Date: Fri Oct 4 16:04:25 2013 +0200
Order list of options in help
diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh index 066b14b..03603ba 100755 --- a/proxy/installer/configure-proxy.sh +++ b/proxy/installer/configure-proxy.sh @@ -30,14 +30,14 @@ options: The username for an authenticated proxy. --install-monitoring Install and enable monitoring. - --non-interactive - For use only with --answer-file. If the --answer-file doesn't - provide a required response, default answer is used. --monitoring-parent=MONITORING_PARENT Name of the parent for your scout. Usually the same value as in RHN_PARENT. --monitoring-parent-ip=MONITORING_PARENT_IP IP address of MONITORING_PARENT + --non-interactive + For use only with --answer-file. If the --answer-file doesn't + provide a required response, default answer is used. --populate-config-channel Create config chanel and save configuration files to that channel. Configuration channel name is rhn_proxy_config_${SYSTEM_ID}.
spacewalk-commits@lists.fedorahosted.org