Ansible預設會依序讀取以下路徑的配置檔
ANSIBLE_CONFIG
(environment variable if set)ansible.cfg
(in the current directory)~/.ansible.cfg
(in the home directory)/etc/ansible/ansible.cfg
ANSIBLE_CONFIG
(environment variable if set)ansible.cfg
(in the current directory)~/.ansible.cfg
(in the home directory)/etc/ansible/ansible.cfg
nova-manage db sync nova-manage api_db sync nova-manage db online_data_migrations nova-manage cell_v2 map_cell0 # 建立cell0環境資訊 nova-manage cell_v2 create_cell # 建立cell mapping nova-manage cell_v2 discover_hosts # discover compute node
def _map_cell0(self, database_connection=None): """Faciliate creation of a cell mapping for cell0. See map_cell0 for more. """ def cell0_default_connection(): # If no database connection is provided one is generated # based on the database connection url. # The cell0 database will use the same database scheme and # netloc as the main database, with a related path. # NOTE(sbauza): The URL has to be RFC1738 compliant in order to # be usable by sqlalchemy. connection = CONF.database.connection # sqlalchemy has a nice utility for parsing database connection # URLs so we use that here to get the db name so we don't have to # worry about parsing and splitting a URL which could have special # characters in the password, which makes parsing a nightmare. url = sqla_url.make_url(connection) url.database = url.database + '_cell0' return urlparse.unquote(str(url)) dbc = database_connection or cell0_default_connection() ctxt = context.RequestContext() # A transport url of 'none://' is provided for cell0. RPC should not # be used to access cell0 objects. Cells transport switching will # ignore any 'none' transport type. cell_mapping = objects.CellMapping( ctxt, uuid=objects.CellMapping.CELL0_UUID, name="cell0", transport_url="none:///", database_connection=dbc) cell_mapping.create() return cell_mapping