Skip to content

Commit d3d5906

Browse files
committed
[mark2] Fix ipgeo PHAL
1 parent dc54a70 commit d3d5906

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

ansible/roles/ovos_config/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ ovos_config_virtualenv_directories:
5959
ovos_config_geoip_url: "{{ ovos_installer_geoip_url }}"
6060
ovos_config_geoip_enabled: "{{ ovos_installer_geoip_enabled | default(false) }}"
6161
ovos_config_geoip_timeout: 5
62+
ovos_config_mark2_network_tests_ip_url: "{{ ovos_installer_mark2_network_tests_ip_url }}"
6263
ovos_config_mycroft_conf_relpath: "{{ '.config/mycroft' if ovos_installer_method == 'virtualenv' else 'ovos/config' }}"
6364
ovos_config_mycroft_conf_mode: "0600"
6465
ovos_config_system_unit: "{{ ovos_installer_system_unit }}"

ansible/roles/ovos_config/templates/mycroft.conf.j2

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@
100100
"host": "{{ '0.0.0.0' if ovos_installer_method == "containers" else '127.0.0.1' }}",
101101
"max_msg_size": 25
102102
},
103+
{% if 'tas5806' in ovos_installer_i2c_devices %}
104+
"network_tests": {
105+
"ip_url": "{{ ovos_config_mark2_network_tests_ip_url }}"
106+
},
107+
{% endif %}
103108
"PHAL": {
104109
"admin": {
105110
"ovos-PHAL-plugin-system": {
@@ -119,7 +124,7 @@
119124
}
120125
},
121126
"ovos-phal-plugin-ipgeo": {
122-
"enabled": false
127+
"enabled": true
123128
}
124129
{% endif %}
125130
}{% if ovos_installer_usage_telemetry| bool %},

ansible/roles/ovos_installer/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ ovos_installer_telemetry: "{{ ovos_installer_usage_telemetry | bool }}"
136136
ovos_installer_run_ovos_config: false
137137
ovos_installer_geoip_enabled: false
138138
ovos_installer_geoip_url: "https://ipapi.co/json/"
139+
ovos_installer_mark2_network_tests_ip_url: "https://ifconfig.me/ip"
139140
ovos_installer_system_unit: "metric"
140141
ovos_installer_temperature_unit: "celsius"
141142
ovos_installer_precipitation_unit: "mm"

tests/bats/code_quality.bats

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,16 +265,22 @@ function setup() {
265265
assert_failure
266266
}
267267

268-
@test "mycroft_conf_disables_ipgeo_phal_plugin_for_mark2" {
268+
@test "mycroft_conf_enables_ipgeo_phal_plugin_and_sets_mark2_ip_lookup_url" {
269269
local conf_file="ansible/roles/ovos_config/templates/mycroft.conf.j2"
270270

271271
run grep -F -q "{% if 'tas5806' in ovos_installer_i2c_devices %}" "$conf_file"
272272
assert_success
273273

274+
run grep -F -q "\"network_tests\": {" "$conf_file"
275+
assert_success
276+
277+
run grep -F -q "\"ip_url\": \"{{ ovos_config_mark2_network_tests_ip_url }}\"" "$conf_file"
278+
assert_success
279+
274280
run grep -F -q "\"ovos-phal-plugin-ipgeo\": {" "$conf_file"
275281
assert_success
276282

277-
run bash -c "grep -A4 -F -- \"\\\"ovos-phal-plugin-ipgeo\\\": {\" \"$conf_file\" | grep -q -- \"\\\"enabled\\\": false\""
283+
run bash -c "grep -A4 -F -- \"\\\"ovos-phal-plugin-ipgeo\\\": {\" \"$conf_file\" | grep -q -- \"\\\"enabled\\\": true\""
278284
assert_success
279285
}
280286

0 commit comments

Comments
 (0)