Skip to content

Commit dda83b4

Browse files
committed
Make sure .config/systemd is not created on macos
1 parent fb8abc3 commit dda83b4

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

ansible/roles/ovos_config/defaults/main.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ ovos_config_hotword_sensitivity: "{{ ovos_installer_hotword_sensitivity | defaul
33
ovos_config_hotword_trigger_level: "{{ ovos_installer_hotword_trigger_level | default(1) }}"
44
ovos_config_listener_multiplier: "{{ ovos_installer_listener_multiplier | default(1.5) }}"
55

6-
ovos_config_backup_paths:
6+
ovos_config_backup_paths_common:
77
- "{{ ovos_installer_user_home }}/ovos/*"
88
- "{{ ovos_installer_user_home }}/hivemind/*"
9-
- "{{ ovos_installer_user_home }}/.config/systemd/user/*"
109
- "{{ ovos_installer_user_home }}/.config/mycroft/*"
1110
- "{{ ovos_installer_user_home }}/.config/hivemind/*"
1211
- "{{ ovos_installer_user_home }}/.config/OpenVoiceOS/*"
@@ -16,6 +15,11 @@ ovos_config_backup_paths:
1615
- "{{ ovos_installer_user_home }}/.local/share/hivemind/*"
1716
- "{{ ovos_installer_user_home }}/.local/state/ovos/*"
1817
- "{{ ovos_installer_user_home }}/.local/state/mycroft/*"
18+
ovos_config_backup_paths: >-
19+
{{
20+
ovos_config_backup_paths_common
21+
+ ([ovos_installer_user_home + '/.config/systemd/user/*'] if ansible_facts.system == 'Linux' else [])
22+
}}
1923
ovos_config_backup_dest: "{{ ovos_installer_user_home }}/ovos-backup.tar.gz"
2024
ovos_config_backup_owner: "{{ ovos_installer_user }}"
2125
ovos_config_backup_group: "{{ ovos_installer_group }}"
@@ -29,7 +33,7 @@ ovos_config_container_dir_owner: "{{ ovos_installer_user }}"
2933
ovos_config_container_dir_group: "{{ ovos_installer_group }}"
3034
ovos_config_container_dir_mode: "0755"
3135
ovos_config_container_directories:
32-
- { path: "{{ ovos_installer_user_home }}/.config/systemd/user", enabled: true }
36+
- { path: "{{ ovos_installer_user_home }}/.config/systemd/user", enabled: "{{ ansible_facts.system == 'Linux' }}" }
3337
- { path: "{{ ovos_installer_user_home }}/ovos", enabled: true }
3438
- { path: "{{ ovos_installer_user_home }}/ovos/config", enabled: true }
3539
- { path: "{{ ovos_installer_user_home }}/ovos/config/persona", enabled: true }
@@ -49,7 +53,7 @@ ovos_config_virtualenv_directories:
4953
- { path: "{{ ovos_installer_user_home }}/.local", enabled: true }
5054
- { path: "{{ ovos_installer_user_home }}/.local/bin", enabled: true }
5155
- { path: "{{ ovos_installer_user_home }}/.config/hivemind", enabled: "{{ ovos_installer_profile != 'ovos' }}" }
52-
- { path: "{{ ovos_installer_user_home }}/.config/systemd/user", enabled: true }
56+
- { path: "{{ ovos_installer_user_home }}/.config/systemd/user", enabled: "{{ ansible_facts.system == 'Linux' }}" }
5357
- { path: "{{ ovos_installer_user_home }}/nltk_data", enabled: true }
5458

5559
ovos_config_geoip_url: "{{ ovos_installer_geoip_url }}"

tests/bats/code_quality.bats

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,20 @@ function setup() {
475475
assert_success
476476
}
477477

478+
@test "macos_does_not_require_systemd_user_config_paths" {
479+
run grep -q "ovos_config_backup_paths_common" ansible/roles/ovos_config/defaults/main.yml
480+
assert_success
481+
482+
run grep -q "ansible_facts.system == 'Linux'" ansible/roles/ovos_config/defaults/main.yml
483+
assert_success
484+
485+
run grep -F -q '.config/systemd/user", enabled: "{{ ansible_facts.system == '\''Linux'\'' }}"' ansible/roles/ovos_config/defaults/main.yml
486+
assert_success
487+
488+
run grep -F -q "/.config/systemd/user/*'] if ansible_facts.system == 'Linux' else []" ansible/roles/ovos_config/defaults/main.yml
489+
assert_success
490+
}
491+
478492
@test "homeassistant_url_defaults_port_only_for_http" {
479493
run grep -q 'if \[ "\$proto" == "http" \]; then' tui/homeassistant.sh
480494
assert_success

0 commit comments

Comments
 (0)