Skip to content

Commit

Permalink
Improve configuration-repository a little bit (#159)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt authored Nov 21, 2023
1 parent 77f09a1 commit e5df350
Showing 1 changed file with 30 additions and 59 deletions.
89 changes: 30 additions & 59 deletions docs/guides/configuration-guide/configuration-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,80 +5,51 @@ sidebar_position: 10

# Configuration Repository

The entire configuration required for OSISM is stored in a single Git monorepo.
The configuration required for OSISM is stored in a single Git monorepo, the configuration repository.

## Configuration repository layout

A configuration repository is always composed of the same basic layout.

* `gilt.yml` & `requirements.txt` files
* `environments` directory
* `inventory` directory
* `netbox` directory (optional)
* **`environments` directory**
* **`inventory` directory**
* **`netbox` directory (optional)**
* **`requirements.txt` file**

### `gilt.yml` & `requirements.txt` files
In the `requirements.txt` the necessary dependencies are listed to be able to execute Gilt.

[Gilt](https://gilt.readthedocs.io) is a Git layering tool. We use Gilt to maintain the image versions,
Ansible configuration and scripts within the `environments/manager` directory.
* **`gilt.yml` file**

The [current gilt.yml](https://github.com/osism/cfg-generics/blob/main/gilt.yml) file is always
located in the [osism/cfg-generics](https://github.com/osism/cfg-generics) repository.
[Gilt](https://gilt.readthedocs.io) is a Git layering tool. We use Gilt to maintain the image versions,
Ansible configuration and scripts within the `environments/manager` directory.

```yaml title="gilt.yml (date of this example: 2023-10-09)"
---
- git: https://github.com/osism/cfg-generics.git
version: main
files:
- src: src/render-images.py
dst: ./environments/manager/render-images.py
- src: gilt.yml
dst: ./gilt.yml
- src: requirements.txt
dst: ./requirements.txt
- src: environments/manager/images.yml
dst: environments/manager/images.yml
- src: environments/manager/run.sh
dst: environments/manager/run.sh
- src: environments/manager/ansible.cfg
dst: environments/manager/ansible.cfg
- src: environments/manager/requirements.*
dst: environments/manager/
post_commands:
- python3 render-images.py
- rm render-images.py
```
In the `requirements.txt` the necessary dependencies are listed to be able to execute Gilt.
The [current gilt.yml](https://github.com/osism/cfg-generics/blob/main/gilt.yml) file is always
located in the [osism/cfg-generics](https://github.com/osism/cfg-generics) repository.

To use Gilt the dependencies are installed first.

```
pip3 install -r requirements.txt
```
To use Gilt the dependencies are installed first.

After that you can update the manager environment in `environments/manager`. Since the `gilt.yml`
itself is updated with Gilt it is always important to run the command twice.
```
pip3 install -r requirements.txt
```

```
gilt overlay
gilt overlay
```
If a stable OSISM release is used, the version to be used is specified by `MANAGER_VERSION`.
In the example, OSISM release 6.0.0 is used. More detail about this in
[Configuration Guide > Manager > Stable release](manager#stable-release).
```
MANAGER_VERSION=6.0.0 gilt overlay
MANAGER_VERSION=6.0.0 gilt overlay
```
After that you can update the manager environment in `environments/manager`. Since the `gilt.yml`
itself is updated with Gilt it is always important to run the command twice.

### `environments` directory
```
gilt overlay
gilt overlay
```

### `inventory` directory
If a stable OSISM release is used, the version to be used is specified by `MANAGER_VERSION`.
In the example, OSISM release 6.0.0 is used. The current stable release is listed at
[release.osism.tech](https://release.osism.tech/). Always check there in advance and do not
copy the stable release used here as an example. More detail about this in
[Configuration Guide > Manager > Stable release](manager#stable-release).

### `netbox` directory
```
MANAGER_VERSION=6.0.0 gilt overlay
MANAGER_VERSION=6.0.0 gilt overlay
```

## Creating a new configuration repository

Expand Down

0 comments on commit e5df350

Please sign in to comment.