for AnswerX, set the add-mac and cache-size options to dnsmasq
diff --git a/xos/services/cord/models.py b/xos/services/cord/models.py
index 263ebcd..9b98262 100644
--- a/xos/services/cord/models.py
+++ b/xos/services/cord/models.py
@@ -362,7 +362,7 @@
class VSGService(Service):
KIND = VCPE_KIND
- URL_FILTER_KIND_CHOICES = ( (None, "None"), ("safebrowsing", "Safe Browsing") )
+ URL_FILTER_KIND_CHOICES = ( (None, "None"), ("safebrowsing", "Safe Browsing"), ("answerx", "AnswerX") )
simple_attributes = ( ("bbs_api_hostname", None),
("bbs_api_port", None),
diff --git a/xos/synchronizers/vcpe/steps/sync_vcpetenant.py b/xos/synchronizers/vcpe/steps/sync_vcpetenant.py
index 266c6b1..2f2147b 100644
--- a/xos/synchronizers/vcpe/steps/sync_vcpetenant.py
+++ b/xos/synchronizers/vcpe/steps/sync_vcpetenant.py
@@ -181,7 +181,8 @@
"wan_vm_ip": wan_vm_ip,
"safe_browsing_macs": safe_macs,
"container_name": "vcpe-%s-%s" % (s_tags[0], c_tags[0]),
- "dns_servers": [x.strip() for x in vcpe_service.dns_servers.split(",")] }
+ "dns_servers": [x.strip() for x in vcpe_service.dns_servers.split(",")],
+ "url_filter_kind": vcpe_service.url_filter_kind }
# add in the sync_attributes that come from the SubscriberRoot object
diff --git a/xos/synchronizers/vcpe/steps/sync_vcpetenant.yaml b/xos/synchronizers/vcpe/steps/sync_vcpetenant.yaml
index 945e7cb..3823328 100644
--- a/xos/synchronizers/vcpe/steps/sync_vcpetenant.yaml
+++ b/xos/synchronizers/vcpe/steps/sync_vcpetenant.yaml
@@ -62,6 +62,7 @@
downlink_speed: {{ downlink_speed }}
status: {{ status }}
enable_uverse: {{ enable_uverse }}
+ url_filter_kind: {{ url_filter_kind }}
tasks:
{% if full_setup %}
diff --git a/xos/synchronizers/vcpe/steps/sync_vcpetenant_new.yaml b/xos/synchronizers/vcpe/steps/sync_vcpetenant_new.yaml
index fe11405..324e274 100644
--- a/xos/synchronizers/vcpe/steps/sync_vcpetenant_new.yaml
+++ b/xos/synchronizers/vcpe/steps/sync_vcpetenant_new.yaml
@@ -63,6 +63,7 @@
downlink_speed: {{ downlink_speed }}
status: {{ status }}
enable_uverse: {{ enable_uverse }}
+ url_filter_kind: {{ url_filter_kind }}
tasks:
- name: Verify if vcpe_stats_notifier ([] is to avoid capturing the shell process) cron job is already running
diff --git a/xos/synchronizers/vcpe/steps/sync_vcpetenant_vtn.yaml b/xos/synchronizers/vcpe/steps/sync_vcpetenant_vtn.yaml
index f042e5d..04521dc 100644
--- a/xos/synchronizers/vcpe/steps/sync_vcpetenant_vtn.yaml
+++ b/xos/synchronizers/vcpe/steps/sync_vcpetenant_vtn.yaml
@@ -68,6 +68,7 @@
downlink_speed: {{ downlink_speed }}
status: {{ status }}
enable_uverse: {{ enable_uverse }}
+ url_filter_kind: {{ url_filter_kind }}
tasks:
diff --git a/xos/synchronizers/vcpe/templates/dnsmasq_servers.j2 b/xos/synchronizers/vcpe/templates/dnsmasq_servers.j2
index 004576f..5d6839e 100644
--- a/xos/synchronizers/vcpe/templates/dnsmasq_servers.j2
+++ b/xos/synchronizers/vcpe/templates/dnsmasq_servers.j2
@@ -11,6 +11,11 @@
{% endif %}
{% endif %}
+{% if url_filter_kind=="answerx" %}
+cache-size=0
+add-mac
+{% endif %}
+
# use google's DNS service
{% for dns_server in dns_servers %}
server={{ dns_server }}