Skip to content

Commit

Permalink
docs(config_management): document module
Browse files Browse the repository at this point in the history
!17 #42
  • Loading branch information
jon-nfc committed Jun 3, 2024
1 parent 1f35f44 commit 62e605d
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 7 deletions.
31 changes: 31 additions & 0 deletions docs/projects/django-template/config_management/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Config Management
description: No Fuss Computings Django ITSM Config Management Module
date: 2024-06-03
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/django_app
---

Config Management is an ITSM process that deals with the management and storing of device/host configuration. This module aims to bridge the gap between manual entry of config data via JSON/YAML to entry via a UI. For items that are yet to be integrated into the UI, if at all possible, that config is still manually entered as JSON. The rendered configuration is intended to be consumed by Ansible. For all intents and purposes, consider this module to be the equivalent of Ansible's host groups.


## Features

This module contains the following features:

- Config Groups

- Assign host to multiple groups

- History


## Config Groups

Considerable thought was placed into as wide a scope as possible, how the host config groups would function. This includes how the end product (the config) would be rendered. To aid in conveying how the config is rendered, consider the following image, which is a basic tree from a single root at the top, with three branches.

![config-merging](../images/config-groups-merging.png)

A host can be assigned to multiple groups as long as the host is not part of the same branch. This image has had each node coloured to denote different groups of the same branch. Note: the red node is a common node for the three branches. for example a host can be placed in each of the three coloured branches. the root node however, if the host is placed in this group then the host can not be placed in any other node. this is because the red node is the root for all three coloured branches.

When it comes time to merge the configuration, if a parent group has the same config as it's childs config. The childs config will take precedence. For a host that is placed in all three branches (orange, green and blue), based of of the group name, sorted alphanumerically, the last group that has conflicting config will be the one that is used. A groups config will always be rendered with it's parents config included all the way up the branch to the root node.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions docs/projects/django-template/images/config-groups.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<mxfile host="app.diagrams.net" modified="2024-06-03T01:49:35.015Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" etag="jYMoo90cuGXn_K-Y5V_J" version="24.2.1" type="device">
<diagram name="Page-1" id="sbUyBCaYiuDQ_FkowPAe">
<mxGraphModel dx="1434" dy="766" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="3ROtmLI4iqX4xD-AvKj1-1" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#FF3333;" vertex="1" parent="1">
<mxGeometry x="545" y="40" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-2" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#FF9933;" vertex="1" parent="1">
<mxGeometry x="345" y="214" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="3ROtmLI4iqX4xD-AvKj1-3" target="3ROtmLI4iqX4xD-AvKj1-2">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-3" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#FF9933;" vertex="1" parent="1">
<mxGeometry x="345" y="374" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-7" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="3ROtmLI4iqX4xD-AvKj1-4" target="3ROtmLI4iqX4xD-AvKj1-3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-4" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#FF9933;" vertex="1" parent="1">
<mxGeometry x="345" y="534" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-8" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#99FF33;" vertex="1" parent="1">
<mxGeometry x="545" y="214" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="3ROtmLI4iqX4xD-AvKj1-10" target="3ROtmLI4iqX4xD-AvKj1-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-10" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#99FF33;" vertex="1" parent="1">
<mxGeometry x="545" y="374" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-11" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="3ROtmLI4iqX4xD-AvKj1-12" target="3ROtmLI4iqX4xD-AvKj1-10">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-12" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#99FF33;" vertex="1" parent="1">
<mxGeometry x="545" y="534" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-13" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#3399FF;" vertex="1" parent="1">
<mxGeometry x="745" y="214" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-14" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="3ROtmLI4iqX4xD-AvKj1-15" target="3ROtmLI4iqX4xD-AvKj1-13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-15" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#3399FF;" vertex="1" parent="1">
<mxGeometry x="745" y="374" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-16" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="3ROtmLI4iqX4xD-AvKj1-17" target="3ROtmLI4iqX4xD-AvKj1-15">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-17" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#3399FF;" vertex="1" parent="1">
<mxGeometry x="745" y="534" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-20" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="390" y="210" as="sourcePoint" />
<mxPoint x="540" y="110" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-21" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="780" y="210" as="sourcePoint" />
<mxPoint x="630" y="110" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="3ROtmLI4iqX4xD-AvKj1-22" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="585" y="210" as="sourcePoint" />
<mxPoint x="585" y="130" as="targetPoint" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
8 changes: 4 additions & 4 deletions docs/projects/django-template/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ This application contains the following module:

- [Application wide settings](settings.md)

- [Multi-Tenant](permissions.md)
- [Configuration Management](config_management/index.md)

- [IT Asset Management (ITAM)](itam/index.md)
- History

- [Configuration ready for ansible](itam/device.md#configuration)
- [IT Asset Management (ITAM)](itam/index.md)

- History
- [Multi-Tenant](permissions.md)

Specific features for a module can be found on the module's documentation un the features heading

Expand Down
7 changes: 4 additions & 3 deletions docs/projects/django-template/itam/device.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This tab display the details of the device.

To add a new model navigate to `settings -> ITAM -> Device Models`


### Operating System

This tab shows the operating system selected as installed on the device. the version `name` is intended to be full [semver](https://semver.org/).
Expand All @@ -49,17 +50,17 @@ This tab shows the operating system selected as installed on the device. the ver

This tab displays both software actions and installed software. Software install details are added/updated by uploading an [inventory report](../api.md#inventory-reports).

You can specify a software action for any piece of software within the ITAM database. You can do this by pressing the `dd software action` button or if the software is installed clicking on the `+ Add` button on the row of the software to add the action to. An action can be set to either `Install` or `Remove` and you can also select a software version from the database if you choose to do so. Software actions are added to config management and can be pulled from the API for use within an Ansible playbook.
You can specify a software action for any piece of software within the ITAM database. You can do this by pressing the `Add Software Action` button or if the software is installed clicking on the `+ Add` button on the row of the software to add the action to. An action can be set to either `Install` or `Remove` and you can also select a software version from the database if you choose to do so. Software actions are added to config management and can be pulled from the API for use within an Ansible playbook.

Display of both installed software and software actions is within a single row, if it's for the same software. Any software that you add an action to, will be displayed at the top of the list of software tab.

!!! info
If you add a software action for software that is already installed using the `add software action` button, an additional row will not be added as the applications logic is smart enough to check if the software is already installed.
If you add a software action for software that is already installed using the `Add Software Action` button, an additional row will not be added as the applications logic is smart enough to check if the software is already installed.


### Configuration

Although, configuration is generally part of config management. This tab displays in `JSON` format configuration that is ready for use. The intended audience is Ansible users with the fields provided matching established Ansible modules, if they exist.
This tab displays in `JSON` format configuration that is ready for use. Config from the [Config Management](../config_management/index.md) module is also included and rendered as part of this config. The intended audience is Ansible users with the fields provided matching established Ansible modules, if they exist.

This configuration can also be obtained from API endpoint `/api/config/<machine-slug>` where `<machine-slug>` would match the Ansible `inventory_hostname`.

Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ nav:

- projects/django-template/api.md

- projects/django-template/config_management/index.md

- projects/django-template/permissions.md

- Core:
Expand Down

0 comments on commit 62e605d

Please sign in to comment.