Customization

Use the environment variables to customize AnsibleForms

Installation Forms configuration

Search

Environment Variables

Ansibleforms is a nodejs webapplication and is tunable using environment variables.
Whether you use docker-compose, kubernetes or you run the webapplication natively, we advise you to get familiar with these variables and learn how to set them in your preferred environment.

Variable Choices/Defaults Comments
NODE_ENV
string
Default:
production

The nodejs environment
a valid nodejs environment

Nodejs can have multiple environments, like development or production

DB_HOST
string / required

The database host
a valid IP or FQDN

Ansible Forms requires a mysql database connection to store the configuration of the application.

DB_USER
string / required

The database user
a valid mysql user

Ansible Forms requires a mysql database connection to store the configuration of the application.

DB_PASSWORD
string / required

The database password
a valid mysql password

Ansible Forms requires a mysql database connection to store the configuration of the application.

PORT
number
Default:
8000

Http port
a valid TCP port

The listening port of the web application

HTTPS
number
Choices:
  • 0 (default)
  • 1

Enables HTTPS

Our docker-compose comes with sample certificates. It is highly recommended to enable HTTPS.

HTTPS_KEY
string
Default:
%PERSISTENT_FOLDER%/certificates/key.pem

Private key
a valid file path

The path to the private key of the server certificate, in BASE64/PEM format.

HTTPS_CERT
string
Default:
%PERSISTENT_FOLDER%/certificates/cert.pem

Certificate
a valid file path

The path to the server certificate, in BASE64/PEM format.

FORMS_PATH
string
Default:
%PERSISTENT_FOLDER%/forms.yaml

Forms.yaml path
a valid file path

The forms.yaml file is the main configuration file needed to run Ansible Forms.
Read here more about the forms.yaml file.

LOCK_PATH
string
Default:
%PERSISTENT_FOLDER%/ansibleForms.lock

ansibleForm.lock path
a valid file path

Only 1 user can use the designer, so we use a locking file to hold the current owners information.

FORMS_BACKUP_PATH
string
added in version 4.0.3
Default:
%PERSISTENT_FOLDER%/form_backups

Backup path for form backups
a valid directory path

When backups are made, they end up in this path

OLD_BACKUP_DAYS
number
added in version 4.0.3
Default:
60

Days of backups to keep
a valid number in days

Old backups are cleanup, you can choose the age

AZURE_GRAPH_URI
string
added in version 4.0.3
Default:
https://graph.microsoft.com

The azure graph api base uri
a valid base URI without slash on the end

This variable is used to acquire data from the Azure AD api.

ALLOW_SCHEMA_CREATION
number
added in version 5.0.3
Choices:
  • 0
  • 1 (default)

Enable the schema creation

When you start Ansible Forms for the first time and there is no database, Ansible Forms will present you the option to create the schema. Although this is fairly handy, you might want to disable this option to prevent accidental schema re-creation.
Also note that if you use the docker-compose solution, the database is created as part of the Mysql initialization.
If you use a different database, you might want to enable this option, to at the very least create the schema the very first time.
If you want to disable this option, set this variable to 0.

ENABLE_BYPASS
number
added in version 5.0.3
Choices:
  • 0 (default)
  • 1

Enable the bypass admin authentication

When you have locked yourself out, you can enable the bypass admin authentication, by setting this variable to 1.
This will allow you to login as temp admin with any combination of username and password. You can then fix the issue and disable this option again.
Note : This option will allow ANYONE to login as admin, so use with caution and disable as soon as possible.

ENABLE_DB_QUERY_LOGGING
number
added in version 5.0.3
Choices:
  • 0 (default)
  • 1

Enable the database query logging

When you want to see the database queries that are executed, you can enable this option by setting this variable to 1.
introduced, due to massive amount of logging of database queries, which can be useful for debugging, but not for production.

ENABLE_FORMS_YAML_IN_DATABASE
number
added in version 5.0.3
Choices:
  • 0 (default)
  • 1

Enable the forms.yaml in database

If you use git repositories to store the forms, you can choose to store the master forms.yaml in git as well.
Or, you can choose to have the forms.yaml in the database instead. Having a clean separation : master forms.yaml in database, and the actual forms in git.

SHOW_DESIGNER
number
added in version 4.0.0
Choices:
  • 0
  • 1 (default)

Enable the internal designer

Although we encourage you to use an editor such as Visual Studio Code to edit the forms.yaml file, preferably with some form of source control. Ansible Forms comes with an internal yaml designer.
And although only admins can see the designer, you might want to disable it completely by setting this variable to 0.

USE_YTT
number
added in version 5.0.2
Choices:
  • 0 (default)
  • 1

Enable the ytt interpreter

https://github.com/carvel-dev/ytt is a tool for yaml templating. It can be activated by this variable.

LOG_LEVEL
string
Choices:
  • error
  • warn
  • notice (default)
  • info
  • debug

Log level

Ansible Forms logs to logfile called Ansible Forms.log.
It does so in multiple levels.

LOG_PATH
string
Default:
%PERSISTENT_FOLDER%/logs

Path for logfiles
a valid folder path

Ansible Forms maintains 2 logfiles. ansibleforms.log and ansibleforms.errors.log

Added4.0.0

Make the logfiles rotating with daily timestamp. 30days of logs are kept.

LOG_CONSOLE_LEVEL
string
Choices:
  • error
  • warn
  • notice
  • info
  • debug (default)

Console Log level

When you run ansibleforms, by default the application also logs to the console.
For example with docker you can use the command docker logs to access this console log.
This console log has a seperate loglevel.

LOG_SYSLOG_HOST
string
added in version 3.0.1

Syslog host
a valid IP or FQDN

Setting the syslog settings, enables the logging to a syslog server

LOG_SYSLOG_LEVEL
string
added in version 3.0.1
Choices:
  • error
  • warn
  • notice
  • info
  • debug (default)

Syslog level

The logging level for the syslog server

LOG_SYSLOG_PORT
number
added in version 3.0.1
Default:
514

Syslog Port
valid tcp/udp port number

The port on which the syslog server is listening

LOG_SYSLOG_PROTOCOL
string
added in version 3.0.1
Choices:
  • tcp4
  • udp4 (default)
  • tls4
  • unix
  • unix-connect

Syslog protocol

The syslog protocol to use

LOG_SYSLOG_PATH
string
added in version 3.0.1
Default:
/dev/log

Syslog path
valid syslog path

The path to the syslog dgram socket (i.e. /dev/log or /var/run/syslog for OS X)

LOG_SYSLOG_SOURCE
string
added in version 3.0.1
Default:
localhost

Source hostname
hostname

Host to indicate where log messages are coming from

LOG_SYSLOG_TYPE
string
added in version 3.0.1
Choices:
  • BSD (default)
  • 3164
  • 5424
  • RFC3164
  • RFC5424

Syslog protocol type

The type of the syslog protocol to use

LOG_SYSLOG_APPNAME
string
added in version 3.0.1
Default:
Ansible Forms

App Name
free text

The name of the application

LOG_COLOR_ERROR
string
added in version 3.0.1
Default:
\x1b[31m

Error color code
valid escape color code

The escape color code for error (default red)

LOG_COLOR_WARN
string
added in version 3.0.1
Default:
\x1b[33m

Warning color code
valid escape color code

The escape color code for warning (default yellow)

LOG_COLOR_NOTICE
string
added in version 3.0.1
Default:
\x1b[37m

Notice color code
valid escape color code

The escape color code for notice (default white)

LOG_COLOR_INFO
string
added in version 3.0.1
Default:
\x1b[32m

Info color code
valid escape color code

The escape color code for info (default green)

LOG_COLOR_DEBUG
string
added in version 3.0.1
Default:
\x1b[36m

Debug color code
valid escape color code

The escape color code for debug (default cyan)

ACCESS_TOKEN_SECRET
string
Default:
*** NOT REVEALED ***

Secret to encryp access tokens
a hard secret string

AnsibleForm uses Basic Authentication as authentication mechanism.
Once authenticated, the client uses a JWT (Json Web Token) for authorization (Bearer authorization header). This token is stored on the client side (i.e. browser cookie) and is signed with a secret key.
To keep the communication between client and server safe, we strongly recommend you to set this secret.

ACCESS_TOKEN_EXPIRATION
string
Default:
30m

Expiration time access token
a valid time indication

A JWT (Json Web Token) is only valid for a certain amount of time.
If someone would be able to intercept a communication packet and see the token, it would only be valid for a short time.
After this short time, the client must refresh his access token using his refresh token.

ACCESS_TOKEN_REFRESH_EXPIRATION
string
Default:
24h

Expiration time refresh token
a valid time indication

Once the access token is expired, and the client tries to connect to the server, the client hits a 401 error (unauthorized). the client application captures this error, and calls the refresh api with its refresh token. If the refresh token is valid, the client gets a new set of access and refresh tokens and retries the last unauthorized api call with the renew access token.
With this mechanism, the client can keep the user-connection open for a long time and avoid a sudden logout during a save action.
If the client has not connected back to the server during the expiration time of the refresh token, the client is logged of and authentication is required again.

HOME_PATH
string
added in version 3.0.0
Default:
OS Homedir path

The users home directory
a valid path

Ansible Forms generates an sshkey at first start, is one is not present, so you can have a git connection or other password-less connection.
Typically this key is stored in the users home-directory under /.ssh/id_rsa. You can set this homedirectory path manually with this property.

REPO_PATH
string
added in version 3.0.0
Default:
%PERSISTENT_FOLDER%/repositories

Repositories path
a valid path

This path is the root path for your local repositories, allowing you to integrate data with git repositories.

ENCRYPTION_SECRET
string
Default:
*** NOT REVEALED ***

Database encryption secret
a strong encryption string

Ansible Forms encrypts passwords in the database using this secret.
We strongly advise you to set a custom entryption secret to uniquely protect your passwords.
The secret must be 32 character long, however, we extend or cut the secret if this is not the case.

ANSIBLE_PATH
string
Default:
%PERSISTENT_FOLDER%/playbooks

The path of the ansible playbooks (local instance)
a valid path

Ansible Forms can have a local ansible instance. This path says where the playbooks are.

REGEX_FILTER_JOB_OUTPUT
string
Default:
\[low\]

Filter out job output tasks
an escaped regular expression

Sometime, the job output is flooded with meaningless output, such as ‘Gathering Facts’, or ‘Includes’. You filter out these by add a piece of string in the taskname, i.e. [low] and then used regex \\[low\\] to hide this information.
The output has a button Apply filter for the filtering to take effect.

UPLOAD_PATH
string
added in version 4.0.16
Default:
%PERSISTENT_FOLDER%/uploads

The path for file uploads
a valid path

Since 4.0.16, a new field type is introduced that allows file uploads. The files are uploaded in this path.