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 <[email protected]> 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 > [email protected] > https://www.redhat.com/mailman/listinfo/spacewalk-list >
_______________________________________________ Spacewalk-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/spacewalk-list
