title: One line console command to set first root password in GitLab
body: <p>I need to setup GitLab and runner, create user and projects, register runner - automatically via user data in terraform. It could be possible via API with bash or python scripts.</p>
  
  <p>To use API we need ACCESS_TOKEN - with this script  <a href="https://gist.github.com/vitalyisaev2/215f890e75252cd36794221c2debf365" rel="nofollow noreferrer">https://gist.github.com/vitalyisaev2/215f890e75252cd36794221c2debf365</a> it is possible to create ACCESS_TOKEN for root user. </p>
  
  <p>But first I need to have a valid root user password. This is a big problem for me I can not solve and ask You guys to help me.</p>
  
  <p>On first login GitLab asks to set/change password. 
  <a href="https://i.stack.imgur.com/GHtJD.png" rel="nofollow noreferrer">First login to GitLab UI</a></p>
  
  <p>I want to set this password via script, non interactively. 
  It is possible set password this way:</p>
  
  <pre><code>gitlab-rails console 
  irb(main):001:0&gt; user = User.where(id: 1).first
  irb(main):001:0&gt; user.password = user.password_confirmation ='IrF8WCsZJlMP'
  irb(main):001:0&gt; user.save!
  irb(main):001:0&gt; exit
  </code></pre>
  
  <p>But, it is not suitable for me, because I can not input commands interactively. I need one line command to set password, or set it while installing gitlab-ce.</p>
  
  <p>This way doesn't work too, it doesn't set password, only EXTERNAL_URL :</p>
  
  <pre><code>sudo GITLAB_ROOT_EMAIL="some@email.com" GITLAB_ROOT_PASSWORD="nTjYfcKxcW" EXTERNAL_URL="http://example.com" yum install gitlab-ce
  </code></pre>
  
  <p>Please help to set first gitlab root password non interactively, without visiting browser, via console with one line command or while gitlab-ce installation.<br>
  Thanks!</p>