-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add autoconfig support to installer #170
Changes from 8 commits
7f774b3
9cdb216
6ae940f
5a7afae
b92337b
33fa149
92198b6
fc50a85
d7886b7
7e2c383
9423a24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,20 @@ | |
changed_when: false | ||
when: ovos_installer_profile == "satellite" | ||
|
||
- name: Run ovos-config for auto-configuration of STT and TTS based on language | ||
become: true | ||
become_user: "{{ ovos_installer_user }}" | ||
ansible.builtin.shell: | ||
cmd: | | ||
ovos-config autoconfigure \ | ||
--lang {{ ovos_installer_locale }} \ | ||
--male | ||
executable: /bin/bash | ||
environment: | ||
PATH: "{{ ovos_installer_user_home }}/.venvs/ovos/bin" | ||
VIRTUAL_ENV: "{{ ovos_installer_user_home }}/.venvs/ovos" | ||
changed_when: false | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance the auto-configuration task for better flexibility and robustness. The new task for auto-configuration of STT and TTS is a good addition, but there are a few areas for improvement:
Consider applying the following improvements:
ovos-config autoconfigure \
--lang {{ ovos_installer_locale }} \
{{ '--male' if ovos_installer_voice_gender == 'male' else '--female' }}
when: ovos_installer_profile != 'server'
register: ovos_config_result
failed_when: ovos_config_result.rc != 0
These changes will make the task more flexible, efficient, and robust. |
||
- name: Remove {{ ovos_installer_user_home }}/.venvs/ovos Python virtualenv and requirements.txt files | ||
ansible.builtin.file: | ||
path: "{{ ovos_installer_user_home }}/.venvs/ovos" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Enhance the auto-configuration task with conditional execution and error handling
The new task for auto-configuration of STT and TTS is a good addition that aligns with the PR objectives. However, consider the following improvements:
ovos_installer_profile
to ensure it only runs for the appropriate setup (e.g., satellite profile).Here's a suggested improvement:
This version adds conditional execution, error handling, and allows for voice gender preference while maintaining the male default.
🛠️ Refactor suggestion
Consider grouping related configuration tasks
The placement of the new auto-configuration task is logical in the current workflow. However, to improve the playbook's organization and readability, consider grouping related configuration tasks together.
You could create a block for all configuration-related tasks, including the
Generate _identity.json
task and this new auto-configuration task. This would make the playbook structure more clear and easier to maintain. For example:This structure groups related tasks and applies the condition to both tasks, reducing redundancy and improving clarity.