Variables de entorno

Configura AnsibleForms con variables de entorno


Para administradores que despliegan AnsibleForms: las variables de entorno que lee el servidor, agrupadas por tema.

AnsibleForms se ajusta con variables de entorno, tanto si se ejecuta con Docker Compose, en Kubernetes o desde el código fuente.


De dónde salen los valores

El servidor lee cada variable de la primera de estas fuentes que la define, así que un valor más arriba en la lista siempre gana:

  1. El entorno del proceso: environment: y env_file: en docker-compose (el .env del proyecto se pasa así), env y envFrom en Kubernetes, o la shell que arranca node.
  2. persistent/.env, el archivo que escriben las páginas de configuración (data/.env en el proyecto docker-compose, otra ruta con MANAGED_ENV_PATH). Se lee en cada arranque, también en producción, y nunca sobrescribe una variable que ya está definida.
  3. server/.env.<NODE_ENV>, por ejemplo .env.development. Solo se lee cuando NODE_ENV no es production (o con FORCE_DOTENV=1), en la práctica al ejecutar desde el código fuente en modo de desarrollo.
  4. El valor predeterminado integrado, que aparece en las tablas de cada grupo.

Las páginas de configuración, en Configuración > General, muestran el valor vigente y guardan los cambios en persistent/.env. Muchas variables se aplican en cuanto se guardan; las demás se guardan pero necesitan un reinicio, y la página las lista tras guardar. Una variable definida en el entorno del proceso no se puede cambiar ahí: la página la muestra como Definida en el entorno, no se puede cambiar aquí. Algunas variables, como ENCRYPTION_SECRET y ACCESS_TOKEN_SECRET, no se pueden cambiar nunca desde la página.

Las variables que lee un RTE, como AF_ROLE, RTE_MODE, CONTROLLER_URL o RTE_MAX_JOBS, no están en las páginas de configuración: el controlador no las usa, así que defínelas en el entorno donde se ejecuta el RTE. Las variables RTE_* que lee el propio controlador, RTE_QUEUE_MINUTES y RTE_FILES_MAX_MB, son la excepción y siguen en las páginas. Cuatro variables del RTE, RTE_MAX_JOBS, RTE_CACHE_MB, RTE_FILES y RTE_DRAIN_SECONDS, se pueden definir por RTE en su página de runner, donde un valor gana a la variable (consulta La configuración de un RTE).

Con ALLOW_ENV_EDIT=0 las páginas solo muestran los valores y se rechaza el guardado. Úsalo cuando el entorno se declara en un manifiesto, como se describe en Edición y auditoría.

La semilla de configuración no define variables de entorno. Declara objetos que se guardan en la base de datos, y las referencias ${ENV_VAR} que contiene se resuelven a partir del entorno del servidor en ejecución.

Algunas variables solo se leen del entorno y no están en las tablas: MANAGED_ENV_PATH y FORCE_DOTENV, descritas arriba, y las variables de proxy del sistema HTTPS_PROXY y NO_PROXY (también se leen en minúsculas). Un RTE outbound llama a la aplicación a través de HTTPS_PROXY, y un RTE inbound envía su llamada de registro a través de él, salvo que el host de la aplicación esté en NO_PROXY (nombres de host, sufijos .domain, o * para todos los hosts).

Las variables marcadas como Secreto contienen una contraseña, un token o una clave: mantenlas fuera del control de versiones, por ejemplo en un Secret de Kubernetes o en un archivo .env que no se haga commit.


En esta sección

Las variables se agrupan por tema, con una página por grupo:

Página Qué trata
Servidor y base de datos El servidor web, los proxies de confianza, la conexión a MySQL, la cuenta de admin y lo que ejecuta cada proceso (controlador, worker o RTE)
Rutas Dónde están la configuración, los formularios, los playbooks, los workflows, los archivos subidos y las copias de seguridad
Copias de seguridad y retención Los comandos de copia de seguridad, la copia antes de una actualización y cuánto tiempo se conservan las copias, los trabajos y los registros de auditoría
Funciones El diseñador, MCP, el chat, la validación del lanzamiento, la lista de trabajos, las métricas, la API de AWX y el registro de consultas
Configuración La semilla de configuración, dónde se guarda la configuración, git e ytt
Variables de seguridad Límites de inicio de sesión, contraseñas, inicio de sesión único, tokens, cifrado, la política del navegador, límites de REST saliente y de jq, enmascaramiento y las variables VAULT_*, leídas una vez para importar un almacén de secretos
Registro Los niveles de log, el formato del log, los archivos y cuánto tiempo se conservan, syslog y los colores de la consola

Otras variables

Las siguientes variables todavía no están asignadas a ningún grupo:

Variable Opciones/Valores predeterminados Comentarios
CONFIG_SEED_RELOAD_CRON
string
added in version 7.8.0
Valor predeterminado:
* * * * *

Config seed reload schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Config seed reload system task runs: it checks the config seed file (CONFIG_SEED_PATH) and applies it again when its content has changed. This is what lets a seed edited in git take effect without restarting: on kubernetes a ConfigMap is remounted under the running pod within about a minute and the change is picked up from there. A reload that fails is never fatal, unlike the one at startup: the configuration already in force is kept and the Status page reports it. Without CONFIG_SEED_PATH the task is off. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every minute. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only. Replaces CONFIG_SEED_RELOAD_SECONDS, still read when this one is not set.

CONFIG_SEED_RELOAD_ENABLED
boolean
added in version 7.9.0
Valor predeterminado:
true

Config seed reload on
true, false

Whether the Config seed reload system task runs on its schedule (CONFIG_SEED_RELOAD_CRON). Turned off, the seed applies at startup only; it replaces CONFIG_SEED_RELOAD_SECONDS=0, deprecated. Turned off, Run now on the task’s page still runs it. false or 0 turns it off. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

JOB_CLEANUP_CRON
string
added in version 7.8.0
Valor predeterminado:
30 2 * * *

Job cleanup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Job cleanup system task runs: it removes the finished jobs older than JOB_RETENTION_DAYS. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at 2:30 AM. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

JOB_CLEANUP_ENABLED
boolean
added in version 7.9.0
Valor predeterminado:
true

Job cleanup on
true, false

Whether the Job cleanup system task runs on its schedule (JOB_CLEANUP_CRON). Turn it off to keep every finished job, or where they are cleaned up another way. Turned off, Run now on the task’s page still runs it. false or 0 turns it off. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

AUDIT_CLEANUP_CRON
string
added in version 7.8.0
Valor predeterminado:
30 3 * * *

Audit log cleanup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Audit log cleanup system task runs: it removes the audit entries older than AUDIT_RETENTION_DAYS. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at 3:30 AM. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

AUDIT_CLEANUP_ENABLED
boolean
added in version 7.9.0
Valor predeterminado:
true

Audit log cleanup on
true, false

Whether the Audit log cleanup system task runs on its schedule (AUDIT_CLEANUP_CRON). Turn it off to keep the audit log forever (shipped to a syslog server, for instance). Turned off, Run now on the task’s page still runs it. false or 0 turns it off. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

TOKEN_CLEANUP_CRON
string
added in version 7.8.0
Valor predeterminado:
0 3 * * *

Expired tokens cleanup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Expired tokens system task runs: it removes the expired sign-in tokens, revocations and API tokens. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at 3:00 AM. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

TOKEN_CLEANUP_ENABLED
boolean
added in version 7.9.0
Valor predeterminado:
true

Expired tokens on
true, false

Whether the Expired tokens system task runs on its schedule (TOKEN_CLEANUP_CRON). Only housekeeping: an expired token is refused anyway. Turned off, Run now on the task’s page still runs it. false or 0 turns it off. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

STORED_JOB_CLEANUP_CRON
string
added in version 7.8.0
Valor predeterminado:
0 4 * * *

Stored jobs cleanup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Stored jobs cleanup system task runs: it removes the stored jobs past their expiry date or unused for STORED_JOB_UNUSED_DAYS, and forgets the nodes gone for a day. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at 4:00 AM. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

STORED_JOB_CLEANUP_ENABLED
boolean
added in version 7.9.0
Valor predeterminado:
true

Stored jobs cleanup on
true, false

Whether the Stored jobs cleanup system task runs on its schedule (STORED_JOB_CLEANUP_CRON). Turn it off to keep every stored job until it is deleted. Turned off, Run now on the task’s page still runs it. false or 0 turns it off. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

NIGHTLY_BACKUP_CRON
string
added in version 7.8.0
Valor predeterminado:
0 0 * * *

Nightly backup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Nightly backup system task runs: it backs up the database and removes the oldest nightly backups beyond NIGHTLY_BACKUP_RETENTION. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at midnight. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

NIGHTLY_BACKUP_ENABLED
boolean
added in version 7.9.0
Valor predeterminado:
true

Nightly backup on
true, false

Whether the Nightly backup system task runs on its schedule (NIGHTLY_BACKUP_CRON). Turn it off where the instance is backed up another way (volume snapshots, a managed database with its own backups). Turned off, Run now on the task’s page still runs it. false or 0 turns it off. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

ABANDONED_JOBS_CRON
string
added in version 7.8.0
Valor predeterminado:
0 * * * *

Abandoned jobs schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Abandoned jobs system task runs: it ends the jobs that ran a day without output and that no runner took. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every hour. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

DEAD_NODES_CRON
string
added in version 7.8.0
Valor predeterminado:
* * * * *

Stopped nodes schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Stopped nodes system task runs: it frees the jobs, claims and runners held by nodes and RTEs that stopped answering. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every minute. Running it less often leaves the work of a stopped node waiting longer before another takes it. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

SCHEDULE_RESYNC_CRON
string
added in version 7.8.0
Valor predeterminado:
*/5 * * * *

Schedule resync schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Schedule resync system task runs: the worker reads the schedules and the repository pulls from the database again. Each change already reaches it at once; this is the safety net for a change notice it missed. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every 5 minutes. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

SCHEDULE_ENDS_CRON
string
added in version 7.8.0
Valor predeterminado:
* * * * *

Schedule ends schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Schedule ends system task runs: it turns off or removes the schedules that reached their end. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every minute. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

RUNNER_DISPATCH_SECONDS
number
added in version 7.8.0
Valor predeterminado:
2

Runner dispatch interval (seconds)
a whole number of seconds from 1 to 60

How often the Runner dispatch loop of the runner hub runs, in seconds: it hands the waiting jobs and the cancels to their runners. A job or a cancel launched on another node reaches its runner at the next round; the default runs it every 2 seconds. Changed on the loop’s own page, Jobs > System > the loop > Schedule, which saves it to the managed settings file and applies it at once on every node that runs the hub, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

RUNNER_DIAL_SECONDS
number
added in version 7.8.0
Valor predeterminado:
10

Runner inbound dial interval (seconds)
a whole number of seconds from 2 to 300

How often the Runner inbound dial loop of the runner hub runs, in seconds: it dials the inbound runners this node may hold. An inbound runner that lost its socket is dialed again at the next round; the default runs it every 10 seconds. Changed on the loop’s own page, Jobs > System > the loop > Schedule, which saves it to the managed settings file and applies it at once on every node that runs the hub, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

RUNNER_PRUNE_SECONDS
number
added in version 7.8.0
Valor predeterminado:
60

Runner ended jobs prune interval (seconds)
a whole number of seconds from 10 to 3600

How often the Runner ended jobs prune loop of the runner hub runs, in seconds: it lets go what a node kept of jobs that ended elsewhere. The default runs it every 60 seconds. Changed on the loop’s own page, Jobs > System > the loop > Schedule, which saves it to the managed settings file and applies it at once on every node that runs the hub, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

LOG_VIEW_LINES
number
added in version 7.7.0
Valor predeterminado:
1000

Lines on the Server log page
a whole number of at least 1

The number of last lines of today’s server log the Server log page shows and searches, and the most the log endpoint (GET /api/v2/log) answers, whatever a request asks: the whole day’s file is the page’s Download. No upper limit, but the page reads that many lines every 2 seconds, and many lines can make it slow or unresponsive. Takes effect at once, without a restart.