Add cfgmgmt functions by isbm · Pull Request #52 · tinythings/sysinspect · GitHub
Skip to content
13 changes: 9 additions & 4 deletions docs/genusage/targeting.rst
16 changes: 13 additions & 3 deletions docs/global_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ Minion
Sysinspect Minion configuration is located under earlier mentioned ``minion`` section,
and contains the following directives:

``root``
``path.root``

Typically, Minion if running standard, the root of all data kept by a Minion is
defaulted to ``/etc/sysinspect``, same as Master. However, in an embedded and custom
systems this might not be possible, especially if the system is usually read-only
and writable directories are limited to only a few. In this case *root* must be
set according to the system setup.

``id.path``
``path.id``

By default, the minion Id is the ``/etc/machine-id``. However, this file is usually
present on a regular Linux server and desktop distributions, but practically never
Expand All @@ -187,6 +187,11 @@ and contains the following directives:

id.path: </absolute/path>|relative

``path.sharelib``

The location of sharelib directory, which is by default is at the location
``/usr/share/sysinspect``. On most embedded systems those root filesystem is usually read-only,
this location can be changed. This directory contains ``lib`` and ``modules`` subdirectories.


``master.ip``
Expand All @@ -195,7 +200,12 @@ and contains the following directives:

``master.port``

Corresponds to ``bind.ip.port`` of Master node and should be identical.
Corresponds to ``bind.ip.port`` of Master node and should be identical. By default it is
set to ``4200``.

``master.fileserver.port``

Port of Master's fileserver. By default it is set to ``4201``.

Example configuration for the Sysinspect Minion:

Expand Down
9 changes: 7 additions & 2 deletions docs/modeldescr/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ Model Description

.. _model_description:

The Model is essentially a configuration of a system. It is written in YAML format,
and it is following a specific expression schema and logic.
The Model is essentially a configuration of a system. It serves two purposes:

- An assertion verification about system integrity (information only)
- A state enforcement as a configuration management system does


The Aodel is written in YAML format, and it is following a specific expression schema and logic.

This document explains each part of the Model Description.

Expand Down
2 changes: 1 addition & 1 deletion docs/modeldescr/states.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ is passed, then default state is selected:

.. code-block:: text

syspect --model ./my_model --states=online,active
sysinspect --model ./my_model --states=online,active
27 changes: 26 additions & 1 deletion examples/models/inherited/evt.cfg
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
constraints:
addresses-verification:
descr: Addresses verification
entities:
- addresses
all:
interfaces:
- fact: if-up.virbr1.port
equals: static(entities.addresses.claims.interfaces.virtual.port)

- fact: if-up.virbr1.port
event: log

python-module-tests:
descr: Python module tests
entities:
- addresses
all:
interfaces:
- fact: uid
#equals:
#static(entities.addresses.claims.interfaces.ansible.not_changed)
equals: 1000
any:
interfaces:
- fact: changed
#equals: false
event: log

actions:
python-module-tests:
descr: Check if python module works at all
module: file.conf
module: cfg.bridge
bind:
- addresses

state:
interfaces:
opts:
- copy
args:
src: /etc/networks
dest: /tmp/networks.copy
mode: 0400
2 changes: 2 additions & 0 deletions examples/models/router/entities/ports.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ entities:
# Fact label. It is referred
# by a constraint, if needed
interfaces:
- ansible:
not_changed: false
- virtual:
if: virbr1
mac: "52:54:00:36:8D:71"
Expand Down
7 changes: 7 additions & 0 deletions examples/models/router/events/events-config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ events:
- console-logger
console-logger:
prefix: Asset Verification Error

log:
handler:
- console-logger
console-logger:
concise: false
prefix: Configuration Management Results
2 changes: 1 addition & 1 deletion examples/models/router/relations/basic.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ relations:
interfaces:
requires:
- addresses
- routes
#- routes

# State
$:
Expand Down
2 changes: 1 addition & 1 deletion libsysinspect/src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ impl SysInspectRunner {
}
}
}
evtproc.process();
}
Err(err) => {
log::error!("{}", err);
}
}
evtproc.process();
}
Err(err) => log::error!("{err}"),
}
Expand Down
55 changes: 40 additions & 15 deletions libsysinspect/src/intp/actproc/modfinder.rs
Loading