From 770d1614398fe5e01c0975c4ca5189165a5d6017 Mon Sep 17 00:00:00 2001 From: goldyfruit Date: Fri, 12 Jul 2024 11:54:48 -0400 Subject: [PATCH] [ansible] YAML linting based on 300 chars per line --- .../ovos_installer/tasks/docker/common.yml | 14 +- .../ovos_installer/tasks/docker/composer.yml | 104 ++----- ansible/roles/ovos_installer/tasks/ovos.yml | 50 +--- ansible/roles/ovos_installer/tasks/sound.yml | 6 +- .../ovos_installer/tasks/virtualenv/gui.yml | 18 +- .../tasks/virtualenv/systemd.yml | 256 +++--------------- .../ovos_installer/tasks/virtualenv/venv.yml | 77 +----- 7 files changed, 87 insertions(+), 438 deletions(-) diff --git a/ansible/roles/ovos_installer/tasks/docker/common.yml b/ansible/roles/ovos_installer/tasks/docker/common.yml index 6acfecb0..c2acd1d1 100644 --- a/ansible/roles/ovos_installer/tasks/docker/common.yml +++ b/ansible/roles/ovos_installer/tasks/docker/common.yml @@ -24,18 +24,8 @@ version: "{{ item.branch }}" force: true loop: - - { - "url": "{{ ovos_installer_ovos_docker_repo_url }}", - "branch": "{{ ovos_installer_ovos_docker_repo_branch }}", - "dest": "ovos-docker", - "state": "{{ true if (ovos_installer_profile != 'satellite' or ovos_installer_cleaning | bool) else false }}", - } - - { - "url": "{{ ovos_installer_hivemind_docker_repo_url }}", - "branch": "{{ ovos_installer_hivemind_docker_repo_branch }}", - "dest": "hivemind-docker", - "state": "{{ true if (ovos_installer_profile == 'satellite' or ovos_installer_cleaning | bool) else false }}", - } + - { "url": "{{ ovos_installer_ovos_docker_repo_url }}", "branch": "{{ ovos_installer_ovos_docker_repo_branch }}", "dest": "ovos-docker", "state": "{{ true if (ovos_installer_profile != 'satellite' or ovos_installer_cleaning | bool) else false }}" } + - { "url": "{{ ovos_installer_hivemind_docker_repo_url }}", "branch": "{{ ovos_installer_hivemind_docker_repo_branch }}", "dest": "hivemind-docker", "state": "{{ true if (ovos_installer_profile == 'satellite' or ovos_installer_cleaning | bool) else false }}" } when: item.state | bool tags: - always diff --git a/ansible/roles/ovos_installer/tasks/docker/composer.yml b/ansible/roles/ovos_installer/tasks/docker/composer.yml index 9e035ff1..fc929314 100644 --- a/ansible/roles/ovos_installer/tasks/docker/composer.yml +++ b/ansible/roles/ovos_installer/tasks/docker/composer.yml @@ -36,46 +36,16 @@ ansible.builtin.set_fact: _composition_files: "{{ _composition_files | default([]) + [item.file] }}" loop: - - { - "file": "docker-compose.yml", - "state": "{{ 'true' if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and _os_type == 'linux') else 'false' }}", - } - - { - "file": "docker-compose.windows.yml", - "state": "{{ 'true' if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and _os_type == 'wsl2') else 'false' }}", - } - - { - "file": "docker-compose.raspberrypi.yml", - "state": "{{ 'true' if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and ovos_installer_raspberrypi != 'N/A') else 'false' }}", - } - - { - "file": "docker-compose.skills.yml", - "state": "{{ 'false' if (ansible_memtotal_mb < 2048 and ovos_installer_profile != 'satellite' or not ovos_installer_feature_skills | bool) else 'true' }}", - } - - { - "file": "docker-compose.skills-extra.yml", - "state": "{{ 'false' if (ansible_memtotal_mb < 2048 and ovos_installer_profile != 'satellite' or not ovos_installer_feature_extra_skills | bool) else 'true' }}", - } - - { - "file": "docker-compose.hivemind.yml", - "state": "{{ 'true' if ovos_installer_profile == 'listener' else 'false' }}", - } - - { - "file": "docker-compose.gui.yml", - "state": "{{ 'true' if (ansible_memtotal_mb >= 1740 and ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and ovos_installer_feature_gui | bool) else 'false' }}", - } - - { - "file": "docker-compose.raspberrypi.gui.yml", - "state": "{{ 'true' if (ansible_memtotal_mb >= 1740 and ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and 'Raspberry Pi 4' in ovos_installer_raspberrypi and ovos_installer_feature_gui | bool) else 'false' }}", - } - - { - "file": "docker-compose.satellite.yml", - "state": "{{ 'true' if ovos_installer_profile == 'satellite' else 'false' }}", - } - - { - "file": "docker-compose.server.yml", - "state": "{{ 'true' if ovos_installer_profile == 'server' else 'false' }}", - } + - { "file": "docker-compose.yml", "state": "{{ 'true' if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and _os_type == 'linux') else 'false' }}" } + - { "file": "docker-compose.windows.yml", "state": "{{ 'true' if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and _os_type == 'wsl2') else 'false' }}" } + - { "file": "docker-compose.raspberrypi.yml", "state": "{{ 'true' if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and ovos_installer_raspberrypi != 'N/A') else 'false' }}" } + - { "file": "docker-compose.skills.yml", "state": "{{ 'false' if (ansible_memtotal_mb < 2048 and ovos_installer_profile != 'satellite' or not ovos_installer_feature_skills | bool) else 'true' }}" } + - { "file": "docker-compose.skills-extra.yml", "state": "{{ 'false' if (ansible_memtotal_mb < 2048 and ovos_installer_profile != 'satellite' or not ovos_installer_feature_extra_skills | bool) else 'true' }}" } + - { "file": "docker-compose.hivemind.yml", "state": "{{ 'true' if ovos_installer_profile == 'listener' else 'false' }}" } + - { "file": "docker-compose.gui.yml", "state": "{{ 'true' if (ansible_memtotal_mb >= 1740 and ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and ovos_installer_feature_gui | bool) else 'false' }}" } + - { "file": "docker-compose.raspberrypi.gui.yml", "state": "{{ 'true' if (ansible_memtotal_mb >= 1740 and ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server' and 'Raspberry Pi 4' in ovos_installer_raspberrypi and ovos_installer_feature_gui | bool) else 'false' }}" } + - { "file": "docker-compose.satellite.yml", "state": "{{ 'true' if ovos_installer_profile == 'satellite' else 'false' }}" } + - { "file": "docker-compose.server.yml", "state": "{{ 'true' if ovos_installer_profile == 'server' else 'false' }}" } when: item.state | bool - name: Deploy docker-compose stack @@ -116,51 +86,15 @@ become_user: "{{ ovos_installer_user }}" vars: _composition_mapping: - - { - "src": "ovos-docker", - "name": "ovos", - "file": "docker-compose.yml", - } - - { - "src": "ovos-docker", - "name": "ovos", - "file": "docker-compose.raspberrypi.yml", - } - - { - "src": "ovos-docker", - "name": "ovos", - "file": "docker-compose.skills.yml", - } - - { - "src": "ovos-docker", - "name": "ovos", - "file": "docker-compose.skills-extra.yml", - } - - { - "src": "ovos-docker", - "name": "ovos", - "file": "docker-compose.hivemind.yml", - } - - { - "src": "ovos-docker", - "name": "ovos", - "file": "docker-compose.gui.yml", - } - - { - "src": "ovos-docker", - "name": "ovos", - "file": "docker-compose.raspberrypi.gui.yml", - } - - { - "src": "ovos-docker", - "name": "ovos", - "file": "docker-compose.windows.yml", - } - - { - "src": "hivemind-docker", - "name": "hivemind", - "file": "docker-compose.satellite.yml", - } + - { "src": "ovos-docker", "name": "ovos", "file": "docker-compose.yml" } + - { "src": "ovos-docker", "name": "ovos", "file": "docker-compose.raspberrypi.yml" } + - { "src": "ovos-docker", "name": "ovos", "file": "docker-compose.skills.yml" } + - { "src": "ovos-docker", "name": "ovos", "file": "docker-compose.skills-extra.yml" } + - { "src": "ovos-docker", "name": "ovos", "file": "docker-compose.hivemind.yml" } + - { "src": "ovos-docker", "name": "ovos", "file": "docker-compose.gui.yml" } + - { "src": "ovos-docker", "name": "ovos", "file": "docker-compose.raspberrypi.gui.yml" } + - { "src": "ovos-docker", "name": "ovos", "file": "docker-compose.windows.yml" } + - { "src": "hivemind-docker", "name": "hivemind", "file": "docker-compose.satellite.yml" } community.docker.docker_compose_v2: project_src: "{{ _composition_directory }}" project_name: "{{ item.name }}" diff --git a/ansible/roles/ovos_installer/tasks/ovos.yml b/ansible/roles/ovos_installer/tasks/ovos.yml index 5b292d17..088bddd3 100644 --- a/ansible/roles/ovos_installer/tasks/ovos.yml +++ b/ansible/roles/ovos_installer/tasks/ovos.yml @@ -35,36 +35,15 @@ mode: "0755" state: directory loop: - - { - "directory": "{{ ovos_installer_user_home }}/.config/systemd/user", - "status": true, - } + - { "directory": "{{ ovos_installer_user_home }}/.config/systemd/user", "status": true } - { "directory": "{{ ovos_installer_user_home }}/ovos", "status": true } - - { - "directory": "{{ ovos_installer_user_home }}/ovos/config", - "status": true, - } - - { - "directory": "{{ ovos_installer_user_home }}/ovos/config/phal", - "status": true, - } - - { - "directory": "{{ ovos_installer_user_home }}/ovos/share", - "status": true, - } + - { "directory": "{{ ovos_installer_user_home }}/ovos/config", "status": true } + - { "directory": "{{ ovos_installer_user_home }}/ovos/config/phal", "status": true } + - { "directory": "{{ ovos_installer_user_home }}/ovos/share", "status": true } - { "directory": "{{ ovos_installer_user_home }}/ovos/tmp", "status": true } - - { - "directory": "{{ ovos_installer_user_home }}/hivemind", - "status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}", - } - - { - "directory": "{{ ovos_installer_user_home }}/hivemind/config", - "status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}", - } - - { - "directory": "{{ ovos_installer_user_home }}/hivemind/share", - "status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}", - } + - { "directory": "{{ ovos_installer_user_home }}/hivemind", "status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}" } + - { "directory": "{{ ovos_installer_user_home }}/hivemind/config", "status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}" } + - { "directory": "{{ ovos_installer_user_home }}/hivemind/share", "status": "{{ 'false' if (ovos_installer_profile == 'ovos' and ovos_installer_profile == 'server') else 'true' }}" } when: - item.status | bool - ovos_installer_method == "containers" @@ -77,18 +56,9 @@ mode: "0755" state: directory loop: - - { - "directory": "{{ ovos_installer_user_home }}/.config/mycroft", - "status": true, - } - - { - "directory": "{{ ovos_installer_user_home }}/.config/systemd/user", - "status": true, - } - - { - "directory": "{{ ovos_installer_user_home }}/nltk_data", - "status": true, - } + - { "directory": "{{ ovos_installer_user_home }}/.config/mycroft", "status": true } + - { "directory": "{{ ovos_installer_user_home }}/.config/systemd/user", "status": true } + - { "directory": "{{ ovos_installer_user_home }}/nltk_data", "status": true } when: - item.status | bool - ovos_installer_method == "virtualenv" diff --git a/ansible/roles/ovos_installer/tasks/sound.yml b/ansible/roles/ovos_installer/tasks/sound.yml index c561474f..f4ed60c0 100644 --- a/ansible/roles/ovos_installer/tasks/sound.yml +++ b/ansible/roles/ovos_installer/tasks/sound.yml @@ -8,8 +8,7 @@ - "{{ 'pipewire-alsa' if ansible_distribution not in ['Linux Mint', 'Zorin OS'] else 'pipewire' }}" - alsa-utils register: _pipewire_install - when: - not (ansible_distribution == 'Ubuntu' and _distribution_version is version('23.04', '<=') or + when: not (ansible_distribution == 'Ubuntu' and _distribution_version is version('23.04', '<=') or ansible_distribution == 'Debian' and _distribution_version is version('12.0', '<=')) - name: Install PulseAudio on older Debian and Ubuntu versions @@ -21,8 +20,7 @@ - pulseaudio - alsa-utils register: _pulseaudio_install - when: - (ansible_distribution == 'Ubuntu' and _distribution_version is version('23.04', '<=') or + when: (ansible_distribution == 'Ubuntu' and _distribution_version is version('23.04', '<=') or ansible_distribution == 'Debian' and _distribution_version is version('12.0', '<=')) - name: Determine available groups diff --git a/ansible/roles/ovos_installer/tasks/virtualenv/gui.yml b/ansible/roles/ovos_installer/tasks/virtualenv/gui.yml index 85660577..4377bd7c 100644 --- a/ansible/roles/ovos_installer/tasks/virtualenv/gui.yml +++ b/ansible/roles/ovos_installer/tasks/virtualenv/gui.yml @@ -117,21 +117,9 @@ dest: "{{ item.dest }}" version: "{{ item.branch }}" loop: - - { - "url": "https://github.com/OpenVoiceOS/mycroft-gui-qt5.git", - "dest": "/opt/mycroft-gui", - "branch": "dev", - } - - { - "url": "https://github.com/OpenVoiceOS/ovos-shell.git", - "dest": "/opt/ovos-shell", - "branch": "master", - } - - { - "url": "https://github.com/kbroulik/lottie-qml.git", - "dest": "/opt/lottie", - "branch": "master", - } + - { "url": "https://github.com/OpenVoiceOS/mycroft-gui-qt5.git", "dest": "/opt/mycroft-gui", "branch": "dev" } + - { "url": "https://github.com/OpenVoiceOS/ovos-shell.git", "dest": "/opt/ovos-shell", "branch": "master" } + - { "url": "https://github.com/kbroulik/lottie-qml.git", "dest": "/opt/lottie", "branch": "master" } - name: Create GUI directories ansible.builtin.file: diff --git a/ansible/roles/ovos_installer/tasks/virtualenv/systemd.yml b/ansible/roles/ovos_installer/tasks/virtualenv/systemd.yml index 41928e7c..9f1a68d9 100644 --- a/ansible/roles/ovos_installer/tasks/virtualenv/systemd.yml +++ b/ansible/roles/ovos_installer/tasks/virtualenv/systemd.yml @@ -13,92 +13,18 @@ backup: true notify: "{{ _notify_systemd_scope }}" loop: - - { - "unit": "ovos.service", - "dest": "{{ _path_user }}/ovos.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if ovos_installer_profile != 'satellite' else false }}", - } - - { - "unit": "ovos-messagebus.service", - "dest": "{{ _path_user }}/ovos-messagebus.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if ovos_installer_profile != 'satellite' else false }}", - } - - { - "unit": "ovos-core.service", - "dest": "{{ _path_user }}/ovos-core.service", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if ovos_installer_profile != 'satellite' else false }}", - } - - { - "unit": "ovos-phal.service", - "dest": "{{ _path_user }}/ovos-phal.service", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "ovos-phal-admin.service", - "dest": "{{ _path_system }}/ovos-phal-admin.service", - "user": "root", - "group": "root", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "ovos-listener.service", - "dest": "{{ _path_user }}/ovos-listener.service", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "ovos-audio.service", - "dest": "{{ _path_user }}/ovos-audio.service", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "ovos-gui-websocket.service", - "dest": "{{ _path_user }}/ovos-gui-websocket.service", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "unit": "ovos-gui.service", - "dest": "{{ _path_user }}/ovos-gui.service", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "unit": "ovos-ggwave-listener.service", - "dest": "{{ _path_user }}/ovos-ggwave-listener.service", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "hivemind-listener.service", - "dest": "{{ _path_user }}/hivemind-listener.service", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if (ovos_installer_profile == 'listener' or ovos_installer_profile == 'server') else false }}", - } - - { - "unit": "hivemind-satellite.service", - "dest": "{{ _path_user }}/hivemind-satellite.service", - "user": "{{ ovos_installer_user }}", - "group": "{{ ovos_installer_group }}", - "state": "{{ true if ovos_installer_profile == 'satellite' else false }}", - } + - { "unit": "ovos.service", "dest": "{{ _path_user }}/ovos.service", "scope": "user", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if ovos_installer_profile != 'satellite' else false }}" } + - { "unit": "ovos-messagebus.service", "dest": "{{ _path_user }}/ovos-messagebus.service", "scope": "user", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if ovos_installer_profile != 'satellite' else false }}" } + - { "unit": "ovos-core.service", "dest": "{{ _path_user }}/ovos-core.service", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if ovos_installer_profile != 'satellite' else false }}" } + - { "unit": "ovos-phal.service", "dest": "{{ _path_user }}/ovos-phal.service", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "ovos-phal-admin.service", "dest": "{{ _path_system }}/ovos-phal-admin.service", "user": "root", "group": "root", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "ovos-listener.service", "dest": "{{ _path_user }}/ovos-listener.service", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "ovos-audio.service", "dest": "{{ _path_user }}/ovos-audio.service", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "ovos-gui-websocket.service", "dest": "{{ _path_user }}/ovos-gui-websocket.service", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "unit": "ovos-gui.service", "dest": "{{ _path_user }}/ovos-gui.service", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "unit": "ovos-ggwave-listener.service", "dest": "{{ _path_user }}/ovos-ggwave-listener.service", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "hivemind-listener.service", "dest": "{{ _path_user }}/hivemind-listener.service", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if (ovos_installer_profile == 'listener' or ovos_installer_profile == 'server') else false }}" } + - { "unit": "hivemind-satellite.service", "dest": "{{ _path_user }}/hivemind-satellite.service", "user": "{{ ovos_installer_user }}", "group": "{{ ovos_installer_group }}", "state": "{{ true if ovos_installer_profile == 'satellite' else false }}" } when: item.state | bool - name: Flush handlers ovos @@ -116,78 +42,18 @@ state: "{{ _state }}" scope: "{{ item.scope }}" loop: - - { - "unit": "ovos.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if ovos_installer_profile != 'satellite' else false }}", - } - - { - "unit": "ovos-messagebus.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if ovos_installer_profile != 'satellite' else false }}", - } - - { - "unit": "ovos-core.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if ovos_installer_profile != 'satellite' else false }}", - } - - { - "unit": "ovos-phal.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "ovos-phal-admin.service", - "scope": "system", - "user": "root", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "ovos-listener.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "ovos-audio.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "ovos-gui-websocket.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "unit": "ovos-gui.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "unit": "ovos-ggwave-listener.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "unit": "hivemind-listener.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if (ovos_installer_profile == 'listener' or ovos_installer_profile == 'server') else false }}", - } - - { - "unit": "hivemind-satellite.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - "state": "{{ true if ovos_installer_profile == 'satellite' else false }}", - } + - { "unit": "ovos.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if ovos_installer_profile != 'satellite' else false }}" } + - { "unit": "ovos-messagebus.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if ovos_installer_profile != 'satellite' else false }}" } + - { "unit": "ovos-core.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if ovos_installer_profile != 'satellite' else false }}" } + - { "unit": "ovos-phal.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "ovos-phal-admin.service", "scope": "system", "user": "root", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "ovos-listener.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "ovos-audio.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "ovos-gui-websocket.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "unit": "ovos-gui.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "unit": "ovos-ggwave-listener.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "unit": "hivemind-listener.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if (ovos_installer_profile == 'listener' or ovos_installer_profile == 'server') else false }}" } + - { "unit": "hivemind-satellite.service", "scope": "user", "user": "{{ ovos_installer_user }}", "state": "{{ true if ovos_installer_profile == 'satellite' else false }}" } when: item.state | bool - name: Block uninstall systemd @@ -204,66 +70,18 @@ state: stopped scope: "{{ item.scope }}" loop: - - { - "unit": "ovos.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "ovos-messagebus.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "ovos-core.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "ovos-phal.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "ovos-phal-admin.service", - "scope": "system", - "user": "root", - } - - { - "unit": "ovos-listener.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "ovos-audio.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "ovos-gui-websocket.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "ovos-gui.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "ovos-ggwave-listener.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "hivemind-listener.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } - - { - "unit": "hivemind-satellite.service", - "scope": "user", - "user": "{{ ovos_installer_user }}", - } + - { "unit": "ovos.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "ovos-messagebus.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "ovos-core.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "ovos-phal.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "ovos-phal-admin.service", "scope": "system", "user": "root" } + - { "unit": "ovos-listener.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "ovos-audio.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "ovos-gui-websocket.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "ovos-gui.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "ovos-ggwave-listener.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "hivemind-listener.service", "scope": "user", "user": "{{ ovos_installer_user }}" } + - { "unit": "hivemind-satellite.service", "scope": "user", "user": "{{ ovos_installer_user }}" } register: _systemd_stop failed_when: _systemd_stop is not defined # We never want it to fail even if systemd unit doesn't exist @@ -295,7 +113,7 @@ ansible.builtin.file: path: "{{ item }}" state: absent - loop: + loop: - "{{ ovos_installer_user_home }}/.cache/mycroft" - "{{ ovos_installer_user_home }}/.config/mycroft" - "{{ ovos_installer_user_home }}/.config/hivemind" diff --git a/ansible/roles/ovos_installer/tasks/virtualenv/venv.yml b/ansible/roles/ovos_installer/tasks/virtualenv/venv.yml index 08cf8b5f..47fbfc94 100644 --- a/ansible/roles/ovos_installer/tasks/virtualenv/venv.yml +++ b/ansible/roles/ovos_installer/tasks/virtualenv/venv.yml @@ -6,41 +6,13 @@ group: root mode: "0644" loop: - - { - "file": "virtualenv/core-requirements.txt", - "dest": "/tmp/core-requirements.txt", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "file": "virtualenv/gui-requirements.txt", - "dest": "/tmp/gui-requirements.txt", - "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "file": "virtualenv/skills-requirements.txt", - "dest": "/tmp/skills-requirements.txt", - "state": "{{ true if (ovos_installer_feature_skills | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "file": "virtualenv/extra-skills-requirements.txt", - "dest": "/tmp/extra-skills-requirements.txt", - "state": "{{ true if (ovos_installer_feature_extra_skills | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "file": "virtualenv/listener-requirements.txt", - "dest": "/tmp/listener-requirements.txt", - "state": "{{ true if ovos_installer_profile == 'listener' else false }}", - } - - { - "file": "virtualenv/satellite-requirements.txt", - "dest": "/tmp/satellite-requirements.txt", - "state": "{{ true if ovos_installer_profile == 'satellite' else false }}", - } - - { - "file": "virtualenv/server-requirements.txt", - "dest": "/tmp/server-requirements.txt", - "state": "{{ true if ovos_installer_profile == 'server' else false }}", - } + - { "file": "virtualenv/core-requirements.txt", "dest": "/tmp/core-requirements.txt", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "file": "virtualenv/gui-requirements.txt", "dest": "/tmp/gui-requirements.txt", "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "file": "virtualenv/skills-requirements.txt", "dest": "/tmp/skills-requirements.txt", "state": "{{ true if (ovos_installer_feature_skills | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "file": "virtualenv/extra-skills-requirements.txt", "dest": "/tmp/extra-skills-requirements.txt", "state": "{{ true if (ovos_installer_feature_extra_skills | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "file": "virtualenv/listener-requirements.txt", "dest": "/tmp/listener-requirements.txt", "state": "{{ true if ovos_installer_profile == 'listener' else false }}" } + - { "file": "virtualenv/satellite-requirements.txt", "dest": "/tmp/satellite-requirements.txt", "state": "{{ true if ovos_installer_profile == 'satellite' else false }}" } + - { "file": "virtualenv/server-requirements.txt", "dest": "/tmp/server-requirements.txt", "state": "{{ true if ovos_installer_profile == 'server' else false }}" } when: item.state | bool - name: Create {{ ovos_installer_user_home }}/.venvs/ovos Python venv with tflite_runtime @@ -78,34 +50,13 @@ retries: 5 delay: 5 loop: - - { - "file": "/tmp/core-requirements.txt", - "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}", - } - - { - "file": "/tmp/gui-requirements.txt", - "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "file": "/tmp/skills-requirements.txt", - "state": "{{ true if (ovos_installer_feature_skills | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "file": "/tmp/extra-skills-requirements.txt", - "state": "{{ true if (ovos_installer_feature_extra_skills | bool and ovos_installer_profile != 'satellite') else false }}", - } - - { - "file": "/tmp/listener-requirements.txt", - "state": "{{ true if ovos_installer_profile == 'listener' else false }}", - } - - { - "file": "/tmp/satellite-requirements.txt", - "state": "{{ true if ovos_installer_profile == 'satellite' else false }}", - } - - { - "file": "/tmp/server-requirements.txt", - "state": "{{ true if ovos_installer_profile == 'server' else false }}", - } + - { "file": "/tmp/core-requirements.txt", "state": "{{ true if (ovos_installer_profile != 'satellite' and ovos_installer_profile != 'server') else false }}" } + - { "file": "/tmp/gui-requirements.txt", "state": "{{ true if (ovos_installer_feature_gui | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "file": "/tmp/skills-requirements.txt", "state": "{{ true if (ovos_installer_feature_skills | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "file": "/tmp/extra-skills-requirements.txt", "state": "{{ true if (ovos_installer_feature_extra_skills | bool and ovos_installer_profile != 'satellite') else false }}" } + - { "file": "/tmp/listener-requirements.txt", "state": "{{ true if ovos_installer_profile == 'listener' else false }}" } + - { "file": "/tmp/satellite-requirements.txt", "state": "{{ true if ovos_installer_profile == 'satellite' else false }}" } + - { "file": "/tmp/server-requirements.txt", "state": "{{ true if ovos_installer_profile == 'server' else false }}" } when: item.state | bool tags: - skip_ansible_lint