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)
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)
# You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from modules.conf import CONF from modules.keystone import Keystone from common import util keystone = Keystone.get() config_file = "/etc/keystone/keystone.conf" keystone.install() keystone.config_debug(config_file) keystone.config_database(config_file) keystone.config_admin_token(config_file) util.run_command("systemctl restart update-triggers.target") keystone.sync_database() keystone.start_server() keystone.create_service() keystone.create_endpoint() keystone.create_project("admin", "Admin Project") keystone.create_role("admin")