-
Notifications
You must be signed in to change notification settings - Fork 5
Configuring ce‐provision
You can configure ce-provision by providing a Git repository with Ansible settings, customised playbooks, default variables, extra plugins and so forth. By default ce-provision will take its initial config from our example repo which is also a good one to copy to get started.
While you can store your configuration anywhere, this is a quick start guide so we will assume you have followed our installation steps and you are going to use the GitLab instance installed on your controller to house your ce-provision-config. This is how you fork our example repository into your own config repository, so you can take control of your own ce-provision-config.
- Logged into your controller server via SSH or browser terminal, switch to the controller user:
sudo su -l controller - Fetch the GitLab root password from the temporary file where it was created:
cat /tmp/passwordfile - In a web browser go to your GitLab installation, for example https://gitlab.controller.acme.com, and login with these details:
root- the password from
/tmp/passwordfile(any problems, you can findinitial_root_passwordin the file at/etc/gitlab/gitlab.rb)
- Click
Create a group->Create group- we recommend you name it
Coreand leave it private
- we recommend you name it
- On the next page click
New project->Create a blank project- we recommend you name it
ce-provision-config, leave it private and do not create a README
- we recommend you name it
At this point you should have a new repository at https://gitlab.controller.acme.com/core/ce-provision-config (obviously with your controller server URL, not our example one).
- Back in your server, grab the public part of your controller user's SSH key pair:
cat .ssh/id_ed25519.pub - Copy the resulting line to your clipboard and go back to GitLab in your browser (tip: usually clicking three times selects the line)
- Click on the
Adminbutton in the bottom left corner - In the left-hand admin menu click on
Deploy keysthen theNew deploy keybutton - Create your key with these values and click
Create:-
Title:controller@controller.acme.com(changing hostname of course) -
Key: paste the public key from the server in here -
Expiration date: blank
-
- Go back to your repository, e.g. https://gitlab.controller.acme.com/core/ce-provision-config
- On the left-hand Project menu click
Settings->Repository - Expand the
Deploy keyssection, clickPublicly accessible deploy keysand clickEnableagainst your new key - Go to
Enabled deploy keysin the same dialogue and click the little pencil icon to edit - Tick
Grant write permissions to this keyand clickSave changes
- Go back to your repository again in GitLab, click the blue
Codebutton and copy theClone with SSHvalue - Back on your server, change to the directory where the example ce-provision-config was installed:
cd ce-provision/config - Execute the following commands to sort out your Git repository configuration:
# move the example repo out of the way
git remote rename origin example
# add a new remote for our new repo - use your URL from step 1!
git remote add origin git@gitlab.controller.acme.com:core/ce-provision-config.git
# push our changes - you will need to confirm the connection by typing 'yes'
git push origin 2.xReturning to your repository in GitLab, e.g. https://gitlab.controller.acme.com/core/ce-provision-config, you will now see your own ce-provision-config repository, which you can now control and edit with the settings you need for ce-provision in your infra.
In your repository browse to hosts -> group_vars -> all and click on the file ce_provision.yml. It will look something like this:
ce_provision:
own_repository: https://github.com/codeenigma/ce-provision.git
own_repository_branch: 2.x
# Once you have created your own config repo using this as a base, update this URL.
config_repository: https://github.com/codeenigma/ce-provision-config-example.git
config_repository_branch: 2.x
username: controller
local_dir: /home/controller/ce-provision
groups:
- bypass2faAs the comment states, you need to update the config_repository variable with the value you copied to your clipboard in step 1 of the previous section, the Git URL to your repository. Click the blue Edit button thenEdit single file and you can change the file, for example:
ce_provision:
own_repository: https://github.com/codeenigma/ce-provision.git
own_repository_branch: 2.x
config_repository: git@gitlab.controller.acme.com:core/ce-provision-config.git
config_repository_branch: 2.x
username: controller
local_dir: /home/controller/ce-provision
groups:
- bypass2faOnce you file looks like the above, click the Commit changes button under the editor and return to your server. You should already be in the right place, so just run this command to fetch your change: git pull origin 2.x
Your options are pretty limitless, so we will focus on two main areas:
- How to build your first remote server using ce-provision
- How to configure ce-provision to manage your AWS account(s)
TODO
TODO
TODO