From ebb574fe813173a7eb4a8f821950bc622ce79d50 Mon Sep 17 00:00:00 2001 From: Anatolios Laskaris Date: Wed, 2 Oct 2024 12:50:00 +0300 Subject: [PATCH 1/4] fix: Fix errors with virtualization permissions and increase file limits (#63) Fixes --- roles/nox/tasks/01-install.yml | 28 ++++++++++++++++++++++++++++ roles/prerequisites/tasks/main.yml | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/roles/nox/tasks/01-install.yml b/roles/nox/tasks/01-install.yml index 79d4aa7..ad1eae7 100644 --- a/roles/nox/tasks/01-install.yml +++ b/roles/nox/tasks/01-install.yml @@ -18,9 +18,37 @@ system: true shell: "/sbin/nologin" group: "{{ nox_group }}" + groups: + - libvirt create_home: false state: present +- name: add nox user to libvirt group + ansible.builtin.user: + name: "libvirt-qemu" + groups: + - "{{ nox_group }}" + create_home: false + state: present + +- name: increase ulimits for nox user + ansible.builtin.pam_limits: + args: "{{ limit }}" + loop_control: + loop_var: "limit" + label: "{{ limit.domain }} {{ limit.limit_item }}:{{ limit.limit_type }}" + loop: + - domain: "nox" + limit_type: "hard" + limit_item: "nofile" + comment: "Increse max open file hard limit" + value: 65536 + - domain: "nox" + limit_type: "soft" + limit_item: "nofile" + comment: "Increse max open file soft limit" + value: 65536 + - name: cleanup nox state ansible.builtin.file: path: "{{ nox_dir }}" diff --git a/roles/prerequisites/tasks/main.yml b/roles/prerequisites/tasks/main.yml index 90a26bf..bd38995 100644 --- a/roles/prerequisites/tasks/main.yml +++ b/roles/prerequisites/tasks/main.yml @@ -26,7 +26,7 @@ state: started enabled: true daemon_reload: true - + - name: enable default network community.libvirt.virt_net: autostart: true From a8df7ecdc076a636a80cb35d7d9af7c91b4d2198 Mon Sep 17 00:00:00 2001 From: Anatolios Laskaris Date: Wed, 2 Oct 2024 12:52:46 +0300 Subject: [PATCH 2/4] feat: Add ability to configure nox log level (#60) Add ability to configure nox log level --- roles/nox/README.md | 10 ++++++++++ roles/nox/defaults/main.yml | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/roles/nox/README.md b/roles/nox/README.md index 4573d44..73aa520 100644 --- a/roles/nox/README.md +++ b/roles/nox/README.md @@ -46,6 +46,16 @@ 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 diff --git a/roles/nox/defaults/main.yml b/roles/nox/defaults/main.yml index daef816..809bc02 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_local_backup_dir: "files/{{ fluence_project_dir }}/backups" @@ -16,7 +17,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 From 97006ed69cabd7ca3bd8f0d81e9d0e9261207747 Mon Sep 17 00:00:00 2001 From: Anatolios Laskaris Date: Wed, 2 Oct 2024 14:47:05 +0300 Subject: [PATCH 3/4] fix: Set limits for `nox_user` (#64) Set limits for nox_user --- roles/nox/tasks/01-install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/nox/tasks/01-install.yml b/roles/nox/tasks/01-install.yml index ad1eae7..df772e6 100644 --- a/roles/nox/tasks/01-install.yml +++ b/roles/nox/tasks/01-install.yml @@ -38,12 +38,12 @@ loop_var: "limit" label: "{{ limit.domain }} {{ limit.limit_item }}:{{ limit.limit_type }}" loop: - - domain: "nox" + - domain: "{{ nox_user }}" limit_type: "hard" limit_item: "nofile" comment: "Increse max open file hard limit" value: 65536 - - domain: "nox" + - domain: "{{ nox_user }}" limit_type: "soft" limit_item: "nofile" comment: "Increse max open file soft limit" From 7f4313666edda9c1ad60a9db13ee1795456bd499 Mon Sep 17 00:00:00 2001 From: fluencebot <116741523+fluencebot@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:47:42 +0300 Subject: [PATCH 4/4] chore(main): release 0.3.11 (#62) --- .github/release-please/manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ galaxy.yml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json index 1f31d1d..2bd1b4a 100644 --- a/.github/release-please/manifest.json +++ b/.github/release-please/manifest.json @@ -1 +1 @@ -{".":"0.3.10"} +{".":"0.3.11"} diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d19d1..68cd0ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.3.11](https://github.com/fluencelabs/ansible/compare/v0.3.10...v0.3.11) (2024-10-02) + + +### Features + +* Add ability to configure nox log level ([#60](https://github.com/fluencelabs/ansible/issues/60)) ([a8df7ec](https://github.com/fluencelabs/ansible/commit/a8df7ecdc076a636a80cb35d7d9af7c91b4d2198)) +* Backup nox secrets dir localy ([#61](https://github.com/fluencelabs/ansible/issues/61)) ([2319dde](https://github.com/fluencelabs/ansible/commit/2319dde40bfcfd24da2fabcf6711eb9dc7830728)) + + +### Bug Fixes + +* Fix errors with virtualization permissions and increase file limits ([#63](https://github.com/fluencelabs/ansible/issues/63)) ([ebb574f](https://github.com/fluencelabs/ansible/commit/ebb574fe813173a7eb4a8f821950bc622ce79d50)) +* Set limits for `nox_user` ([#64](https://github.com/fluencelabs/ansible/issues/64)) ([97006ed](https://github.com/fluencelabs/ansible/commit/97006ed69cabd7ca3bd8f0d81e9d0e9261207747)) + ## [0.3.10](https://github.com/fluencelabs/ansible/compare/v0.3.9...v0.3.10) (2024-09-18) diff --git a/galaxy.yml b/galaxy.yml index f0fc9ca..797a0ed 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,6 +1,6 @@ namespace: fluencelabs name: provider -version: 0.3.10 +version: 0.3.11 readme: README.md authors: - Anatolios Laskaris (https://nahsi.dev)