Servidor y base de datos
El servidor web, la conexión a MySQL, la cuenta de admin y lo que ejecuta cada proceso (AF_ROLE y las variables RTE_*)
Cambia estas variables cuando la aplicación se ejecuta detrás de un proxy inverso, en otro puerto o contra una base de datos fuera del proyecto compose.
Ejemplo
Detrás de un proxy inverso que termina TLS, bajo /ansibleforms, con un MySQL externo. En docker-compose.yml:
environment:
- BASE_URL=/ansibleforms # the proxy forwards /ansibleforms/ unchanged
- HTTPS=0 # the proxy terminates TLS
- PORT=8000
- DB_HOST=mysql.example.com
- DB_PORT=3306
- DB_USER=ansibleforms
- DB_PASSWORD=change-me
Estas líneas sustituyen a las líneas DB_* y PORT que el archivo compose ya tiene ahí, que ganan a los mismos nombres en .env. Quita el servicio mysqldb y el depends_on que lo espera, y mapea el puerto 8000 en ports. La parte del proxy se describe en la página Proxy inverso.
Variables
Todas las variables de este grupo, con su tipo, su valor predeterminado y su descripción:
| Variable | Opciones/Valores predeterminados | Comentarios |
|---|---|---|
| NODE_ENV string | Valor predeterminado: production | The Node.js environment
Nodejs can have multiple environments, like development or production |
| DB_HOST string / required | Database host
AnsibleForms requires a MySQL database connection to store the configuration of the application. | |
| DB_PORT number / required added in version 6.3.0 | Database port
Port of the MySQL or MariaDB server, usually 3306. It has no default: the server refuses to start when DB_PORT, DB_HOST, DB_USER or DB_PASSWORD is not set, and changing it needs a restart. | |
| DB_USER string / required | Database user
AnsibleForms requires a MySQL database connection to store the configuration of the application. Give it a user of its own with rights on its schema only - not root: That is all the application needs: it creates and patches its schema, makes its backups, and ends a dead worker’s session (its own sessions, which needs no further right). A user with rights on every database turns any hole in the application into a hole in the whole database server ; the Status page and the log say so when the user has them. | |
| DB_PASSWORD string / required Secreto | Database password
AnsibleForms requires a MySQL database connection to store the configuration of the application. | |
| DB_POOL_SIZE number | Valor predeterminado: 20 | Database connection pool size
Maximum number of concurrent MySQL connections kept in the pool. All database queries share this pool instead of opening a new connection per query, which dramatically reduces connection overhead and improves throughput under load. Increase this if you have many concurrent users or long-running cron-driven jobs; decrease it if your MySQL server has a low |
| PORT number | Valor predeterminado: 8000 | HTTP port
The listening port of the web application |
| BASE_URL string | Valor predeterminado: / | URL subpath to host the application under
Host the whole application (GUI, REST API and Swagger interface) under a URL subpath, typically behind a reverse proxy. For example with |
| TRUST_PROXY string added in version 7.0.0 | Valor predeterminado: 0 | Trusted reverse proxies
Behind a reverse proxy (nginx, traefik, a kubernetes ingress, a load balancer) every connection comes from the proxy, so without this setting the audit trail records the proxy’s address for every action. Set it to tell the application which proxies it may believe when they report the real client address in the
Security: |
| DEFAULT_LANGUAGE string | Valor predeterminado: en | Default language
Sets the language for the application, for users who have not picked their own with the language switcher. The chosen language is persisted in a cookie. Both frontend UI and backend error messages are translated. |
| HTTPS number | Opciones:
| Enable HTTPS
Our docker-compose comes with sample certificates. It is highly recommended to enable HTTPS. |
| HTTPS_KEY string | Valor predeterminado: %PERSISTENT_FOLDER%/certificates/key.pem | HTTPS private key
The path to the private key of the server certificate, in BASE64/PEM format. |
| HTTPS_CERT string | Valor predeterminado: %PERSISTENT_FOLDER%/certificates/cert.pem | HTTPS certificate
The path to the server certificate, in BASE64/PEM format. |
| ADMIN_USERNAME string added in version 5.0.8 | Valor predeterminado: admin | Admin username
The admin username is the first user that can login to the application. |
| ADMIN_PASSWORD string Secreto added in version 5.0.8 | Valor predeterminado: AnsibleForms!123 | Admin password
The admin password is the password for first user that can login to the application. |
| AF_ROLE string added in version 7.0.0 | Valor predeterminado: all | What this process runs
|
| RTE_MODE string added in version 7.3.0 | Valor predeterminado: database | How an RTE talks to the app
Read by an RTE (
A dial that fails is logged at warning with its cause and a hint: a name that does not resolve, nothing listening, a certificate not trusted or not for that name, a proxy, or the app refusing the socket (401 the token, 404 the
In both socket modes the RTE holds no database credentials: the app sends it each job and stores what comes back - the output, the events, the end - exactly once, and sends the end notifications. The job’s files come with it unless
|
| APP_URL string added in version 7.3.0 | The app's address an RTE dials
On an RTE in On an RTE in The certificate is checked: name a private CA with | |
| APP_TLS_VERIFY number added in version 7.3.0 | Valor predeterminado: 1 | Whether an RTE checks the app's certificate
On an RTE that dials the app ( |
| RTE_JOIN_TOKEN string Secreto added in version 7.3.0 | The token an RTE joins the app with, once
On an RTE in a socket mode, the first time, optional. Without it an RTE the app does not know asks to join and waits for an admin’s approval under Connections > Runners. With it the RTE is approved at once - for unattended installs - and the app adds it as a runner (or gives a runner of that name still waiting for approval the new token ; an approved runner keeps its token, which only an admin changes). Join tokens are made through the API ( | |
| RTE_NAME string added in version 7.3.0 | The runner name an RTE joins as
On an RTE in a socket mode: the name of its runner under Connections > Runners, which forms name with | |
| RTE_FILES string added in version 7.3.0 | Valor predeterminado: transfer | Where a socket-mode RTE gets a job's files
On an RTE in a socket mode. |
| RTE_FILES_MAX_MB number added in version 7.3.0 | Valor predeterminado: 512 | The largest folder the app sends an RTE
Read by the app: a playbooks or inventory folder bigger than this is not sent to an RTE with |
| RTE_SPOOL_PATH string added in version 7.3.0 | Valor predeterminado: %PERSISTENT_FOLDER%/rte-spool | Where a socket-mode RTE keeps what the app has not stored yet
On an RTE in a socket mode: each job’s output, events and end wait here until the app acks them, and are sent again after a reconnect - to the same app node or another. On a volume, an RTE that restarts sends what it had not delivered. |
| RTE_CACHE_PATH string added in version 7.3.0 | Valor predeterminado: %PERSISTENT_FOLDER%/rte-files | Where a socket-mode RTE keeps the job files the app sent
On an RTE with |
| RTE_CACHE_MB number added in version 7.3.0 | Valor predeterminado: 1024 | The size of a socket-mode RTE's job files cache
On an RTE with |
| RTE_TOKEN string Secreto added in version 7.0.0 | The token between an app and its RTE
On an RTE ( | |
| RTE_REGISTER number added in version 7.0.0 | Valor predeterminado: 1 | A database-mode RTE adds itself as a runner (deprecated)
Deprecated since 7.3.0, removed in 8.0.0 with database mode. Read only by an RTE in database mode (no On a database-mode RTE: 1 (the default) and the RTE adds itself under Connections > Runners when it starts, and checks every 30 seconds that it is still there. The first RTE becomes the default runner. Its address is A runner the RTE registered shows as automatic on the Runners page, and as unresponsive once the RTE stopped writing its heartbeat ; the worker removes it 10 minutes later. A recreated container registers again under its new address and takes the default from the one that stopped. A runner added by hand at the same address stays yours (its token follows 0: the RTE does not register itself ; add it under Connections > Runners or in the seed. |
| RTE_MAX_JOBS number added in version 7.0.0 | Valor predeterminado: 10 | How many playbooks an RTE runs at once
Read by an RTE ( |
| RTE_DRAIN_SECONDS number added in version 7.0.0 | Valor predeterminado: 25 | How long a stopping RTE waits for its running playbooks
Read by an RTE. On a stop (SIGTERM: a rolling update, a scale down) it takes no new job and waits this long for the running playbooks to end ; those still running then end as abandoned. Keep it below what the platform waits before it kills the container: Kubernetes’ terminationGracePeriodSeconds (30 by default), docker stop’s –time (10). On a socket-mode RTE it can be set on its runner page ; a value there wins over this one. |
| RTE_QUEUE_MINUTES number added in version 7.0.0 | Valor predeterminado: 60 | Wait for a busy or disconnected RTE (minutes)
A job handed to an RTE that is full (RTE_MAX_JOBS) or stopping waits for it, asking again every 10 seconds, for this many minutes ; then it fails and says why. An abort ends the wait at once. It also covers the running jobs of a socket-mode RTE (outbound, inbound) whose connection dropped: their playbooks run on and the RTE keeps their output, so they stay running for this many minutes and go on when it reconnects, or end as abandoned after that (or at once when the RTE comes back without them). 0 waits for ever. |
| LISTEN_HOST string added in version 7.3.0 | The address an RTE listens on
On an RTE ( | |
| RTE_URL string added in version 7.0.0 | The address the app reaches an RTE on
On an RTE in On a deprecated database-mode RTE that registers itself ( An inbound RTE ( | |
| ALLOW_SCHEMA_CREATION number added in version 5.0.3 | Opciones:
| Allow schema creation
With 1, the worker creates the schema (all AnsibleForms tables) itself at startup when it finds an empty database. It only does so on a database without a single AnsibleForms table, so an existing installation is never recreated. App nodes wait until the worker has created and patched the schema before they serve. With 0, nothing creates the schema: the worker skips it at startup, the schema endpoint refuses to create it, and app nodes start without waiting for it. Set 0 to rule out any schema creation, for example on a production database. The docker-compose MySQL only creates the empty |
| REINIT_ADMIN number added in version 6.0.0 | Opciones:
| Reset the local admin user/password at startup
Recovery hatch when you’ve lost access to the local
The action is logged loudly. This is NOT a runtime auth bypass — once the admin is back in shape, unset |
| API_BODY_LIMIT_MB number added in version 6.0.0 | Valor predeterminado: 50 | Request body size limit (MB)
Cap on the size of JSON and urlencoded request bodies accepted by the AnsibleForms API. Default is 50 MB, generous enough for large form designs and heavy job extravars. Increase if you have unusually large forms or expression payloads. Note: this does NOT apply to file uploads (those are governed by |
| MAX_HTTP_HEADER_SIZE number added in version 7.1.0 | Valor predeterminado: 16384 | Request header size limit (bytes)
The largest request header the server accepts, in bytes. Node.js refuses a request whose headers are larger with 431 Request Header Fields Too Large, before it reaches the application, so nothing of it is in the log. Unset, Node’s own limit applies: 16384 bytes (16 KB), or the value of |
| UPLOAD_MAX_GB number added in version 6.0.0 | Valor predeterminado: 10 | Upload size limit (GB)
Cap on the size of a single file uploaded through the form upload field, in gigabytes. Default is 10 GB to accommodate large artifacts (e.g. firmware images, upgrade bundles). Set to |
| PROCESS_MAX_BUFFER number added in version 5.0.8 | Valor predeterminado: 50 * 1024 * 1024 | The playbook output an RTE stores per stream
Read by an RTE ( |