def enable_openstack_repository(): common.log('Updating and Upgrading Operating System') common.run_command("apt-get -y update", True) common.run_command( "apt-get install -y python-setuptools python-iniparse python-psutil python-software-properties" ) common.run_command("apt-get install -y ubuntu-cloud-keyring", True) common.delete_file("/etc/apt/sources.list.d/cloudarchive-kilo.list") common.run_command( "echo 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/kilo main' >> /etc/apt/sources.list.d/cloudarchive-kilo.list" ) common.run_command("apt-get -y update", True) common.run_command("apt-get -y dist-upgrade", True)
import os import sys sys.path.append(os.path.dirname(__file__)) from utils import common_tools as common from utils import kilo_services as kilo #Checking the script is run as the root user if not os.getuid() == 0: sys.exit('This script must be run as root') print '#######################################################################' print '# OpenStack Kilo Network Node Installation' print '#######################################################################' common.log('Starting installation') print '' #Configuring Kernel Networking Parameters common.set_sysctl('net.ipv4.ip_forward', '1') common.set_sysctl('net.ipv4.conf.all.rp_filter', '0') common.set_sysctl('net.ipv4.conf.default.rp_filter', '0') #Installing vlan and bridge-utils kilo.install_vlan() kilo.install_bridgeutils() #OpenStack Kilo Configuration File kilo_conf = os.path.join(os.path.dirname(__file__), 'kilo.conf') network_mgmt_ntw_interface = common.get_file_option(kilo_conf, 'network', 'management_network_interface')
import os import sys sys.path.append(os.path.dirname(__file__)) from utils import common_tools as common from utils import kilo_services as kilo #Checking the script is run as the root user if not os.getuid() == 0: sys.exit('This script must be run as root') print '#######################################################################' print '# OpenStack Kilo Block Storage Node Installation' print '#######################################################################' common.log('Starting installation') print '' #OpenStack Kilo Configuration File kilo_conf = os.path.join(os.path.dirname(__file__), 'kilo.conf') controller_server_name = common.get_file_option(kilo_conf, 'controller', 'controller_server_name') cinder_db_password = common.get_file_option(kilo_conf, 'cinder', 'cinder_db_password') cinder_usr_password = common.get_file_option(kilo_conf, 'cinder', 'cinder_usr_password') openstack_rabbitmq_password = common.get_file_option(kilo_conf, 'rabbitmq', 'openstack_rabbitmq_password') bs_mgmt_ntw_interface = common.get_file_option(kilo_conf, 'block_storage', 'management_network_interface') bs_mgmt_ntw_interface_addr = common.get_network_address(bs_mgmt_ntw_interface)
import os import sys sys.path.append(os.path.dirname(__file__)) from utils import common_tools as common from utils import kilo_services as kilo #Checking the script is run as the root user if not os.getuid() == 0: sys.exit('This script must be run as root') print '#######################################################################' print '# OpenStack Kilo Controller Node Installation' print '#######################################################################' common.log('Starting installation') print '' #OpenStack Kilo Configuration File kilo_conf = os.path.join(os.path.dirname(__file__), 'kilo.conf') #Getting and updating Controller Node's Interface connected to Management Network/VLAN ctrl_mgmt_ntw_interface = common.get_file_option( kilo_conf, 'controller', 'management_network_interface') ctrl_mgmt_ntw_interface_addr = common.get_network_address( ctrl_mgmt_ntw_interface) common.set_file_option(kilo_conf, 'controller', 'management_network_ip', ctrl_mgmt_ntw_interface_addr) print '' common.log('Using network addresses:')