control-repo/gitlab.md
2016-03-31 01:07:35 +01:00

2.0 KiB
Raw Blame History

GitLab

  1. Install Gitlab
  1. After Gitlab is installed you may sign if with the root user and password 5iveL!fe

  2. Make a user for yourself

  3. Make an ssh key to link with your user. Youll want to do this on the machine you intend to edit code from ( most likely not your puppet master but your local workstation / laptop )

  1. Create a group called puppet ( this is case sensitive )
  1. Create a user called r10k_api_user and add them to the puppet group
  • From the landing page, select groups
  • Choose the puppet group
  • In the left hand pane, select memembers
  • Add the r10k_api_user with master permissions
  1. Add your user to the puppet group as well

  2. Create a project called control-repo and set the Namespace to be the puppet group

  3. Logout of root and login as the r10k_api_user

  • Go to profile settings -> account ( https://<your_gitlab_server>/profile/account )
  • Copy the api token
  1. Clone this control repository to your laptop/workstation
  • git clone <repository url>
  • cd control-repo
  1. git mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/<fqdn_of_your_puppet_master>.yaml
  • Open hieradata/nodes/<fqdn_of_your_puppet_master>.yaml
    • edit gms_api_token to be your api token
    • edit git_management_system to be 'gitlab'
    • edit the gms_server_url
  1. git add hieradata/nodes/<fqdn_of_your_puppet_master>.yaml

  2. git commit -m "renaming example-puppet-master.yaml"

  3. Rename my repository as the upstream remote

  • git remote rename origin upstream
  1. Add your internal repository as the origin remote
  • git remote add origin <url of your gitlab repository>
  1. Push the production branch of the repository from your machine up to your git server
  • git push origin production
  1. git branch --set-upstream-to origin/production