2.0 KiB
2.0 KiB
GitLab
- Install Gitlab
-
After Gitlab is installed you may sign if with the
root
user and password5iveL!fe
-
Make a user for yourself
-
Make an ssh key to link with your user. You’ll want to do this on the machine you intend to edit code from ( most likely not your puppet master but your local workstation / laptop )
- Create a group called
puppet
( this is case sensitive )
- Create a user called
r10k_api_user
and add them to thepuppet
group
- From the landing page, select groups
- Choose the puppet group
- In the left hand pane, select memembers
- Add the
r10k_api_user
withmaster
permissions
-
Add your user to the
puppet
group as well -
Create a project called
control-repo
and set the Namespace to be thepuppet
group -
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
- Clone this control repository to your laptop/workstation
git clone <repository url>
cd control-repo
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
- edit
-
git add hieradata/nodes/<fqdn_of_your_puppet_master>.yaml
-
git commit -m "renaming example-puppet-master.yaml"
-
Rename my repository as the upstream remote
git remote rename origin upstream
- Add your internal repository as the origin remote
git remote add origin <url of your gitlab repository>
- Push the production branch of the repository from your machine up to your git server
git push origin production
git branch --set-upstream-to origin/production