allow setting of specific charm versions, with fallback
diff --git a/files/cord_juju_config.yml b/files/cord_juju_config.yml
new file mode 100644
index 0000000..199cda7
--- /dev/null
+++ b/files/cord_juju_config.yml
@@ -0,0 +1,43 @@
+---
+# juju configuration file for CORD deployments
+
+ceilometer:
+  openstack-origin: cloud:trusty-kilo
+
+glance:
+  ha-mcastport: 5402
+  openstack-origin: cloud:trusty-kilo
+
+keystone:
+  ha-mcastport: 5403
+  https-service-endpoints: False
+  openstack-origin: cloud:trusty-kilo
+  use-https: no
+
+mysql:
+   max-connections: 20000
+
+neutron-api:
+  neutron-plugin: onosvtn
+  onos-vtn-ip: onos-cord
+  neutron-security-groups: true
+  openstack-origin: cloud:trusty-kilo
+  overlay-network-type: vxlan
+
+nova-cloud-controller:
+  config-flags: "force_config_drive=always"
+  console-access-protocol: novnc
+  network-manager: Neutron
+  openstack-origin: cloud:trusty-kilo
+
+nova-compute:
+  config-flags: firewall_driver=nova.virt.firewall.NoopFirewallDriver
+  disable-neutron-security-groups: True
+  openstack-origin: cloud:trusty-kilo
+
+openstack-dashboard:
+  openstack-origin: cloud:trusty-kilo
+
+rabbitmq-server:
+  ssl: 'off'
+
diff --git a/files/opencloud_juju_config.yml b/files/opencloud_juju_config.yml
new file mode 100644
index 0000000..8031f13
--- /dev/null
+++ b/files/opencloud_juju_config.yml
@@ -0,0 +1,49 @@
+---
+# juju configuration file for OpenCloud deployments
+
+glance:
+  openstack-origin: "cloud:trusty-kilo"
+
+keystone:
+  use-https: "yes"
+  https-service-endpoints: "True"
+  openstack-origin: "cloud:trusty-kilo"
+
+neutron-api:
+  flat-network-providers: "*"
+  openstack-origin: "cloud:trusty-kilo"
+  vlan-ranges: "physnet1:1000:2000 nat"
+
+neutron-gateway:
+  bridge-mappings: "physnet1:br-data nat:br-nat"
+  flat-network-providers: "*"
+  instance-mtu: "1400"
+  openstack-origin: "cloud:trusty-kilo"
+  vlan-ranges: "physnet1:1000:2000 nat"
+
+neutron-openvswitch:
+  bridge-mappings: "physnet1:br-data nat:br-nat"
+  disable-security-groups: "True"
+  flat-network-providers: "*"
+  vlan-ranges: "physnet1:1000:2000 nat"
+
+nova-cloud-controller:
+  console-access-protocol: "novnc"
+  network-manager: "Neutron"
+  openstack-origin: "cloud:trusty-kilo"
+
+nova-compute:
+  virt-type: kvm
+  config-flags: "firewall_driver=nova.virt.firewall.NoopFirewallDriver"
+  disable-neutron-security-groups: "True"
+  openstack-origin: "cloud:trusty-kilo"
+
+ntp:
+  source: "0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org 2.ubuntu.pool.ntp.org 3.ubuntu.pool.ntp.org"
+
+openstack-dashboard:
+  openstack-origin: "cloud:trusty-kilo"
+
+rabbitmq-server:
+  ssl: "on"
+
diff --git a/roles/juju-setup/tasks/main.yml b/roles/juju-setup/tasks/main.yml
index a89cd99..075467e 100644
--- a/roles/juju-setup/tasks/main.yml
+++ b/roles/juju-setup/tasks/main.yml
@@ -59,11 +59,11 @@
   command: juju bootstrap
     creates={{ ansible_user_dir }}/.juju/environments/manual.jenv
 
-- name: Create openstack.cfg for Juju from template
+- name: Copy over juju-config.yml for configuring Juju services
   become: yes
   template:
-    src=openstack.cfg.j2
-    dest={{ openstack_cfg_path }}
+    src={{ juju_config_file }}
+    dest={{ juju_config_path }}
 
 # Code for this is in library/juju_facts.py
 - name: Obtain Juju Facts for creating machines
@@ -82,15 +82,15 @@
   juju_facts:
 
 - name: Deploy services that are hosted in their own VM
-  command: "juju deploy {{ item }} --to {{ juju_machines[item]['machine_id'] }} --config={{ openstack_cfg_path }}"
+  command: "juju deploy {{ charm_version[item] | default(item) }} --to {{ juju_machines[item]['machine_id'] }} --config={{ juju_config_path }}"
   with_items: "{{ vm_service_list | difference( juju_services.keys() ) }}"
 
 - name: Deploy mongodb to ceilometer VM
-  command: "juju deploy mongodb --to {{ juju_machines['ceilometer']['machine_id'] }} --config={{ openstack_cfg_path }}"
+  command: "juju deploy {{ charm_version['mongodb'] | default('mongodb') }} --to {{ juju_machines['ceilometer']['machine_id'] }} --config={{ juju_config_path }}"
   when: juju_services['mongodb'] is undefined
 
 - name: Deploy services that don't have their own VM
-  command: "juju deploy {{ item }} --config={{ openstack_cfg_path }}"
+  command: "juju deploy {{ charm_version[item] | default(item) }} --config={{ juju_config_path }}"
   with_items: "{{ standalone_service_list | difference( juju_services.keys() ) }}"
 
 # FIXME: ignoring errors when creating relationships.
diff --git a/roles/juju-setup/templates/openstack.cfg.j2 b/roles/juju-setup/templates/openstack.cfg.j2
deleted file mode 100644
index 38850a9..0000000
--- a/roles/juju-setup/templates/openstack.cfg.j2
+++ /dev/null
@@ -1,44 +0,0 @@
-ceilometer:
-ceilometer-agent:
-glance:
-   openstack-origin: "cloud:trusty-kilo"
-keystone:
-   use-https: "yes"
-   https-service-endpoints: "True"
-   openstack-origin: "cloud:trusty-kilo"
-mysql:
-mongodb:
-nagios:
-neutron-api:
-   flat-network-providers: "*"
-   openstack-origin: "cloud:trusty-kilo"
-   vlan-ranges: "physnet1:1000:2000 nat"
-neutron-gateway:
-   bridge-mappings: "physnet1:br-data nat:br-nat"
-   flat-network-providers: "*"
-   instance-mtu: "1400"
-   openstack-origin: "cloud:trusty-kilo"
-   vlan-ranges: "physnet1:1000:2000 nat"
-neutron-openvswitch:
-   bridge-mappings: "physnet1:br-data nat:br-nat"
-   disable-security-groups: "True"
-   flat-network-providers: "*"
-   vlan-ranges: "physnet1:1000:2000 nat"
-nova-cloud-controller:
-   console-access-protocol: "novnc"
-   network-manager: "Neutron"
-   openstack-origin: "cloud:trusty-kilo"
-nova-compute:
-   virt-type: kvm
-   config-flags: "firewall_driver=nova.virt.firewall.NoopFirewallDriver"
-#   config-flags: "firewall_driver=nova.virt.firewall.NoopFirewallDriver,xos_api_url=http://portal.opencloud.us"
-   disable-neutron-security-groups: "True"
-   openstack-origin: "cloud:trusty-kilo"
-ntp:
-   source: "0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org 2.ubuntu.pool.ntp.org 3.ubuntu.pool.ntp.org"
-nrpe:
-openstack-dashboard:
-   openstack-origin: "cloud:trusty-kilo"
-rabbitmq-server:
-  ssl: "on"
-
diff --git a/vars/cord_defaults.yml b/vars/cord_defaults.yml
index 1f0777a..d276da1 100644
--- a/vars/cord_defaults.yml
+++ b/vars/cord_defaults.yml
@@ -1,11 +1,30 @@
 ---
-# vars/opencloud_defaults.yml
+# vars/cord_defaults.yml
 
 openstack_version: kilo
-openstack_cfg_path: /usr/local/src/openstack.cfg
+
+juju_config_file: cord_juju_config.yml
+juju_config_path: /usr/local/src/juju_config.yml
 
 xos_configuration: cord-pod
 
+charm_versions:
+  ceilometer: "cs:trusty/ceilometer-17"
+  ceilometer-agent: "cs:trusty/ceilometer-agent-13"
+  glance: "cs:trusty/glance-28"
+  keystone: "cs:trusty/keystone-33"
+  mongodb: "cs:trusty/mongodb-33"
+  mysql: "cs:trusty/percona-cluster-31"
+  nagios: "cs:trusty/nagios-10"
+  neutron-api: "cs:~cordteam/trusty/neutron-api-1"
+  nova-cloud-controller: "cs:trusty/nova-cloud-controller-64"
+  nova-compute: "cs:~cordteam/trusty/nova-compute-2"
+  nrpe: "cs:trusty/nrpe-4"
+  ntp: "cs:trusty/ntp-14"
+  openstack-dashboard: "cs:trusty/openstack-dashboard-19"
+  rabbitmq-server: "cs:trusty/rabbitmq-server-42"
+
+
 head_vm_list:
   - name: "juju-1"
     service: "juju"
@@ -159,11 +178,13 @@
   - rabbitmq-server
   - nova-compute
 
+
 standalone_service_list:
   - ntp
   - nrpe
   - ceilometer-agent
 
+
 service_relations:
   - name: keystone
     relations: [ "mysql", "nrpe", ]
@@ -199,7 +220,7 @@
     relations: [ "ceilometer-agent:ceilometer-service", ]
 
   - name: nova-compute
-    relations: [ "glance", "nova-cloud-controller", "nagios", "nrpe", ]
+    relations: [ "ceilometer-agent", "glance", "nova-cloud-controller", "nagios", "nrpe", ]
 
   - name: "nova-compute:shared-db"
     relations: [ "mysql:shared-db", ]
diff --git a/vars/opencloud_defaults.yml b/vars/opencloud_defaults.yml
index 41628a8..c9e34f0 100644
--- a/vars/opencloud_defaults.yml
+++ b/vars/opencloud_defaults.yml
@@ -2,7 +2,11 @@
 # vars/opencloud_defaults.yml
 
 openstack_version: kilo
-openstack_cfg_path: /usr/local/src/openstack.cfg
+
+juju_config_file: opencloud_juju_config.yml
+juju_config_path: /usr/local/src/juju_config.yml
+
+charm_versions: {}
 
 head_vm_list:
   - name: "juju-1"