From efadf019ec9b13f23c592d003cca8625f3e56c62 Mon Sep 17 00:00:00 2001 From: Anatoly Laskaris Date: Sat, 21 Sep 2024 13:02:08 +0300 Subject: [PATCH] Add ability to configure nox log level --- roles/nox/README.md | 46 +++++++++++++++++++++++++------------ roles/nox/defaults/main.yml | 3 ++- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/roles/nox/README.md b/roles/nox/README.md index 8957a9a..2c5747f 100644 --- a/roles/nox/README.md +++ b/roles/nox/README.md @@ -10,6 +10,7 @@ See this [example](https://github.com/fluencelabs/ansible/blob/main/example/) ### Cleanup nox state Rerun playbook with `nox_cleanup_state` set to `true`: + ```bash ansible-playbook nox.yml -e "nox_cleanup_state=true" ``` @@ -22,7 +23,9 @@ ansible-playbook nox.yml -e "nox_branch=FLU-688" ## Role Variables -See [defaults/](https://github.com/fluencelabs/ansible/blob/main/roles/nox/defaults) for details and examples. +See +[defaults/](https://github.com/fluencelabs/ansible/blob/main/roles/nox/defaults) +for details and examples. #### `fluence_project_dir` @@ -43,14 +46,24 @@ Should be put to `files/` directory where you run this role. - version of nox - type: string +#### `nox_log_level` + +- log level passed to `RUST_LOG` variable. Individual components log level can + me set like this `nox_log_level: "info,chain-listener=debug"` +- type: string +- default: + ```yml + nox_log_level: "info" + ``` + #### `nox_dir` - root nox directory - type: string - default: - ```yml - nox_dir: "/opt/fluence/nox" - ``` + ```yml + nox_dir: "/opt/fluence/nox" + ``` It will contain everything this role creates: nox binaries, configs, secrets. @@ -58,37 +71,40 @@ It will contain everything this role creates: nox binaries, configs, secrets. - systemd unit file - type: string -- default: see [defaults/main.yml](https://github.com/fluencelabs/blob/main/roles/nox/defaults/main.yml) +- default: see + [defaults/main.yml](https://github.com/fluencelabs/blob/main/roles/nox/defaults/main.yml) #### `nox_user` - owner of Nox process and files - type: string - default: - ```yml - nox_user: "nox" - ``` + ```yml + nox_user: "nox" + ``` #### `nox_group` - group of `nox_user` - type: string - default: - ```yml - nox_group: "nox" - ``` + ```yml + nox_group: "nox" + ``` #### `nox_cleanup_state` - whether to cleanup nox state - type: bool - default: - ```yml - nox_cleanup_state: false - ``` + ```yml + nox_cleanup_state: false + ``` #### `nox_branch` -- whole catalogue of branches can be viewed here https://files.fluence.dev/buckets/fluence-artifacts + +- whole catalogue of branches can be viewed here + https://files.fluence.dev/buckets/fluence-artifacts - type: string diff --git a/roles/nox/defaults/main.yml b/roles/nox/defaults/main.yml index 1274f64..cbbad9c 100644 --- a/roles/nox/defaults/main.yml +++ b/roles/nox/defaults/main.yml @@ -3,6 +3,7 @@ nox_dir: "/opt/fluence/nox" nox_project_dir: "" nox_group: "nox" nox_user: "nox" +nox_log_level: "info" nox_branch: "" nox_cleanup_state: false nox_unit_file: | @@ -15,7 +16,7 @@ nox_unit_file: | Environment="FLUENCE_CONFIG={{ nox_dir }}/Config.toml" Environment="FLUENCE_BASE_DIR={{ nox_dir }}/state" Environment="FLUENCE_ROOT_KEY_PAIR__PATH={{ nox_dir }}/state/root_secret_key.ed25519" - Environment="RUST_LOG=info,chain-listener=debug,chain-connector=debug" + Environment="RUST_LOG={{ nox_log_level }}" ExecStart={{ nox_dir }}/nox Restart=on-failure User=root