環境変数
環境変数で AnsibleForms を設定します
AnsibleForms をデプロイする管理者向けです。サーバーが読み込む環境変数を、トピックごとにまとめて説明します。
AnsibleForms は、Docker Compose、Kubernetes、ソースのいずれで実行する場合も、環境変数で調整します。
値の取得元
サーバーは各変数を、次の取得元のうちその変数を設定している最初のものから読み込みます。そのため、リストの上にある値が常に優先されます。
- プロセスの環境 :docker-compose の
environment:とenv_file:(プロジェクトの.envはこの方法で渡されます)、 Kubernetes のenvとenvFrom、またはnodeを起動するシェル。 persistent/.env。設定ページが書き込むファイルです(docker-compose プロジェクトではdata/.env、MANAGED_ENV_PATHで別のパスにもできます)。本番環境でも起動のたびに読み込まれ、すでに設定されている変数を上書きすることはありません。server/.env.<NODE_ENV>。たとえば.env.developmentです。NODE_ENVがproductionでない場合(またはFORCE_DOTENV=1の場合)にだけ読み込まれます。実際には、開発モードで ソースから 実行する場合です。- 組み込みの既定値 。各グループの表に記載されています。
設定 > 全般 の設定ページには現在有効な値が表示され、変更は persistent/.env に保存されます。多くの変数は 保存するとすぐに反映されます。ほかの変数は保存されますが再起動が必要で、保存後にページに一覧が表示されます。プロセスの環境で 設定された変数はそこでは変更できず、ページには 環境で設定されているため、ここでは変更できません。 と表示されます。 ENCRYPTION_SECRET や ACCESS_TOKEN_SECRET など、ページから決して変更できない変数もいくつかあります。
AF_ROLE 、 RTE_MODE 、 CONTROLLER_URL 、 RTE_MAX_JOBS など、RTE が読み込む変数は設定ページにはまったくありません。 コントローラーはそれらを使わないので、RTE を実行する環境で設定してください。コントローラー自身が読み込む RTE_* 変数、 RTE_QUEUE_MINUTES と RTE_FILES_MAX_MB は例外で、ページに残っています。RTE の四つの変数 RTE_MAX_JOBS 、 RTE_CACHE_MB 、 RTE_FILES 、 RTE_DRAIN_SECONDS は、代わりに RTE ごとにランナーのページで設定することもでき、そこでの値が 変数より優先されます( RTE の設定 を参照)。
ALLOW_ENV_EDIT=0 の場合、ページには値が表示されるだけで、保存は拒否されます。 編集と監査 で説明しているように、環境をマニフェストで宣言している場合に使います。
構成シード は環境変数を設定しません。データベースに保存されるオブジェクトを宣言し、その中の ${ENV_VAR} 参照は実行中のサーバーの環境から解決されます。
環境からだけ読み込まれ、表には載っていない変数もいくつかあります。上で説明した MANAGED_ENV_PATH と FORCE_DOTENV 、 そしてシステムのプロキシ変数 HTTPS_PROXY と NO_PROXY (小文字も読み込まれます)です。アウトバウンドの RTE は HTTPS_PROXY を 経由してアプリに接続し、インバウンドの RTE は登録の呼び出しをそれ経由で送ります。ただし、アプリのホストが NO_PROXY (ホスト名、 .domain サフィックス、またはすべてのホストを表す * )に含まれる場合は除きます。
シークレット の付いた変数は、パスワード、トークン、キーを保持します。Kubernetes の Secret や コミットしない .env ファイルなどに置き、バージョン管理に含めないでください。
このセクションの内容
変数はトピックごとにグループ化され、グループごとに一つのページがあります。
| ページ | 内容 |
|---|---|
| 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 |
その他の変数
次の変数は、まだどのグループにも割り当てられていません。
| 変数 | 選択肢/既定値 | 説明 |
|---|---|---|
| CONFIG_SEED_RELOAD_ENABLED boolean added in version 7.9.0 | 既定値: 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 | 既定値: 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 | 既定値: 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 | 既定値: 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 | 既定値: 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 | 既定値: 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 | 既定値: 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. |