Variabili d’ambiente
Configura AnsibleForms con le variabili d’ambiente
Per gli amministratori che installano AnsibleForms: le variabili d’ambiente che il server legge, raggruppate per argomento.
AnsibleForms si regola con le variabili d’ambiente, che giri con Docker Compose, su Kubernetes o dai sorgenti.
Da dove arrivano i valori
Il server legge ogni variabile dalla prima di queste fonti che la imposta, quindi un valore più in alto nella lista vince sempre:
- L’ambiente del processo:
environment:edenv_file:in docker-compose (il.envdel progetto viene passato così),envedenvFromsu Kubernetes, o la shell che avvianode. persistent/.env, il file che scrivono le pagine delle impostazioni (data/.envnel progetto docker-compose, un altro percorso conMANAGED_ENV_PATH). Viene letto a ogni avvio, anche in produzione, e non sovrascrive mai una variabile già impostata.server/.env.<NODE_ENV>, per esempio.env.development. Viene letto solo quandoNODE_ENVnon èproduction(o conFORCE_DOTENV=1), in pratica quando si esegue dai sorgenti in modalità sviluppo.- Il valore predefinito integrato, mostrato nelle tabelle di ogni gruppo.
Le pagine delle impostazioni, in Impostazioni > Generale, mostrano il valore in vigore e salvano le modifiche in persistent/.env. Molte variabili si applicano appena salvate; le altre vengono salvate ma richiedono un riavvio, e la pagina le elenca dopo il salvataggio. Una variabile impostata nell’ambiente del processo non si può modificare lì: la pagina la mostra come Impostata nell’ambiente, non modificabile qui. Alcune variabili, come ENCRYPTION_SECRET e ACCESS_TOKEN_SECRET, non si possono mai modificare dalla pagina.
Le variabili che legge un RTE, come AF_ROLE, RTE_MODE, CONTROLLER_URL o RTE_MAX_JOBS, non compaiono affatto nelle pagine delle impostazioni: il controller non le usa, quindi impostale nell’ambiente in cui gira l’RTE. Le variabili RTE_* che legge il controller stesso, RTE_QUEUE_MINUTES e RTE_FILES_MAX_MB, sono l’eccezione e restano nelle pagine. Quattro variabili dell’RTE, RTE_MAX_JOBS, RTE_CACHE_MB, RTE_FILES e RTE_DRAIN_SECONDS, si possono invece impostare per singolo RTE nella sua pagina del runner, dove un valore vince sulla variabile (vedi Le impostazioni di un RTE).
Con ALLOW_ENV_EDIT=0 le pagine mostrano solo i valori e il salvataggio viene rifiutato. Usala quando l’ambiente è dichiarato in un manifest, come descritto in Modifica e audit.
Il config seed non imposta nessuna variabile d’ambiente. Dichiara oggetti che vengono salvati nel database, e i riferimenti ${ENV_VAR} al suo interno vengono risolti dall’ambiente del server in esecuzione.
Alcune variabili si leggono solo dall’ambiente e non sono nelle tabelle: MANAGED_ENV_PATH e FORCE_DOTENV, descritte sopra, e le variabili di proxy di sistema HTTPS_PROXY e NO_PROXY (lette anche in minuscolo). Un RTE in uscita contatta l’app tramite HTTPS_PROXY, e un RTE in entrata invia tramite esso la sua chiamata di registrazione, a meno che l’host dell’app non sia in NO_PROXY (nomi host, suffissi .domain, o * per ogni host).
Le variabili contrassegnate con Segreto contengono una password, un token o una chiave: tienile fuori dal controllo di versione, per esempio in un Secret di Kubernetes o in un file .env di cui non si fa commit.
In questa sezione
Le variabili sono raggruppate per argomento, con una pagina per gruppo:
| Pagina | Cosa tratta |
|---|---|
| Server and database | The web server, trusted proxies, the MySQL connection, the admin account, and what each process runs (controller, worker or RTE) |
| Paths | Where the configuration, forms, playbooks, workflows, uploads and backups live |
| Backups and retention | The backup commands, the backup before an upgrade, and how long backups, jobs and audit records are kept |
| Features | The designer, MCP, chat, launch validation, the jobs list, metrics, the AWX API and query logging |
| Configuration | The config seed, where the configuration is kept, git and ytt |
| Security variables | Sign-in limits, passwords, single sign-on, tokens, encryption, the browser policy, outbound REST and jq limits, masking, and the VAULT_* variables, read once to import a secret store |
| Logging | Log levels, the log format, files and how long they are kept, syslog and console colours |
| System tasks | When the system tasks under Jobs run, from the nightly cleanups and backup to the runner hub’s loops |
Altre variabili
Le seguenti variabili non sono ancora assegnate a un gruppo:
| Variabile | Scelte/Valori predefiniti | Commenti |
|---|---|---|
| CONFIG_SEED_RELOAD_ENABLED boolean added in version 7.9.0 | Predefinito: true | Config seed reload on
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_ENABLED boolean added in version 7.9.0 | Predefinito: true | Job cleanup on
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_ENABLED boolean added in version 7.9.0 | Predefinito: true | Audit log cleanup on
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_ENABLED boolean added in version 7.9.0 | Predefinito: true | Expired tokens on
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_ENABLED boolean added in version 7.9.0 | Predefinito: true | Stored jobs cleanup on
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_ENABLED boolean added in version 7.9.0 | Predefinito: true | Nightly backup on
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. |
| LOG_VIEW_LINES number added in version 7.7.0 | Predefinito: 1000 | Lines on the Server log page
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. |