Command Reference

All inmanta commands and services are started by the inmanta command. This page provides an overview of all subcommands available:

inmanta

usage: inmanta [-h] [-p] [-c CONFIG_FILE] [--config-dir CONFIG_DIR]
               [--log-file LOG_FILE] [--log-file-level LOG_FILE_LEVEL]
               [--timed-logs] [-v] [--warnings {warn,ignore,error}] [-X]
               [--version]
               {server,agent,compile,list-commands,help,modules,module,project,deploy,export}
               ...

Named Arguments

-p

Profile this run of the program

Default: False

-c, --config

Use this config file

--config-dir

The directory containing the Inmanta configuration files

Default: “/etc/inmanta/inmanta.d”

--log-file

Path to the logfile

--log-file-level

Log level for messages going to the logfile: 0=ERROR, 1=WARNING, 2=INFO, 3=DEBUG

Default: 2

--timed-logs

Add timestamps to logs

Default: False

-v, --verbose

Log level for messages going to the console. Default is only errors,-v warning, -vv info and -vvv debug and -vvvv trace

Default: 0

--warnings

Possible choices: warn, ignore, error

The warning behaviour of the compiler. Must be one of ‘warn’, ‘ignore’, ‘error’

Default: “warn”

-X, --extended-errors

Show stack traces for errors

Default: False

--version

Show the version of the installed Inmanta product and the version of its subcomponents

Default: False

Sub-commands:

server

Start the inmanta server

inmanta server [-h]

agent

Start the inmanta agent

inmanta agent [-h]

compile

Compile the project to a configuration model

inmanta compile [-h] [-e ENVIRONMENT] [-X] [--server_address SERVER]
                [--server_port PORT] [--username USER] [--password PASSWORD]
                [--ssl] [--ssl-ca-cert CA_CERT] [--export-compile-data]
                [--export-compile-data-file EXPORT_COMPILE_DATA_FILE]
                [--experimental-data-trace] [--experimental-dataflow-graphic]
                [--experimental-cache] [-f MAIN_FILE]
Named Arguments
-e

The environment to compile this model for

-X, --extended-errors

Show stack traces for compile errors

Default: False

--server_address

The address of the server hosting the environment

--server_port

The port of the server hosting the environment

--username

The username of the server

--password

The password of the server

--ssl

Enable SSL

Default: False

--ssl-ca-cert

Certificate authority for SSL

--export-compile-data

Export structured json containing compile data such as occurred errors.

Default: False

--export-compile-data-file

File to export compile data to. If omitted compile_data.json is used.

--experimental-data-trace

Experimental data trace tool useful for debugging

Default: False

--experimental-dataflow-graphic

Experimental graphic data flow visualization

Default: False

--experimental-cache

Enables the experimental caching of compiled files.

Default: False

-f

Main file

Default: “main.cf”

list-commands

Print out an overview of all commands

inmanta list-commands [-h]

help

show a help message and exit

inmanta help [-h] [subcommand]
Positional Arguments
subcommand

Output help for a particular subcommand

modules (module)

Subcommand to manage modules

inmanta modules [-h] [-m [MODULE]]
                {add,list,do,update,install,status,push,verify,commit,create,freeze,build,v1tov2}
                ...
Named Arguments
-m, --module

Module to apply this command to

subcommand
cmd

Possible choices: add, list, do, update, install, status, push, verify, commit, create, freeze, build, v1tov2

Sub-commands:
add

Add a module dependency to an Inmanta module or project. When executed on a project, the module is installed as well. Either –v1 or –v2 has to be set.

inmanta modules add [-h] [--v1] [--v2] [--override] module_req
Positional Arguments
module_req

The name of the module, optionally with a version constraint.

Named Arguments
--v1

Add the given module as a v1 module

Default: False

--v2

Add the given module as a V2 module

Default: False

--override

Override the version constraint when the given module dependency already exists.

Default: False

list

List all modules used in this project in a table

inmanta modules list [-h] [-r]
Named Arguments
-r

(deprecated) Output a list of requires that can be included in project.yml

Default: False

do

Execute a command on all loaded modules

inmanta modules do [-h] command
Positional Arguments
command

the command to execute

update

Update all modules to the latest version compatible with the module version constraints and install missing modules.

This command might reinstall Python packages in the development venv if the currently installed versions are not the latest compatible with the dependencies specified by the updated modules.

inmanta modules update [-h]
install

Install a module in the active Python environment. Only works for v2 modules: v1 modules can only be installed in the context of a project.

This command might reinstall Python packages in the development venv if the currently installed versions are not compatible with the dependencies specified by the installed module.

Like pip install, this command does not reinstall a module for which the same version is already installed, except in editable mode.

inmanta modules install [-h] [-e] [path]
Positional Arguments
path

The path to the module.

Named Arguments
-e, --editable

Install in editable mode.

Default: False

status

Run a git status on all modules and report

inmanta modules status [-h]
push

Run a git push on all modules and report

inmanta modules push [-h]
verify

Verify dependencies and frozen module versions

inmanta modules verify [-h]
commit

Commit all changes in the current module.

inmanta modules commit [-h] -m MESSAGE [-r] [--major] [--minor] [--patch]
                       [-v VERSION] [-a] [-t] [-n]
Named Arguments
-m, --message

Commit message

-r, --release

make a release

Default: True

--major

make a major release

Default: False

--minor

make a major release

Default: False

--patch

make a major release

Default: False

-v, --version

Version to use on tag

-a, --all

Use commit -a

Default: False

-t, --tag

Create a tag for the commit.Tags are not created for dev releases by default, if you want to tag it, specify this flag explicitly

Default: False

-n, --no-tag

Don’t create a tag for the commit

Default: False

create

Create a new module

inmanta modules create [-h] [--v1] name
Positional Arguments
name

The name of the module

Named Arguments
--v1

Create a v1 module. By default a v2 module is created.

Default: False

freeze

Set all version numbers in project.yml

inmanta modules freeze [-h] [-o OUTFILE] [-r] [--operator {==,~=,>=}]
Named Arguments
-o, --outfile

File in which to put the new project.yml, default is the existing project.yml

-r, --recursive

Freeze dependencies recursively. If not set, freeze_recursive option in project.yml is used,which defaults to False

--operator

Possible choices: ==, ~=, >=

Comparison operator used to freeze versions, If not set, the freeze_operator option in project.yml is used which defaults to ~=

build

Build a Python package from a V2 module.

inmanta modules build [-h] [-o OUTPUT_DIR] [path]
Positional Arguments
path

The path to the module that should be built. By default, the current working directory is used.

Named Arguments
-o, --output-dir

The directory where the Python package will be stored. Default: <module_root>/dist

v1tov2

Convert a V1 module to a V2 module in place

inmanta modules v1tov2 [-h]

project

Subcommand to manage the project

inmanta project [-h] {freeze,init,install,update} ...
subcommand
cmd

Possible choices: freeze, init, install, update

Sub-commands:
freeze

Set all version numbers in project.yml

inmanta project freeze [-h] [-o OUTFILE] [-r] [--operator {==,~=,>=}]
Named Arguments
-o, --outfile

File in which to put the new project.yml, default is the existing project.yml

-r, --recursive

Freeze dependencies recursively. If not set, freeze_recursive option in project.yml is used,which defaults to False

--operator

Possible choices: ==, ~=, >=

Comparison operator used to freeze versions, If not set, the freeze_operator option in project.yml is used which defaults to ~=

init

Initialize directory structure for a project

inmanta project init [-h] --name NAME [--output-dir OUTPUT_DIR] [--default]
Named Arguments
--name, -n

The name of the new project

--output-dir, -o

Output directory path

Default: “./”

--default

Use default parameters for the project generation

Default: False

install

Install all modules required for this project.

This command installs missing modules in the development venv, but doesn’t update already installed modules if that’s not required to satisfy the module version constraints. Use inmanta modules update instead if the already installed modules need to be updated to the latest compatible version.

This command might reinstall Python packages in the development venv if the currently installed versions are not compatible with the dependencies specified by the different Inmanta modules.

inmanta project install [-h]
update

Update all modules to the latest version compatible with the module version constraints and install missing modules.

This command might reinstall Python packages in the development venv if the currently installed versions are not the latest compatible with the dependencies specified by the updated modules.

inmanta project update [-h]

deploy

Deploy with a inmanta all-in-one setup

inmanta deploy [-h] [--dry-run] [-f MAIN_FILE] [--dashboard]
Named Arguments
--dry-run

Only report changes

Default: False

-f

Main file

Default: “main.cf”

--dashboard

Start the dashboard and keep the server running. The server uses the current project as the source for server recompiles

Default: False

export

Export the configuration

inmanta export [-h] [-g] [-j JSON] [-e ENVIRONMENT] [-d] [--full] [-m]
               [--server_address SERVER] [--server_port PORT] [--token TOKEN]
               [--ssl] [--ssl-ca-cert CA_CERT] [-X] [-f MAIN_FILE]
               [--metadata METADATA] [--model-export]
               [--export-plugin EXPORT_PLUGIN] [--export-compile-data]
               [--export-compile-data-file EXPORT_COMPILE_DATA_FILE]
               [--experimental-cache]
Named Arguments
-g

Dump the dependency graph

Default: False

-j

Do not submit to the server but only store the json that would have been submitted in the supplied file

-e

The environment to compile this model for

-d

Trigger a deploy for the exported version

Default: False

--full

Make the agents execute a full deploy instead of an incremental deploy. Should be used together with the -d option

Default: False

-m

Also export the complete model

Default: False

--server_address

The address of the server to submit the model to

--server_port

The port of the server to submit the model to

--token

The token to auth to the server

--ssl

Enable SSL

Default: False

--ssl-ca-cert

Certificate authority for SSL

-X, --extended-errors

Show stack traces for compile errors

Default: False

-f

Main file

Default: “main.cf”

--metadata

JSON metadata why this compile happened. If a non-json string is passed it is used as the ‘message’ attribute in the metadata.

--model-export

Export the configuration model to the server as metadata.

Default: False

--export-plugin

Only use this export plugin. This option also disables the execution of the plugins listed in the configuration file in the export setting.

--export-compile-data

Export structured json containing compile data such as occurred errors.

Default: False

--export-compile-data-file

File to export compile data to. If omitted compile_data.json is used.

--experimental-cache

Enables the experimental caching of compiled files.

Default: False

inmanta-cli

The inmanta-cli command can be used to interact with the inmanta server and agents, including managing projects, environments, parameters and more. The following reference explains the available subcommands.

inmanta-cli

Base command

inmanta-cli [OPTIONS] COMMAND [ARGS]...

Options

--host <host>

The server hostname to connect to

--port <port>

The server port to connect to

action-log

Subcommand to view the resource action log

inmanta-cli action-log [OPTIONS] COMMAND [ARGS]...
list

List the resource action log for a specific Resource.

inmanta-cli action-log list [OPTIONS]

Options

-e, --environment <environment>

Required The ID or name of the environment to use

--rvid <rvid>

Required The resource version ID of the resource

--action <action>

Only list this resource action

Options

store | push | pull | deploy | dryrun | getfact | other

show-messages

Show the log messages for a specific entry in the resource action log.

inmanta-cli action-log show-messages [OPTIONS]

Options

-e, --environment <environment>

Required The ID or name of the environment to use

--rvid <rvid>

Required The resource version ID of the resource

--action-id <action_id>

Required The ID of the resource action record

agent

Subcommand to manage agents

inmanta-cli agent [OPTIONS] COMMAND [ARGS]...
list

List agents in an environment

inmanta-cli agent list [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

pause

Pause a specific agent or all agents in a given environment. A paused agent cannot execute deploy operations.

inmanta-cli agent pause [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

--agent <agent>

The name of the agent to pause.

--all

Pause all agents in the given environment

unpause

Unpause a specific agent or all agents in a given environment. A unpaused agent will be able to execute deploy operations.

inmanta-cli agent unpause [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

--agent <agent>

The name of the agent to unpause.

--all

Unpause all agents in the given environment

environment

Subcommand to manage environments

inmanta-cli environment [OPTIONS] COMMAND [ARGS]...
create

Create a new environment

inmanta-cli environment create [OPTIONS]

Options

-n, --name <name>

Required The name of the new environment

-p, --project <project>

Required The id of the project this environment belongs to

-r, --repo-url <repo_url>

The url of the repository that contains the configuration model

-b, --branch <branch>

The branch in the repository that contains the configuration model

-s, --save

Save the ID of the environment and the server to the .inmanta config file

delete

Delete an existing environment

ENVIRONMENT: ID or name of the environment to delete

inmanta-cli environment delete [OPTIONS] ENVIRONMENT

Arguments

ENVIRONMENT

Required argument

list

List all environments

inmanta-cli environment list [OPTIONS]
modify

Modify an existing environment

ENVIRONMENT: ID or name of the environment to modify

inmanta-cli environment modify [OPTIONS] ENVIRONMENT

Options

-n, --name <name>

Required The name of the new environment

-r, --repo-url <repo_url>

The url of the repository that contains the configuration model

-b, --branch <branch>

The branch in the repository that contains the configuration model

Arguments

ENVIRONMENT

Required argument

save

Save the ID of the environment and the server to the .inmanta config file

ENVIRONMENT: ID or name of the environment to write the config for

inmanta-cli environment save [OPTIONS] ENVIRONMENT

Arguments

ENVIRONMENT

Required argument

setting

Subcommand to manage environment settings

inmanta-cli environment setting [OPTIONS] COMMAND [ARGS]...
delete

Delete an environment setting

inmanta-cli environment setting delete [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

-k, --key <key>

Required The key to delete

get

Get an environment setting

inmanta-cli environment setting get [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

-k, --key <key>

Required The key to get

list

List settings of an environment

inmanta-cli environment setting list [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

set

Adjust an environment setting

inmanta-cli environment setting set [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

-k, --key <key>

Required The key to set

-o, --value <value>

Required The value to set

show

Show details of an environment

ENVIRONMENT: ID or name of the environment to show

inmanta-cli environment show [OPTIONS] ENVIRONMENT

Arguments

ENVIRONMENT

Required argument

monitor

Monitor the deployment process of the configuration model in an environment, receiving continuous updates on the deployment status

inmanta-cli monitor [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

param

Subcommand to manage parameters

inmanta-cli param [OPTIONS] COMMAND [ARGS]...
get

Get a parameter from an environment

inmanta-cli param get [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

--name <name>

Required The name of the parameter

--resource <resource>

The resource id of the parameter

list

List parameters in an environment

inmanta-cli param list [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

set

Set a parameter in an environment

inmanta-cli param set [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

--name <name>

Required The name of the parameter

--value <value>

Required The value of the parameter

project

Subcommand to manage projects

inmanta-cli project [OPTIONS] COMMAND [ARGS]...
create

Create a new project on the server

inmanta-cli project create [OPTIONS]

Options

-n, --name <name>

Required The name of the new project

delete

Delete an existing project.

PROJECT: The id or name of the project to delete

inmanta-cli project delete [OPTIONS] PROJECT

Arguments

PROJECT

Required argument

list

List all projects

inmanta-cli project list [OPTIONS]
modify

Modify an existing project.

PROJECT: The id or name of the project to modify

inmanta-cli project modify [OPTIONS] PROJECT

Options

-n, --name <name>

Required The new name of the project

Arguments

PROJECT

Required argument

show

Show the details of a single project

PROJECT: The id or name of the project to show

inmanta-cli project show [OPTIONS] PROJECT

Arguments

PROJECT

Required argument

token

Subcommand to manage access tokens

inmanta-cli token [OPTIONS] COMMAND [ARGS]...
bootstrap

Generate a bootstrap token that provides access to everything. This token is only valid for 3600 seconds.

inmanta-cli token bootstrap [OPTIONS]
create

Create a new token for an environment for the specified client types

inmanta-cli token create [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use.

--api

Add client_type api to the token.

--compiler

Add client_type compiler to the token.

--agent

Add client_type agent to the token.

version

Subcommand to manage versions

inmanta-cli version [OPTIONS] COMMAND [ARGS]...
list

List versions in an environment

inmanta-cli version list [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

release

Release the specified version of the configuration model for deployment.

VERSION: Version of the model to release

inmanta-cli version release [OPTIONS] VERSION

Options

-e, --environment <environment>

Required The environment to use

-p, --push

Push the version to the deployment agents

--full

Make the agents execute a full deploy instead of an incremental deploy. Should be used together with the –push option

Arguments

VERSION

Required argument

report

Get a report about a version, describing the involved resources, agents and actions

inmanta-cli version report [OPTIONS]

Options

-e, --environment <environment>

Required The environment to use

-i, --version <version>

Required The version to create a report from

-l

Show a detailed version of the report