Command Reference — Inmanta 2017.1.1 documentation

# 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] [--log-file LOG_FILE]
                   [--log-file-level LOG_FILE_LEVEL] [--timed-logs] [-v]
                   {export,deploy,list-commands,modules,compile,server,agent} ...

Optional Arguments

  `-p=False` | Profile this run of the program
  `-c, --config` | Use this config file
  `--log-file` | Path to the logfile
  `--log-file-level=2`
  | Log level for messages going to the logfile: 0=ERROR, 1=WARNING, 2=INFO, 3=DEBUG
  `--timed-logs=False`
  | Add timestamps to logs
  `-v=0, --verbose=0`
  | Log level for messages going to the console. Default is only errors,-v warning, -vv info and -vvv debug and -vvvv trace

Sub-commands:
  export

    Export the configuration

        usage: inmanta export [-h] [-g] [-j JSON] [-e ENVIRONMENT] [-d]
                              [--server_address SERVER] [--server_port PORT]
                              [--username USER] [--password PASSWORD] [--ssl]
                              [--ssl-ca-cert CA_CERT] [-X] [-f MAIN_FILE]

    Optional Arguments

      `-g=False` | Dump the dependency graph
      `-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=False` | Trigger a deploy for the exported version
      `--server_address`
      | The address of the server to submit the model to
      `--server_port` | The port of the server to submit the model to
      `--username` | The username of the server
      `--password` | The password of the server
      `--ssl=False` | Enable SSL
      `--ssl-ca-cert` | Certificate authority for SSL
      `-X=False, --extended-errors=False`
      | Show stack traces for compile errors
      `-f="main.cf"` | Main file

  deploy

    Deploy with a inmanta all-in-one setup

        usage: inmanta deploy [-h] [-p PROJECT] [-a AGENT] [-m MAP] [--dry-run] [-l]
                              [--no-agent-log] [-f MAIN_FILE]

    Optional Arguments

      `-p` | The project name
      `-a` | Deploy the resources of this agent. Multiple agents are comma separated and wildcards are supported
      `-m` | Agent mapping in the format: agentname=mappedname,agentname2=other
      `--dry-run=False`
      | Only report changes
      `-l=False` | List the deployment agents in the model
      `--no-agent-log=False`
      | Do not capture agents logs, print them to stdout
      `-f="main.cf"` | Main file

  list-commands

    Print out an overview of all commands

        usage: inmanta list-commands [-h]

  modules

    Subcommand to manage modules

        usage: inmanta modules [-h]
                               {list,do,update,install,status,push,verify,validate,commit}
                               ...

    subcommand

      `cmd` | Possible choices: list, do, update, install, status, push, verify, validate, commit

    Sub-commands:
      list

        List all modules used in this project in a table

            usage: inmanta modules list [-h]

      do

        Execute a command on all loaded modules

            usage: inmanta modules do [-h] command

        Required Arguments

          `command` | the command to execute

      update

        Update all modules used in this project

            usage: inmanta modules update [-h]

      install

        Install all modules required for this this project

            usage: inmanta modules install [-h]

      status

        Run a git status on all modules and report

            usage: inmanta modules status [-h]

      push

        Run a git push on all modules and report

            usage: inmanta modules push [-h]

      verify

        Verify dependencies and frozen module versions

            usage: inmanta modules verify [-h]

      validate

        Validate the module we are currently in. i.e. try to compile it against an empty main model

            usage: inmanta modules validate [-h] [-r REPO] [-n] [-s] [-i] [-w]

        Optional Arguments

          `-r, --repo` | Additional repo to load modules from
          `-n=False, --no-clean=False`
          | Do not remove the validation project when finished
          `-s=False, --parse-only=False`
          | Only parse the module
          `-i=False, --isolate=False`
          | Move the module to another directory before cloning. I.e. remove all other modules in the current directory from the search path
          `-w=False, --workingcopy=False`
          | Use the actual state of the module instead of the latest tag

      commit

        Commit all changes in the current module.

            usage: inmanta modules commit [-h] -m MESSAGE [-r] [--major] [--minor]
                                          [--patch] [-v VERSION] [-a]

        Optional Arguments

          `-m, --message` | Commit message
          `-r=True, --release=True`
          | make a release
          `--major=False` | make a major release
          `--minor=False` | make a major release
          `--patch=False` | make a major release
          `-v, --version` | Version to use on tag
          `-a=False, --all=False`
          | Use commit -a

  compile

    Compile the project to a configuration model

        usage: inmanta compile [-h] [-e ENVIRONMENT] [-X] [--server_address SERVER]
                               [--server_port PORT] [--username USER]
                               [--password PASSWORD] [--ssl] [--ssl-ca-cert CA_CERT]
                               [-f MAIN_FILE]

    Optional Arguments

      `-e` | The environment to compile this model for
      `-X=False, --extended-errors=False`
      | Show stack traces for compile errors
      `--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=False` | Enable SSL
      `--ssl-ca-cert` | Certificate authority for SSL
      `-f="main.cf"` | Main file

  server

    Start the inmanta server

        usage: inmanta server [-h]

  agent

    Start the inmanta agent

        usage: inmanta agent [-h]

## inmanta-cli

Use `inmanta-cli --help`