Exemplo n.º 1
0
 def config_lbaas(self):
     self.add_service_plugin('lbaas')
     config = ("[DEFAULT]\n"
               "interface_driver = "
               "neutron.agent.linux.interface.BridgeInterfaceDriver\n")
     util.write_config("/etc/neutron/lbaas_agent.ini", config)
     self._services += ['neutron-lbaas-agent']
Exemplo n.º 2
0
 def ceilometer_enable(self, configfile):
     LOG.debug("setting up rabbitmq configuration"
               " in '{0}'".format(configfile))
     self.config_rabbitmq(configfile)
     config = ("[DEFAULT]\n"
               "notification_driver = messagingv2\n")
     util.write_config(configfile, config)
Exemplo n.º 3
0
 def config_database(self, configfile):
     dbpass = CONF['CONFIG_%s_DB_PW' % self._name.upper()]
     dbhost = CONF['CONFIG_MONGODB_HOST']
     config = ("[database]\n"
               "connection=mongodb://{0}:{1}@{2}:27017/{0}"
               .format(self._name, dbpass, dbhost))
     util.write_config(configfile, config)
Exemplo n.º 4
0
 def config_neutron_on_nova(self, configfile):
     keystone = Keystone.get()
     config = \
         "[DEFAULT]\n" + \
         "network_api_class = nova.network.neutronv2.api.API\n" + \
         "security_group_api = neutron\n" + \
         "linuxnet_interface_driver = " + \
         "nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver\n" + \
         "firewall_driver = nova.virt.firewall.NoopFirewallDriver\n" + \
         "[neutron]\n" + \
         "url = %s\n" % self._public_url + \
         "auth_url = %s\n" % keystone._admin_url + \
         "auth_plugin = password\n" + \
         "project_domain_id = default\n" + \
         "user_domain_id = default\n" + \
         "region_name = %s\n" % self._region + \
         "project_name = service\n" + \
         "username = neutron\n" + \
         "password = %s\n" % self._password + \
         "service_metadata_proxy = True\n" + \
         "metadata_proxy_shared_secret = %s\n" % metadata_password
     util.write_config(configfile, config)
     if CONF['CONFIG_HTTP_SERVICE'] == 'nginx':
         nova_api_services = ['*****@*****.**',
                              '*****@*****.**']
     elif CONF['CONFIG_HTTP_SERVICE'] == 'apache2':
         nova_api_services = ['httpd']
     else:
         nova_api_services = ['nova-api']
     self.start_server(nova_api_services)
Exemplo n.º 5
0
 def config_dhcp_agent(self, configfile):
     config = ("[DEFAULT]\n"
               "interface_driver = "
               "neutron.agent.linux.interface.BridgeInterfaceDriver\n"
               "dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq\n"
               "enable_isolated_metadata = True\n")
     util.write_config(configfile, config)
Exemplo n.º 6
0
 def add_service_plugin(self, plugin):
     plugins = util.get_option('/etc/neutron/neutron.conf',
                               'DEFAULT', 'service_plugins').split(',')
     if plugin not in plugins:
         plugins.append(plugin)
     config = ('[DEFAULT]\n'
               "service_plugins = %s\n" % ','.join(plugins))
     util.write_config("/etc/neutron/neutron.conf", config)
Exemplo n.º 7
0
 def config_vpnaas(self):
     self.add_service_plugin('vpnaas')
     driver = ("neutron_vpnaas.services.vpn.device_drivers.libreswan_ipsec"
               ".LibreSwanDriver")
     config = "[vpnagent]\n" + \
              "vpn_device_driver = %s\n" % driver
     util.write_config("/etc/neutron/vpnaas_agent.ini", config)
     self._services += ['ipsec', 'neutron-vpn-agent']
Exemplo n.º 8
0
 def config_service_credentials(self, configfile):
     keystone = Keystone.get()
     config = \
         "[service_credentials]\n" + \
         "os_auth_url = %s\n" % keystone._admin_url + \
         "os_username = %s\n" % self._name + \
         "os_tenant_name = service\n" + \
         "os_password = %s\n" % self._password + \
         "os_endpoint_type = internalURL\n" + \
         "os_region_name = %s\n" % self._region
     util.write_config(configfile, config)
Exemplo n.º 9
0
 def config_domain(self, configfile):
     config = ("[DEFAULT]\n"
               "heat_metadata_server_url = http://{0}:8000\n"
               "heat_waitcondition_server_url = "
               "http://{0}:8000/v1/waitcondition\n"
               "stack_domain_admin = {1}\n"
               "stack_domain_admin_password = {2}\n"
               "stack_user_domain_name = {3}\n"
               .format(self._controller, self.domain_admin,
                       self.domain_admin_pw, self.domain_name))
     util.write_config(configfile, config)
Exemplo n.º 10
0
 def configure(self):
     config_file = "/etc/mariadb/openstack.cnf"
     config = """
     [mysqld]
     default-storage-engine = innodb
     innodb_file_per_table
     collation-server = utf8_general_ci
     init-connect = 'SET NAMES utf8'
     character-set-server = utf8
     bind-address = 0.0.0.0
     """
     util.write_config(config_file, config)
Exemplo n.º 11
0
 def config_auth(self, configfile, section='keystone_authtoken'):
     config = ("[{0}]\n"
               "auth_uri=http://{1}:5000\n"
               "auth_url=http://{1}:35357\n"
               "auth_plugin=password\n"
               "project_domain_id=default\n"
               "user_domain_id=default\n"
               "project_name=service\n"
               "username={2}\n"
               "password={3}"
               .format(section, self._controller, self._name,
                       self._password))
     util.write_config(configfile, config)
Exemplo n.º 12
0
 def config_rabbitmq(self, configfile):
     rabbit_host = CONF['CONFIG_AMQP_HOST']
     rabbit_password = CONF['CONFIG_AMQP_AUTH_PASSWORD']
     rabbit_user = CONF['CONFIG_AMQP_AUTH_USER']
     config = \
         "[DEFAULT]\n" + \
         "rpc_backend=rabbit\n" + \
         "[oslo_messaging_rabbit]\n" + \
         "rabbit_host=%s\n" % rabbit_host + \
         "rabbit_userid=%s\n" % rabbit_user + \
         "rabbit_password=%s\n" % rabbit_password + \
         "send_single_reply=True"
     util.write_config(configfile, config)
Exemplo n.º 13
0
 def config_metadata_agent(self, configfile):
     config = \
         "[DEFAULT]\n" + \
         "auth_uri = http://%s:5000\n" % self._controller + \
         "auth_url = http://%s:35357\n" % self._controller + \
         "auth_region = %s\n" % self._region + \
         "auth_plugin = password\n" + \
         "project_domain_id = default\n" + \
         "user_domain_id = default\n" + \
         "project_name = service\n" + \
         "username = %s\n" % self._name + \
         "password = %s\n" % self._password + \
         "nova_metadata_ip = %s\n" % self._controller + \
         "metadata_proxy_shared_secret = %s\n" % metadata_password
     util.write_config(configfile, config)
Exemplo n.º 14
0
 def config_linux_bridge_agent(self, local_ip, local_nic):
     config = \
         "[linux_bridge]\n" + \
         "physical_interface_mappings = public:%s\n" % local_nic + \
         "[vxlan]\n" + \
         "enable_vxlan = True\n" + \
         "local_ip = %s\n" % local_ip + \
         "l2_population = True\n" + \
         "[agent]\n" + \
         "prevent_arp_spoofing = True\n" + \
         "[securitygroup]\n" + \
         "enable_security_group = True\n" + \
         "firewall_driver = neutron.agent.linux.iptables_firewall." + \
         "IptablesFirewallDriver\n"
     util.write_config("/etc/neutron/plugins/ml2/linuxbridge_agent.ini",
                       config)
Exemplo n.º 15
0
    def ceilometer_enable(self, configfile):
        ceilometer = Ceilometer.get()
        ceilometer_cfg = "/etc/ceilometer/ceilometer.conf"

        ceilometer.install()
        ceilometer.config_rabbitmq(ceilometer_cfg)
        ceilometer.config_auth(ceilometer_cfg)
        ceilometer.config_service_credentials(ceilometer_cfg)

        config = ("[DEFAULT]\n"
                  "instance_usage_audit = True\n"
                  "instance_usage_audit_period = hour\n"
                  "notify_on_state_change = vm_and_task_state\n"
                  "notification_driver = messagingv2\n")
        util.write_config(configfile, config)
        self.start_server(['ceilometer-agent-compute.service'])
Exemplo n.º 16
0
 def config_storage_services(self):
     confdir = '/etc/swift/'
     shutil.copy('/usr/share/defaults/swift/account-server.conf', confdir)
     shutil.copy('/usr/share/defaults/swift/container-server.conf', confdir)
     shutil.copy('/usr/share/defaults/swift/object-server.conf', confdir)
     shutil.copy('/usr/share/defaults/swift/container-reconciler.conf',
                 confdir)
     shutil.copy('/usr/share/defaults/swift/object-expirer.conf', confdir)
     for type in ['account', 'container', 'object']:
         conf = ("[DEFAULT]\n"
                 "bind_ip = 0.0.0.0\n"
                 "devices = /srv/node\n"
                 "[pipeline:main]\n"
                 "pipeline = healthcheck recon {0}-server\n"
                 "[filter:recon]\n"
                 "recon_cache_path = /var/cache/swift\n").format(type)
         util.write_config('/etc/swift/%s-server.conf' % type, conf)
Exemplo n.º 17
0
 def config_nova(self, configfile):
     nova = Nova.get()
     config = ("[DEFAULT]\n"
               "notify_nova_on_port_status_changes = True\n"
               "notify_nova_on_port_data_changes = True\n"
               "nova_url = http://{0}:8774/v2\n"
               "[nova]\n"
               "auth_url = http://{0}:35357\n"
               "auth_plugin = password\n"
               "project_domain_id = default\n"
               "user_domain_id = default\n"
               "region_name = {1}\n"
               "project_name = service\n"
               "username = nova\n"
               "password = {2}\n"
               .format(self._controller, self._region, nova._password))
     util.write_config(configfile, config)
Exemplo n.º 18
0
 def config_ml2_plugin(self):
     config = \
         "[DEFAULT]\n" + \
         "core_plugin = ml2\n" \
         "service_plugins = router\n" + \
         "allow_overlapping_ips = True\n"
     util.write_config("/etc/neutron/neutron.conf", config)
     config = \
         "[ml2]\n" + \
         "type_drivers = %s\n" % type_drivers + \
         "tenant_network_types = %s\n" % tenant_network_types + \
         "mechanism_drivers = %s\n" % mechanism_drivers + \
         "extension_drivers = port_security\n" + \
         "[ml2_type_flat]\n" + \
         "flat_networks = public\n" + \
         "[ml2_type_vxlan]\n" + \
         "vni_ranges = %s\n" % vni_ranges + \
         "[securitygroup]\n" + \
         "enable_ipset = True\n"
     util.write_config("/etc/neutron/plugins/ml2/ml2_conf.ini", config)
     util.link_file('/etc/neutron/plugins/ml2/ml2_conf.ini',
                    '/etc/neutron/plugin.ini')
Exemplo n.º 19
0
 def config_auth(self, configfile):
     confdir = os.path.dirname(configfile)
     if not os.path.isdir(confdir):
         os.makedirs(confdir)
     shutil.copy('/usr/share/defaults/swift/proxy-server.conf', confdir)
     OpenStackService.config_auth(self, configfile,
                                  section='filter:authtoken')
     config = ("[pipeline:main]\n"
               "pipeline = catch_errors gatekeeper healthcheck "
               "proxy-logging cache container_sync bulk ratelimit "
               "authtoken keystoneauth container-quotas account-quotas "
               "slo dlo versioned_writes proxy-logging proxy-server\n"
               "[filter:authtoken]\n"
               "paste.filter_factory = "
               "keystonemiddleware.auth_token:filter_factory\n"
               "delay_auth_decision = True\n"
               "[app:proxy-server]\n"
               "use = egg:swift#proxy\n"
               "account_autocreate = True\n"
               "[filter:keystoneauth]\n"
               "use = egg:swift#keystoneauth\n"
               "operator_roles = admin,user\n")
     util.write_config(configfile, config)
Exemplo n.º 20
0
 def config_memcache(self, configfile):
     config = ("[filter:cache]\n"
               "use = egg:swift#memcache\n"
               "memcache_servers = 127.0.0.1:11211")
     util.write_config(configfile, config)
Exemplo n.º 21
0
 def config_hash(self, configfile):
     suffix = CONF['CONFIG_SWIFT_HASH']
     config = ("[swift-hash]\n"
               "swift_hash_path_suffix = {0}").format(suffix)
     util.write_config(configfile, config)
Exemplo n.º 22
0
 def config_debug(self, configfile):
     if util.str2bool(CONF['CONFIG_DEBUG_MODE']):
         config = "[DEFAULT]\n" + \
                  "debug=True\n" + \
                  "verbose=True\n"
         util.write_config(configfile, config)
Exemplo n.º 23
0
 def config_l3_agent(self, configfile):
     config = ("[DEFAULT]\n"
               "interface_driver = "
               "neutron.agent.linux.interface.BridgeInterfaceDriver\n"
               "external_network_bridge = \n")
     util.write_config(configfile, config)
Exemplo n.º 24
0
nova.create_endpoint()

# Configure nova controller
nova.config_debug(config_file)
nova.config_database(config_file)
nova.config_rabbitmq(config_file)
nova.config_auth(config_file)

# Setup vncproxy
config = \
    "[DEFAULT]\n" + \
    "my_ip=%s\n" % my_ip + \
    "[vnc]\n" + \
    "vncserver_listen=0.0.0.0\n" + \
    "vncserver_proxyclient_address=%s\n" % my_ip
util.write_config(config_file, config)

# Setup glance host
config = \
    "[glance]\n" + \
    "host=%s\n" % CONF['CONFIG_CONTROLLER_HOST']
util.write_config(config_file, config)

if CONF['CONFIG_HTTP_SERVICE'] == 'nginx':
    util.link_file('/usr/share/nginx/conf.d/nova-api.template',
                   '/etc/nginx/nova-api.conf')
else:
    util.link_file('/usr/share/defaults/httpd/conf.d/nova-api.template',
                   '/etc/httpd/conf.d/nova-api.conf')

util.run_command("systemctl restart update-triggers.target")
Exemplo n.º 25
0
 def config_admin_token(self, configfile):
     config = \
         "[DEFAULT]\n" + \
         "admin_token=%s\n" % CONF['CONFIG_KEYSTONE_ADMIN_TOKEN']
     util.write_config(configfile, config)
Exemplo n.º 26
0
 def ceilometer_enable(self, configfile):
     self.config_rabbitmq(configfile)
     config = ("[DEFAULT]\n"
               "notification_driver = messagingv2\n")
     util.write_config(configfile, config)