[Spacewalk-list] Command line install and configure questions

Tomáš Kašpárek tkaspare at redhat.com
Fri Aug 11 08:31:53 UTC 2017


Hello again,

it seems that I've sent you outdated version of script we use, correct 
one is here:

post_data="login=$USER&desiredpassword=$PASS&desiredpasswordConfirm=$PASS&prefix=Mr.&firstNames=Admin&lastName=Admin&email=root at localhost&orgName=SystemsManagementQA&submitted=true"
rpm -q spacewalk-branding | grep -- '-2\.4\.' \
     && post_data="login=$USER&desiredpassword=$PASS&desiredpasswordConfirm=$PASS&prefix=Mr.&firstNames=Admin&lastName=Admin&email=root at localhost&account_type=create_sat"
wget_command="wget --no-check-certificate"
base_uri="https://$SERVER"

handler=${CFU_handler:-CreateFirstUser}
rpm -q spacewalk-branding | grep -- '-2\.4\.' \
     && handler=${CFU_handler:-CreateFirstUserSubmit}

${wget_command} -O create-admin-user.html \
     --save-cookies cookies.txt --keep-session-cookies \
     ${base_uri}
if grep csrf_token create-admin-user.html; then
     token=`grep csrf_token create-admin-user.html | awk -F'"' '{print $6}'`
     post_data="$post_data&csrf_token=${token}"
fi
${wget_command} -O create-admin-user-response.html \
     --post-data "${post_data}" \
     --load-cookies cookies.txt \
     "${base_uri}/rhn/newlogin/$handler.do"


Tomas

On 08/11/2017 09:36 AM, Tomáš Kašpárek wrote:
> Hello Larry,
>
> we're using following script which creates post request against 
> Spacewalk to create first user
>
> post_data="login=$USER&desiredpassword=$PASS&desiredpasswordConfirm=$PASS&prefix=Mr.&firstNames=Admin&lastName=Admin&email=root at localhost&account_type=create_sat"
> wget_command="wget --no-check-certificate"
> base_uri="https://$SERVER"
>
> handler=${CFU_handler:-CreateFirstUserSubmit}
>
> ${wget_command} -O create-admin-user.html \
>     --save-cookies cookies.txt --keep-session-cookies \
>     ${base_uri}
> if grep csrf_token create-admin-user.html; then
>     token=`grep csrf_token create-admin-user.html | awk -F'"' '{print 
> $6}'`
>     post_data="$post_data&csrf_token=${token}"
> fi
> ${wget_command} -O create-admin-user-response.html \
>     --post-data "${post_data}" \
>     --load-cookies cookies.txt \
>     "${base_uri}/rhn/newlogin/$handler.do"
>
> Tomas
>
> On 08/11/2017 01:56 AM, Larry Clegg wrote:
>>
>> Hello Spacewalkers,
>>
>> I have been tasked with creating a script to completely install and 
>> configure a Spacewalk server. This will be used for auto-deployments 
>> in future datacenters.
>>
>> I have just about everything scripted and working except for one 
>> major item:   I cannot figure out a way to setup the initial 
>> Administrator account and password.  Normally these are created the 
>> first time you visit a newly installed SW web site.   Can anyone 
>> point me in the right direction for doing the same initial work but 
>> via command line instead?
>>
>>
>> Thanks,
>>
>> *Larry E. Clegg*
>>
>>
>>
>> _______________________________________________
>> Spacewalk-list mailing list
>> Spacewalk-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/spacewalk-list
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20170811/0450d80e/attachment.htm>


More information about the Spacewalk-list mailing list