diff options
Diffstat (limited to 'deploy/post/execute.py')
-rw-r--r-- | deploy/post/execute.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/deploy/post/execute.py b/deploy/post/execute.py index 24061e0b..f64b9af6 100644 --- a/deploy/post/execute.py +++ b/deploy/post/execute.py @@ -10,12 +10,23 @@ import os import glance import argparse - +import yaml import neutron import nova from deploy.config.network import NetworkConfig +def _config_kolla_admin_openrc(kolla_config_path): + with open('%s/globals.yml' % kolla_config_path, 'r') as f: + kolla_config = yaml.safe_load(f.read()) + if kolla_config.get('opendaylight_leader_ip_address'): + sdn_controller_ip = kolla_config.get('opendaylight_leader_ip_address') + openrc_file = file('%s/admin-openrc.sh' % kolla_config_path, 'a') + sdn_ctl_ip = 'export SDN_CONTROLLER_IP=' + sdn_controller_ip + '\n' + openrc_file.write(sdn_ctl_ip) + openrc_file.close() + + def _config_external_network(ext_name, physnet): body = { 'network': { @@ -115,6 +126,7 @@ def main(): _create_external_network(args.network_file) _create_flavor_m1_micro() _create_image_TestVM() + _config_kolla_admin_openrc('/etc/kolla/') if __name__ == '__main__': |