This repository contains Ansible modules for Mirantis Container Cloud (MCC) that are released to customers.
Modules manage various system configurations through Ansible playbooks, adhering to specific schemas and metadata requirements.
- Make changes to a module or introduce a new one
- Do not change
version
field of themetadata.yaml
files manually make
- Commit changes
- Test the new CR
make promote
- Commit changes
Each module directory contains specific files crucial for the operation of the OS Modules.
The common structure within each module is as follows:
main.yaml
: The primary playbook file that defines tasks to be executed.metadata.yaml
: Provides metadata about the module like name, version, and relevant documentation URLs.schema.json
: Defines the JSON schema for validating configurations specific to the module (i.e. restricted values).
Important - make sure to run
make
locally when updating modules, to keepindex.yaml
up to date.
Modules are indexed in index.yaml
file that is stored in this repo. Before committing to gerrit, please run make
to ensure fresh build and correct sha256 sums for module artifacts.
The directory .githooks
contains Git hooks that can be used to enforce building modules and index.yaml
.
Do not change metadata.yaml
's version
field manually, it will be changed automatically after running the make
before committing.
To install the hooks, run the following command:
cp ./.githooks/pre-commit ./.git/hooks
pre-commit
: runs make build tgz sort-index
before committing changes and compares
the output of the git diff
command before and after.
Requirements:
go
make
shasum
Modules and index.yaml
are built using cmd/module-builder.go
to ensure reproduceable tar.gz builds.
Modules are installed and controlled through two CRs in the management cluster:
Ansible module execution is implemented using the existing LCM mechanism, by creating an additional StateItem
for mapped LCMMachines
in MCC management cluster. For more implementation details, see (MOSK documentation)[https://docs.mirantis.com/mosk/latest/ops/bm-operations/host-os-conf/day2-intro.html].
Modules provided by MCC use the designated HostOSConfigurationModule
object named mcc-modules
.
All other HostOSConfigurationModule
objects contain custom modules.
Warning:: Do not modify the
mcc-modules
object, any changes will be overwritten with data from an external source.
Modules provided by MCC are described in this repository in their respective folders.
All modules and index.yaml
are built per-commit by Jenkins using pipeline, that runs the Makefile
in a container. Merged modules are then avaiable on internal artifactory and in master
branch of artifact-metadata
.
Use make promote
to promote latest modules version in the repository, so new non-development versions are set for every module and all dev versions are removed from index.yaml
.
In time for release, move artifact-metadata
items to release
branch to release them onto https://binary.mirantis.com/?prefix=bm/bin/host-os-modules/.