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) diff --git a/roles/nox/README.md b/roles/nox/README.md index 83f1d58..66ed130 100644 --- a/roles/nox/README.md +++ b/roles/nox/README.md @@ -59,6 +59,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 205d4a4..4c02eb5 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_local_backup_dir: "files/{{ fluence_project_dir }}/backups" 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 diff --git a/roles/nox/tasks/01-install.yml b/roles/nox/tasks/01-install.yml index 0f13f0d..d737876 100644 --- a/roles/nox/tasks/01-install.yml +++ b/roles/nox/tasks/01-install.yml @@ -18,6 +18,8 @@ system: true shell: "/sbin/nologin" group: "{{ nox_group }}" + groups: + - libvirt create_home: false state: present @@ -29,6 +31,62 @@ tags: - uninstall +- 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_user }}" + limit_type: "hard" + limit_item: "nofile" + comment: "Increse max open file hard limit" + value: 65536 + - domain: "{{ nox_user }}" + 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 }}" + state: absent + when: nox_cleanup_state + +- name: cleanup VMs if any + block: + - name: List all VMs + community.libvirt.virt: + command: list_vms + register: all_vms + + - debug: + msg: "{{ item }}" + loop: "{{ all_vms.list_vms }}" + + - name: "Destroy vm {{ item }}" + community.libvirt.virt: + name: "{{ item }}" + command: destroy + loop: "{{ all_vms.list_vms }}" + + - name: "Undefine vm {{ item }}" + community.libvirt.virt: + name: "{{ item }}" + command: undefine + loop: "{{ all_vms.list_vms }}" + when: nox_cleanup_state + - name: create nox directories ansible.builtin.file: path: "{{ nox_dir }}/state" 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