Populate web server with hello world configuration
diff --git a/xos/observers/helloworld/steps/sync_hello.py b/xos/observers/helloworld/steps/sync_hello.py
index f59ec5c..1fb8c2b 100644
--- a/xos/observers/helloworld/steps/sync_hello.py
+++ b/xos/observers/helloworld/steps/sync_hello.py
@@ -18,7 +18,9 @@
requested_interval=0
def sync_record(self, record):
- open('/tmp/hello-synchronizer','w').write(record.name)
+ instance = record.sliver_backref
+ instance.userData="packages:\n - apache2\nruncmd:\n - update-rc.d apache2 enable\n - service apache2 start\nwrite_files:\n- content: Hello %s\n path: /var/www/html/hello.txt"%record.name
+ instance.save()
def delete_record(self, m):
return
diff --git a/xos/openstack_observer/steps/sync_instances.py b/xos/openstack_observer/steps/sync_instances.py
index 7aa4bb7..4ac1870 100644
--- a/xos/openstack_observer/steps/sync_instances.py
+++ b/xos/openstack_observer/steps/sync_instances.py
@@ -108,7 +108,7 @@
userData = self.get_userdata(instance, pubkeys)
if instance.userData:
- userData = instance.userData
+ userData += instance.userData
controller = instance.node.site_deployment.controller
fields = {'endpoint':controller.auth_url,