refactor vBBU as a separate project
(1) Moved xos/xos/services/mcord/ to xos_services/vBBU
(2) Moved the location of tosca files
from xos/xos/tosca/ to xos_services/vBBU/xos/tosca/
(3) Moved the location of synchronizer files
from xos/xos/synchronizers to xos_services/vBBU/xos/synchronizers
(4) Added make_synchronizer_manifest.sh and manifest
(5) Added vBBU-onboard.yaml
Change-Id: I97c8c234d66ef3121403fb9dd109d7497efe4e2a
diff --git a/xos/synchronizer/steps/sync_vbbu.py b/xos/synchronizer/steps/sync_vbbu.py
new file mode 100644
index 0000000..09b1fe8
--- /dev/null
+++ b/xos/synchronizer/steps/sync_vbbu.py
@@ -0,0 +1,37 @@
+import os
+import sys
+from django.db.models import Q, F
+from services.mcord.models import MCORDService, VBBUComponent
+from synchronizers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
+
+parentdir = os.path.join(os.path.dirname(__file__), "..")
+sys.path.insert(0, parentdir)
+
+class SyncVBBUComponent(SyncInstanceUsingAnsible):
+
+ provides = [VBBUComponent]
+
+ observes = VBBUComponent
+
+ requested_interval = 0
+
+ template_name = "sync_vbbu.yaml"
+
+ service_key_name = "/opt/xos/configurations/mcord/mcord_private_key"
+
+ def __init__(self, *args, **kwargs):
+ super(SyncVBBUComponent, self).__init__(*args, **kwargs)
+
+ def fetch_pending(self, deleted):
+
+ if (not deleted):
+ objs = VBBUComponent.get_tenant_objects().filter(
+ Q(enacted__lt=F('updated')) | Q(enacted=None), Q(lazy_blocked=False))
+ else:
+
+ objs = VBBUComponent.get_deleted_tenant_objects()
+
+ return objs
+
+ def get_extra_attributes(self, o):
+ return {"display_message": o.display_message, "s1u_tag": o.s1u_tag, "s1mme_tag": o.s1mme_tag, "rru_tag": o.rru_tag}
diff --git a/xos/synchronizer/steps/sync_vbbu.yaml b/xos/synchronizer/steps/sync_vbbu.yaml
new file mode 100644
index 0000000..1e1e258
--- /dev/null
+++ b/xos/synchronizer/steps/sync_vbbu.yaml
@@ -0,0 +1,19 @@
+---
+- hosts: {{ instance_name }}
+ gather_facts: False
+ connection: ssh
+ user: ubuntu
+ sudo: yes
+ tasks:
+
+ - name: write message
+ shell: echo "{{ display_message }}" > /var/tmp/index.html
+
+ - name: setup s1u interface config
+ shell: ./start_3gpp_int.sh eth1 {{ s1u_tag }} {{ s1u_ip }}/24
+
+ - name: setup s1mme interface config
+ shell: ./start_3gpp_int.sh eth2 {{ s1mme_tag }} {{ s1mme_ip }}/24
+
+ - name: setup rru interface config
+ shell: ./start_3gpp_int.sh eth3 {{ rru_tag }} {{ rru_ip }}/24