[Spacewalk-list] Scripted creation of initial user

Andy Seed pipseed at gmail.com
Fri Feb 19 20:49:12 UTC 2016


I've used the following code in my Spacewalk automated installs script

########################################

# Lets Create the admin account

echo -e

echo -ne '\n' | read conti

curl  https://localhost/rhn/newlogin/CreateFirstUser.do --insecure -D - |
egrep -i "cookie|csrf_token" | sed 's/.*="/\&csrf_token=/ ;s/".*//;s/^.*: //
'

echo -ne '\n' | read cookie

echo -ne '\n' | read csrf


curl --noproxy '*' --cookie "$cookie" --data "login=admin&desiredpassword=
TEMPPASS&desiredpasswordConfirm=TEMPPASS
&firstNames=NAME&lastName=SURNAME&email=ADMIN_EMAIL
&prefix=Mr.&account_type=create_sat&csrf_token=-$csrf"
https://localhost/rhn/newlogin/CreateFirstUserSubmit.do --insecure -D -

Hope it helps

On 19 February 2016 at 20:20, Thomas Mueller <thomas at chaschperli.ch> wrote:

> Hi
>
> I'm trying to fully automate the installation of spacewalk 2.4 with puppet.
>
> I'm struggeling to add the first user by script. I now how to add users
> by API. But this requires that some user already exists to login with.
>
> Is there some shell command to add a user with organisation admin role?
> Or is it somehow possible with spacewalk-sql ? I've seen that there is
> some create_new_user postgresql function with lots of params - but I
> don't know how to use it.
>
> Any help appreciated!
>
> - Thomas
>
> _______________________________________________
> 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/20160219/2d26061d/attachment.htm>


More information about the Spacewalk-list mailing list