I actually figured out the root user already has a private_token set for them. You can retrieve that with a single POST to the session endpoint of the API, which accepts username and password.
I ended up retrieving it like this using puppet: exec { 'gitlab-settings': command => "/bin/echo export GITLAB_API_PRIVATE_TOKEN=`/bin/curl -s -X POST -d 'password=${gitlab_api_password}&login=${gitlab_api_user}' ${gitlab_api_endpoint}/session | /bin/jq .private_token -r` > ~/.gitlab; /bin/echo export GITLAB_API_ENDPOINT=${gitlab_api_endpoint} >> ~/.gitlab", onlyif => ["/bin/test -f ~/.gitlab", "/bin/grep GITLAB_API_PRIVATE_TOKEN ~/.gitlab", "/bin/grep GITLAB_API_ENDPOINT ~/.gitlab"], require => $exec_dependencies, } from that moment on I have a ~/.gitlab file ready for use with the gitlab gem (https://github.com/NARKOZ/gitlab) cheers, On Mon, Dec 7, 2015 at 11:58 PM, Achilleas Pipinellis <markel...@gmail.com> wrote: > On 12/04/2015 02:17 PM, Walter Heck wrote: > > Hello, > > > > I want to completely automate the deployment and configuration of gitlab > > using puppet. I'm using the gitlab puppet module that calls the omnibus > > installer and that all works fine, I end up with a gitlab install that > > has only the root user in it. > > > > The next step is posing a problem though: I want to use the API to > > create users, groups and set up some integrations. However the default > > root user doesn't yet have API access unless I log in manually, but I > > don't want that. Does anyone have a solution for this? > > > > I guess you mean that you have to change the password on first login. To > bypass this you can use: > > gitlab_rails['initial_root_password'] = "password" > > in gitlab.rb. > > Read more in > > https://gitlab.com/gitlab-org/omnibus-gitlab/blob/86fc99ec67726c48269f5e239f71c3ccd2886da6/files/gitlab-config-template/gitlab.rb.template#L226 > > -- > Blog: http://axilleas.me > > -- > You received this message because you are subscribed to a topic in the > Google Groups "GitLab" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/gitlabhq/xUj9I1cK2GE/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > gitlabhq+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/gitlabhq/56660F2C.9030306%40gmail.com. > For more options, visit https://groups.google.com/d/optout. > -- Best regards, Walter Heck CTO / Founder OlinData <http://olindata.com/?src=wh_gapp> - Open Source Training & Consulting Check out our upcoming trainings <http://olindata.com/training/upcoming> -- You received this message because you are subscribed to the Google Groups "GitLab" group. To unsubscribe from this group and stop receiving emails from it, send an email to gitlabhq+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/gitlabhq/CAOfYMj4ZBbEmkkMwe7LuxcfWHSSVRuWX8bmMD3Cq74Rg4aiXDg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.