-
Notifications
You must be signed in to change notification settings - Fork 5
Infrastructure repository
This section assumes you have read and followed the Quick Start pages.
If you only have a single "infrastructure", for example you're just running ce-provision for your own company servers and there really aren't that many of them, you can probably stick with basic usage and the ce-provision-config approach.
However, if you have logically separate sets of servers and services with one or more cloud or hosting providers, you may want to separate their configurations and playbooks out into separate repositories to make management easier. At Code Enigma we call these logical groupings "infrastructures" and we keep the playbooks and variables unique to the elements of each infrastructure in its own Git repository, typically on the controller server.
Firstly, we need to create the new repository on our GitLab server:
- In a web browser go to your GitLab installation, for example https://gitlab.controller.acme.com/, and login - instructions here, step 3
- Click on Groups on the left menu
- Click the
New groupbutton on the right, thenCreate group- we recommend you name it
Infrasand leave it private - this is where we will store our "infra" repositories
- we recommend you name it
- On the next page click
New project->Create a blank project- we recommend you name it something sensible and recognisable, beginning with
infra, leave it private and do not create a README - for this example we will use
infra-main-website
- we recommend you name it something sensible and recognisable, beginning with
At this point you should have a new repository at https://gitlab.controller.acme.com/infras/infra-main-website (obviously with your controller server URL, not our example one).
We have a template repository for an AWS account. To use it:
- Still in GitLab, as stated in the README for the template, create a global environment variable called
ENVinAdmin->Settings->CI/CD->Variables -
Go to our templates repository, click the green
Codebutton and clickDownload ZIP - Create a folder on your computer where you want to keep your repository and copy the contents of the extracted
NETWORKfolder into it- Be sure to get all the hidden files!
- You can delete
README.mdif you wish
-
As stated in the README for the template, find and replace all instances of these strings:
-
SHORTNAME- your infrastructure name -
CIDR_BASE- your VPC CIDR base for IPv4 addressing
-
Example:
# do this within your infra repo folder
find ./ -type f -exec sed -i -e 's/SHORTNAME/main-website/g' {} \;
find ./ -type f -exec sed -i -e 's/CIDR_BASE/10.0/g' {} \;- Back in GitLab, add an SSH key by clicking the
Add SSH keybutton in the banner, if you have not already done so - On your project page, follow the
Push an existing folderinstructions on your project front page, but use the branch nameapply
@TODO
@TODO
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