From 138f0454119c22eb370c7bd44aef172c81656c3d Mon Sep 17 00:00:00 2001 From: Carl Li Date: Thu, 15 Oct 2015 20:03:30 -0700 Subject: [PATCH] Seperate chef installer as a plugin Bug: 1506700 This is the first change list of a series of changes that will eventually convert chef installer as a plugin. It moves chef installer related configure files to the plugins/chef_installer/ util.py's load_configs is modified to read not only the ordinary configs but also the configs in each of plugins directory. Change-Id: I285c59556f4abd89255608e15117e6d012ecfb01 --- compass/utils/util.py | 36 +++- plugins/chef_installer/adapter/chef_ceph.conf | 7 + .../adapter/chef_ceph_openstack.conf | 7 + .../adapter/chef_fusionsphere.conf | 8 + .../adapter/chef_openstack.conf | 8 + .../chef_installer/flavor/ceph_firefly.conf | 9 + .../flavor/chef_ceph_openstack.conf | 22 +++ .../flavor/fusionsphere_chef.conf | 25 +++ .../chef_installer/flavor/openstack_chef.conf | 35 ++++ .../flavor_mapping/ceph_firefly.conf | 49 +++++ .../ceph_openstack_multinodes.conf | 175 ++++++++++++++++++ .../ceph_openstack_single_controller.conf | 175 ++++++++++++++++++ .../flavor_metadata/ceph_firefly.conf | 3 + .../ceph_openstack_multinodes.conf | 3 + .../ceph_openstack_single_controller.conf | 3 + .../chef_installer/package_metadata/ceph.conf | 84 +++++++++ .../package_metadata/ceph_openstack.conf | 99 ++++++++++ plugins/chef_installer/role/ceph.conf | 21 +++ .../role/chef_ceph_openstack.conf | 81 ++++++++ .../role/fusionsphere_chef.conf | 69 +++++++ .../chef_installer/role/openstack_chef.conf | 67 +++++++ 21 files changed, 979 insertions(+), 7 deletions(-) create mode 100755 plugins/chef_installer/adapter/chef_ceph.conf create mode 100755 plugins/chef_installer/adapter/chef_ceph_openstack.conf create mode 100755 plugins/chef_installer/adapter/chef_fusionsphere.conf create mode 100755 plugins/chef_installer/adapter/chef_openstack.conf create mode 100755 plugins/chef_installer/flavor/ceph_firefly.conf create mode 100755 plugins/chef_installer/flavor/chef_ceph_openstack.conf create mode 100755 plugins/chef_installer/flavor/fusionsphere_chef.conf create mode 100755 plugins/chef_installer/flavor/openstack_chef.conf create mode 100755 plugins/chef_installer/flavor_mapping/ceph_firefly.conf create mode 100755 plugins/chef_installer/flavor_mapping/ceph_openstack_multinodes.conf create mode 100755 plugins/chef_installer/flavor_mapping/ceph_openstack_single_controller.conf create mode 100755 plugins/chef_installer/flavor_metadata/ceph_firefly.conf create mode 100755 plugins/chef_installer/flavor_metadata/ceph_openstack_multinodes.conf create mode 100755 plugins/chef_installer/flavor_metadata/ceph_openstack_single_controller.conf create mode 100755 plugins/chef_installer/package_metadata/ceph.conf create mode 100755 plugins/chef_installer/package_metadata/ceph_openstack.conf create mode 100755 plugins/chef_installer/role/ceph.conf create mode 100755 plugins/chef_installer/role/chef_ceph_openstack.conf create mode 100755 plugins/chef_installer/role/fusionsphere_chef.conf create mode 100755 plugins/chef_installer/role/openstack_chef.conf diff --git a/compass/utils/util.py b/compass/utils/util.py index bacfac15..d61243e1 100644 --- a/compass/utils/util.py +++ b/compass/utils/util.py @@ -217,15 +217,37 @@ def load_configs( env_globals={}, env_locals={} ): """Load configurations from config dir.""" + """The config file could be in the config_dir or in plugins config_dir""" + """The plugins config_dir is formed as, for example /etc/compass/adapter""" + """Then the plugins config_dir is /etc/compass/plugins/xxx/adapter""" + configs = [] + config_files = [] config_dir = str(config_dir) - if not os.path.exists(config_dir): - logging.error('path %s does not exist', config_dir) - return configs - for component in os.listdir(config_dir): - if not component.endswith(config_name_suffix): - continue - path = os.path.join(config_dir, component) + + """search for config_dir""" + if os.path.exists(config_dir): + for component in os.listdir(config_dir): + if not component.endswith(config_name_suffix): + continue + config_files.append(os.path.join(config_dir, component)) + + """search for plugins config_dir""" + index = config_dir.rfind("/") + plugins_path = os.path.join(config_dir[0:index], "plugins") + if os.path.exists(plugins_path): + for plugin in os.listdir(plugins_path): + plugin_path = os.path.join(plugins_path, plugin) + plugin_config = os.path.join(plugin_path, config_dir[index + 1:]) + if os.path.exists(plugin_config): + for component in os.listdir(plugin_config): + if not component.endswith(config_name_suffix): + continue + config_files.append(os.path.join(plugin_config, component)) + + if not config_files: + logging.error('path %s and plugins does not exist', config_dir) + for path in config_files: logging.debug('load config from %s', path) config_globals = {} config_globals.update(env_globals) diff --git a/plugins/chef_installer/adapter/chef_ceph.conf b/plugins/chef_installer/adapter/chef_ceph.conf new file mode 100755 index 00000000..330de321 --- /dev/null +++ b/plugins/chef_installer/adapter/chef_ceph.conf @@ -0,0 +1,7 @@ +NAME = 'ceph_firefly' +DISPLAY_NAME = 'Ceph Firefly' +PARENT = 'ceph' +PACKAGE_INSTALLER = 'chef_installer' +OS_INSTALLER = 'cobbler' +SUPPORTED_OS_PATTERNS = ['(?i)centos-6\.5.*', '(?i)ubuntu-12\.04.*'] +DEPLOYABLE = True diff --git a/plugins/chef_installer/adapter/chef_ceph_openstack.conf b/plugins/chef_installer/adapter/chef_ceph_openstack.conf new file mode 100755 index 00000000..7bccfaaa --- /dev/null +++ b/plugins/chef_installer/adapter/chef_ceph_openstack.conf @@ -0,0 +1,7 @@ +NAME = 'ceph_openstack_icehouse' +DISPLAY_NAME = 'Ceph + OpenStack Icehouse' +PARENT = 'openstack' +PACKAGE_INSTALLER = 'chef_installer' +OS_INSTALLER = 'cobbler' +SUPPORTED_OS_PATTERNS = ['(?i)centos-6\.5.*', '(?i)ubuntu-12\.04.*'] +DEPLOYABLE = True diff --git a/plugins/chef_installer/adapter/chef_fusionsphere.conf b/plugins/chef_installer/adapter/chef_fusionsphere.conf new file mode 100755 index 00000000..ff18621b --- /dev/null +++ b/plugins/chef_installer/adapter/chef_fusionsphere.conf @@ -0,0 +1,8 @@ +NAME = 'fusionsphere_icehouse' +DISPLAY_NAME = 'FusionSphere Icehouse' +PARENT = 'openstack' +PACKAGE_INSTALLER = 'chef_installer' +OS_INSTALLER = 'cobbler' +SUPPORTED_OS_PATTERNS = ['(?i)uvp.*'] +DEPLOYABLE = True +HEALTH_CHECK_COMMAND = 'python /opt/compass/health_check.py' diff --git a/plugins/chef_installer/adapter/chef_openstack.conf b/plugins/chef_installer/adapter/chef_openstack.conf new file mode 100755 index 00000000..37e6a1a2 --- /dev/null +++ b/plugins/chef_installer/adapter/chef_openstack.conf @@ -0,0 +1,8 @@ +NAME = 'openstack_icehouse' +DISPLAY_NAME = 'OpenStack Icehouse' +PARENT = 'openstack' +PACKAGE_INSTALLER = 'chef_installer' +OS_INSTALLER = 'cobbler' +SUPPORTED_OS_PATTERNS = ['(?i)centos.*', '(?i)ubuntu.*', '(?i)sles.*'] +DEPLOYABLE = True +HEALTH_CHECK_COMMAND = 'docker run -i -d $cluster_name python /opt/compass/rally/check_health.py' diff --git a/plugins/chef_installer/flavor/ceph_firefly.conf b/plugins/chef_installer/flavor/ceph_firefly.conf new file mode 100755 index 00000000..0f52905c --- /dev/null +++ b/plugins/chef_installer/flavor/ceph_firefly.conf @@ -0,0 +1,9 @@ +ADAPTER_NAME = 'ceph_firefly' +FLAVORS = [ + { + 'flavor': 'ceph_firefly', + 'display_name': 'Ceph Cluster (Firefly)', + 'template': 'base.tmpl', + 'roles': ['ceph-mon', 'ceph-osd', 'ceph-mds', 'ceph-radosgw'] + } +] diff --git a/plugins/chef_installer/flavor/chef_ceph_openstack.conf b/plugins/chef_installer/flavor/chef_ceph_openstack.conf new file mode 100755 index 00000000..d1661352 --- /dev/null +++ b/plugins/chef_installer/flavor/chef_ceph_openstack.conf @@ -0,0 +1,22 @@ +ADAPTER_NAME = 'ceph_openstack_icehouse' +FLAVORS = [ +{ + 'flavor': 'ceph_openstack_multinodes', + 'display_name': 'Multi-node Ceph+OpenStack Cluster', + 'template': 'base.tmpl', + 'roles': [ + 'os-ops-database', 'os-ops-messaging', 'os-identity', 'os-compute-controller', + 'ceph-os-mon', 'ceph-osd', 'ceph-mds', 'ceph-os-radosgw', + 'os-ceph-compute-worker', 'os-network-server', + 'os-network-worker', 'os-block-storage-volume', + 'os-ceph-block-storage-controller', 'os-ceph-image', 'os-dashboard' + ] +}, { + 'flavor': 'ceph_openstack_single_controller', + 'display_name': 'Single controller Ceph+OpenStack Cluster', + 'template': 'base.tmpl', + 'roles': [ + 'os-ceph-controller', 'ceph-os-mon', 'ceph-osd', 'ceph-mds', 'ceph-os-radosgw', + 'os-ceph-compute-worker', 'os-network-worker' + ] +}] diff --git a/plugins/chef_installer/flavor/fusionsphere_chef.conf b/plugins/chef_installer/flavor/fusionsphere_chef.conf new file mode 100755 index 00000000..d5a52b00 --- /dev/null +++ b/plugins/chef_installer/flavor/fusionsphere_chef.conf @@ -0,0 +1,25 @@ +ADAPTER_NAME = 'fusionsphere_icehouse' +FLAVORS = [{ + 'flavor': 'allinone', + 'display_name': 'All-In-One', + 'template': 'fusionsphere.tmpl', + 'roles': ['allinone-compute'] +}, { + 'flavor': 'single-contoller-multi-compute', + 'display_name': 'Single Controller, Multi-compute', + 'template': 'fusionsphere.tmpl', + 'roles': [ + 'os-controller', 'os-compute-worker', 'os-network', + 'os-block-storage-volume' + ] +}, { + 'flavor': 'multinodes', + 'display_name': 'Multi-node Cluster', + 'template': 'fusionsphere.tmpl', + 'roles': [ + 'os-ops-database', 'os-identity', 'os-ops-messaging', + 'os-compute-controller', 'os-compute-worker', 'os-network-worker', + 'os-network-server', 'os-block-storage-controller', 'os-block-storage-volume', + 'os-image', 'os-dashboard' + ] +}] diff --git a/plugins/chef_installer/flavor/openstack_chef.conf b/plugins/chef_installer/flavor/openstack_chef.conf new file mode 100755 index 00000000..fb36f847 --- /dev/null +++ b/plugins/chef_installer/flavor/openstack_chef.conf @@ -0,0 +1,35 @@ +ADAPTER_NAME = 'openstack_icehouse' +FLAVORS = [{ + 'flavor': 'allinone', + 'display_name': 'All-In-One', + 'template': 'base.tmpl', + 'roles': ['allinone-compute'] +}, { + 'flavor': 'single-contoller-multi-compute', + 'display_name': 'Single Controller, Multi-compute', + 'template': 'base.tmpl', + 'roles': [ + 'os-controller', 'os-compute-worker', 'os-network', + 'os-block-storage-volume' + ] +}, { + 'flavor': 'multinodes', + 'display_name': 'Multi-node Cluster', + 'template': 'base.tmpl', + 'roles': [ + 'os-ops-database', 'os-identity', 'os-ops-messaging', + 'os-compute-controller', 'os-compute-worker', 'os-network-worker', + 'os-network-server', 'os-block-storage-controller', 'os-block-storage-volume', + 'os-image', 'os-dashboard' + ] +}, { + 'flavor': 'HA-multinodes', + 'display_name': 'Multi-node Cluster with HA', + 'template': 'ha_multinodes.tmpl', + 'roles': [ + 'os-ops-database', 'os-identity', 'os-ops-messaging', 'os-ha', + 'os-compute-controller', 'os-compute-worker', 'os-network-worker', + 'os-network-server', 'os-block-storage-controller', 'os-block-storage-volume', + 'os-image', 'os-dashboard' + ] +}] diff --git a/plugins/chef_installer/flavor_mapping/ceph_firefly.conf b/plugins/chef_installer/flavor_mapping/ceph_firefly.conf new file mode 100755 index 00000000..17e7c465 --- /dev/null +++ b/plugins/chef_installer/flavor_mapping/ceph_firefly.conf @@ -0,0 +1,49 @@ +ADAPTER = 'ceph_firefly' +FLAVOR = 'ceph_firefly' +CONFIG_MAPPING = { + "mapped_name": "flavor_config", + "mapped_children": [{ + "ceph_config": { + "accordion_heading": "Ceph Global Configurations", + "category": "ceph_config", + "data_structure": "form", + "form_name": "cephForm", + "data": { + "global_config": { + "osd_pool_pgp_num": { + "label": "OSD Pool PGP Number", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + }, + "osd_pool_size": { + "label": "OSD Pool Size", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + }, + "osd_pool_pg_num": { + "label": "OSD Pool PG Number", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + } + }, + "osd_config": { + "journal_size": { + "label": "Journal Size", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + }, + "op_threads": { + "label": "OP Threads", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + } + } + } + } + }] +} diff --git a/plugins/chef_installer/flavor_mapping/ceph_openstack_multinodes.conf b/plugins/chef_installer/flavor_mapping/ceph_openstack_multinodes.conf new file mode 100755 index 00000000..2a9b0fe1 --- /dev/null +++ b/plugins/chef_installer/flavor_mapping/ceph_openstack_multinodes.conf @@ -0,0 +1,175 @@ +ADAPTER = 'ceph_openstack_icehouse' +FLAVOR = 'ceph-openstack-multinodes' +CONFIG_MAPPING = { + "mapped_name": "flavor_config", + "mapped_children": [{ + "security": { + "accordion_heading": "OpenStack Database and Queue Credentials", + "category": "service_credentials", + "data_structure": "table", + "action": "true", + "modifiable_data": ["username", "password"], + "table_display_header": ["Service", "UserName", "Password", "Action"], + "config": { + "rabbitmq": { + "username": "guest", + "password": "guest" + }, + "compute": { + "username": "nova", + "password": "nova" + }, + "dashboard": { + "username": "dashboard", + "password": "dashboard" + }, + "identity": { + "username": "keystone", + "password": "keystone" + }, + "image": { + "username": "glance", + "password": "glance" + }, + "metering": { + "username": "ceilometer", + "password": "ceilometer" + }, + "mysql": { + "username": "root", + "password": "root" + }, + "volume": { + "username": "cinder", + "password": "cinder" + } + } + } + },{ + "security": { + "accordion_heading": "OpenStack Keystone User Credentials", + "category": "console_credentials", + "data_structure": "table", + "action": "true", + "modifiable_data": ["username", "password"], + "table_display_header": ["Service", "UserName", "Password", "Action"], + "config":{ + "admin": { + "username": "admin", + "password": "admin" + }, + "compute": { + "username": "nova", + "password": "nova" + }, + "dashboard": { + "username": "dashboard", + "password": "dashboard" + }, + "image": { + "username": "glance", + "password": "glance" + }, + "metering": { + "username": "ceilometer", + "password": "ceilometer" + }, + "network": { + "username": "quantum", + "password": "quantum" + }, + "object-store": { + "username": "swift", + "password": "swift" + }, + "volume": { + "username": "cinder", + "password": "cinder" + } + } + } + },{ + "ceph_config": { + "accordion_heading": "Ceph Global Configurations", + "category": "ceph_config", + "data_structure": "form", + "form_name": "cephForm", + "data": { + "global_config": { + "osd_pool_pg_num": { + "label": "OSD Pool PG Number", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + }, + "osd_pool_pgp_num": { + "label": "OSD Pool PGP Number", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + }, + "osd_pool_size": { + "label": "OSD Pool Size", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + } + }, + "osd_config": { + "journal_size": { + "label": "Journal Size", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + }, + "op_threads": { + "label": "OP Threads", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + } + } + } + } + },{ + "neutron_config": { + "accordion_heading": "Neutron Configurations", + "data_structure": "form", + "category": "neutron_config", + "form_name": "neutronForm", + "data": { + "openvswitch": { + "tenant_network_type": { + "label": "Tenant Network Type", + "input_type": "dropdown", + "mapped_key": [ + "name", "is_required", "options", "default_value" + ], + "content_data": { + "gre": [{ + "label": "Tunnel ID Ranges", + "is_required": "true", + "display_type": "dropdown_text_multiple", + "name": "tunnel_id_ranges", + "hint": "1:1000", + }], + "vlan": [{ + "label": "Network Vlan Ranges", + "is_required": "true", + "display_type": "dropdown_text_multiple", + "name": "network_vlan_ranges", + "hint": "physnet1:2700:2999" + }, { + "label": "Bridge Mapping", + "is_required": "true", + "display_type": "dropdown_text_multiple", + "name": "bridge_mappings", + "hint": "physnet1:br-eth1" + }] + } + } + } + } + } + }] +} diff --git a/plugins/chef_installer/flavor_mapping/ceph_openstack_single_controller.conf b/plugins/chef_installer/flavor_mapping/ceph_openstack_single_controller.conf new file mode 100755 index 00000000..959224b0 --- /dev/null +++ b/plugins/chef_installer/flavor_mapping/ceph_openstack_single_controller.conf @@ -0,0 +1,175 @@ +ADAPTER = 'ceph_openstack_icehouse' +FLAVOR = 'ceph-openstack-single-controller' +CONFIG_MAPPING = { + "mapped_name": "flavor_config", + "mapped_children": [{ + "security": { + "accordion_heading": "OpenStack Database and Queue Credentials", + "category": "service_credentials", + "data_structure": "table", + "action": "true", + "modifiable_data": ["username", "password"], + "table_display_header": ["Service", "UserName", "Password", "Action"], + "config": { + "rabbitmq": { + "username": "guest", + "password": "guest" + }, + "compute": { + "username": "nova", + "password": "nova" + }, + "dashboard": { + "username": "dashboard", + "password": "dashboard" + }, + "identity": { + "username": "keystone", + "password": "keystone" + }, + "image": { + "username": "glance", + "password": "glance" + }, + "metering": { + "username": "ceilometer", + "password": "ceilometer" + }, + "mysql": { + "username": "root", + "password": "root" + }, + "volume": { + "username": "cinder", + "password": "cinder" + } + } + } + },{ + "security": { + "accordion_heading": "OpenStack Keystone User Credentials", + "category": "console_credentials", + "data_structure": "table", + "action": "true", + "modifiable_data": ["username", "password"], + "table_display_header": ["Service", "UserName", "Password", "Action"], + "config":{ + "admin": { + "username": "admin", + "password": "admin" + }, + "compute": { + "username": "nova", + "password": "nova" + }, + "dashboard": { + "username": "dashboard", + "password": "dashboard" + }, + "image": { + "username": "glance", + "password": "glance" + }, + "metering": { + "username": "ceilometer", + "password": "ceilometer" + }, + "network": { + "username": "quantum", + "password": "quantum" + }, + "object-store": { + "username": "swift", + "password": "swift" + }, + "volume": { + "username": "cinder", + "password": "cinder" + } + } + } + },{ + "ceph_config": { + "accordion_heading": "Ceph Global Configurations", + "category": "ceph_config", + "data_structure": "form", + "form_name": "cephForm", + "data": { + "global_config": { + "osd_pool_pg_num": { + "label": "OSD Pool PG Number", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + }, + "osd_pool_pgp_num": { + "label": "OSD Pool PGP Number", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + }, + "osd_pool_size": { + "label": "OSD Pool Size", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + } + }, + "osd_config": { + "journal_size": { + "label": "Journal Size", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + }, + "op_threads": { + "label": "OP Threads", + "mapped_key": [ + "name", "is_required", "display_type", "default_value" + ] + } + } + } + } + },{ + "neutron_config": { + "accordion_heading": "Neutron Configurations", + "data_structure": "form", + "category": "neutron_config", + "form_name": "neutronForm", + "data": { + "openvswitch": { + "tenant_network_type": { + "label": "Tenant Network Type", + "input_type": "dropdown", + "mapped_key": [ + "name", "is_required", "options", "default_value" + ], + "content_data": { + "gre": [{ + "label": "Tunnel ID Ranges", + "is_required": "true", + "display_type": "dropdown_text_multiple", + "name": "tunnel_id_ranges", + "hint": "1:1000", + }], + "vlan": [{ + "label": "Network Vlan Ranges", + "is_required": "true", + "display_type": "dropdown_text_multiple", + "name": "network_vlan_ranges", + "hint": "physnet1:2700:2999" + }, { + "label": "Bridge Mapping", + "is_required": "true", + "display_type": "dropdown_text_multiple", + "name": "bridge_mappings", + "hint": "physnet1:br-eth1" + }] + } + } + } + } + } + }] +} diff --git a/plugins/chef_installer/flavor_metadata/ceph_firefly.conf b/plugins/chef_installer/flavor_metadata/ceph_firefly.conf new file mode 100755 index 00000000..8755376b --- /dev/null +++ b/plugins/chef_installer/flavor_metadata/ceph_firefly.conf @@ -0,0 +1,3 @@ +ADAPTER = 'ceph_firefly' +FLAVOR = 'ceph_firefly' +METADATA = {} diff --git a/plugins/chef_installer/flavor_metadata/ceph_openstack_multinodes.conf b/plugins/chef_installer/flavor_metadata/ceph_openstack_multinodes.conf new file mode 100755 index 00000000..3c4a4010 --- /dev/null +++ b/plugins/chef_installer/flavor_metadata/ceph_openstack_multinodes.conf @@ -0,0 +1,3 @@ +ADAPTER = 'ceph_openstack_icehouse' +FLAVOR = 'ceph_openstack_multinodes' +METADATA = {} diff --git a/plugins/chef_installer/flavor_metadata/ceph_openstack_single_controller.conf b/plugins/chef_installer/flavor_metadata/ceph_openstack_single_controller.conf new file mode 100755 index 00000000..cbd2664f --- /dev/null +++ b/plugins/chef_installer/flavor_metadata/ceph_openstack_single_controller.conf @@ -0,0 +1,3 @@ +ADAPTER = 'ceph_openstack_icehouse' +FLAVOR = 'ceph_openstack_single_controller' +METADATA = {} diff --git a/plugins/chef_installer/package_metadata/ceph.conf b/plugins/chef_installer/package_metadata/ceph.conf new file mode 100755 index 00000000..6c47c718 --- /dev/null +++ b/plugins/chef_installer/package_metadata/ceph.conf @@ -0,0 +1,84 @@ +ADAPTER = 'ceph' +METADATA = { + 'ceph_config': { + '_self': { + 'required_in_whole_config': True + }, + 'global_config': { + '_self': { + 'required_in_whole_config': True, + 'mapping_to': 'global' + }, + 'osd_pool_pg_num': { + '_self': { + 'is_required': True, + 'field': 'general', + 'default_value': '1024', + 'mapping_to': 'osd_pool_pg_num' + } + }, + 'osd_pool_pgp_num': { + '_self': { + 'is_required': True, + 'field': 'general', + 'default_value': '1024', + 'mapping_to': 'osd_pool_pgp_num' + } + }, + 'osd_pool_size': { + '_self': { + 'is_required': True, + 'field': 'general', + 'default_value': '3', + 'mapping_to': 'osd_pool_size' + } + } + }, + 'osd_config': { + '_self': { + 'mapping_to': 'osd_config' + }, + 'journal_size': { + '_self': { + 'field': 'general', + 'default_value': '10000', + 'mapping_to': 'journal_size' + } + }, + 'op_threads': { + '_self': { + 'field': 'integer', + 'default_value': 10, + 'mapping_to': 'op_threads' + } + } + }, + "osd_devices": { + '_self': { + 'mapping_to': 'osd_devices' + }, + '$device': { + '_self': { + 'validator': is_valid_partition + }, + 'journal': { + '_self': { + 'field': 'general', + 'mapping_to': 'journal' + } + } + } + }, + 'network_mapping': { + '_self': { + 'required_in_whole_config': True + }, + '$interface_type': { + '_self': { + 'is_required': True, + 'field': 'general' + } + } + } + } +} diff --git a/plugins/chef_installer/package_metadata/ceph_openstack.conf b/plugins/chef_installer/package_metadata/ceph_openstack.conf new file mode 100755 index 00000000..b1cd7250 --- /dev/null +++ b/plugins/chef_installer/package_metadata/ceph_openstack.conf @@ -0,0 +1,99 @@ +ADAPTER = 'ceph_openstack_icehouse' +METADATA = { + 'ceph_config': { + '_self': { + 'required_in_whole_config': True + }, + 'global_config': { + '_self': { + 'required_in_whole_config': True, + }, + 'osd_pool_pg_num': { + '_self': { + 'is_required': True, + 'field': 'general', + 'default_value': '1024', + 'mapping_to': 'osd_pool_pg_num' + } + }, + 'osd_pool_pgp_num': { + '_self': { + 'is_required': True, + 'field': 'general', + 'default_value': '1024', + 'mapping_to': 'osd_pool_pgp_num' + } + }, + 'osd_pool_size': { + '_self': { + 'is_required': True, + 'field': 'general', + 'default_value': '3', + 'mapping_to': 'osd_pool_size' + } + } + }, + 'osd_config': { + '_self': { + }, + 'journal_size': { + '_self': { + 'field': 'general', + 'default_value': '10000', + 'mapping_to': 'journal_size' + } + }, + 'op_threads': { + '_self': { + 'field': 'integer', + 'default_value': 10, + 'mapping_to': 'op_threads' + } + } + }, + "osd_devices": { + '_self': { + 'mapping_to': 'osd_devices' + }, + '$device': { + '_self': { + 'validator': is_valid_partition + }, + 'journal': { + '_self': { + 'field': 'general', + 'mapping_to': 'journal' + } + } + } + } + }, + 'network_mapping': { + '_self': { + 'required_in_whole_config': True, + 'key_extensions': { + '$interface_type': ['public_network', 'cluster_network'] + } + }, + '$interface_type': { + '_self': { + 'required_in_whole_config': True, + 'field': 'anytype', + 'autofill_callback': autofill_network_mapping, + 'mapping_to': '$interface_type' + }, + 'interface': { + '_self': { + 'is_required': True, + 'field': 'general', + } + }, + 'subnet': { + '_self': { + 'is_required': False, + 'field': 'general' + } + } + } + } +} diff --git a/plugins/chef_installer/role/ceph.conf b/plugins/chef_installer/role/ceph.conf new file mode 100755 index 00000000..c89cfa47 --- /dev/null +++ b/plugins/chef_installer/role/ceph.conf @@ -0,0 +1,21 @@ +ADAPTER_NAME = 'ceph_firefly' +ROLES = [ +{ + 'role': 'ceph-mon', + 'display_name': 'Ceph Mon', + 'description': 'ceph monitor server' +}, { + 'role': 'ceph-osd', + 'display_name': 'Ceph OSD', + 'description': 'ceph storage server' +}, { + 'role': 'ceph-mds', + 'display_name': 'Ceph MDS', + 'description': 'ceph metadata server', + 'optional': True +}, { + 'role': 'ceph-radosgw', + 'display_name': 'Ceph Radosgw', + 'description': 'ceph object gateway', + 'optional': True +}] diff --git a/plugins/chef_installer/role/chef_ceph_openstack.conf b/plugins/chef_installer/role/chef_ceph_openstack.conf new file mode 100755 index 00000000..1b3da0e0 --- /dev/null +++ b/plugins/chef_installer/role/chef_ceph_openstack.conf @@ -0,0 +1,81 @@ +ADAPTER_NAME = 'ceph_openstack_icehouse' +ROLES = [{ + 'role': 'os-ceph-compute-worker', + 'display_name': 'compute node', + 'description': 'compute node' +}, { + 'role': 'os-network', + 'display_name': 'network node', + 'description': 'network node including network server' +}, { + 'role': 'os-network-server', + 'display_name': 'network server node', + 'description': 'network server node' +}, { + 'role': 'os-network-worker', + 'display_name': 'network node', + 'description': 'network node including network server' +}, { + 'role': 'os-ceph-block-storage-controller', + 'display_name': 'storage controller node', + 'description': 'storage controller node' +}, { + 'role': 'os-block-storage-volume', + 'display_name': 'storage node', + 'description': 'storage node' +}, { + 'role': 'os-ceph-image', + 'display_name': 'image node', + 'description': 'image node' +}, { + 'role': 'os-compute-vncproxy', + 'display_name': 'vnc proxy node', + 'description': 'vnc proxy node' +}, { + 'role': 'os-compute-controller', + 'display_name': 'controller-only node', + 'description': 'controller node for nova APIs' +}, { + 'role': 'os-ceph-controller', + 'display_name': 'controller node', + 'description': 'controller node for nova APIs' +},{ + 'role': 'os-ops-messaging', + 'display_name': 'message queue node', + 'description': 'message queue node' +}, { + 'role': 'os-ops-database', + 'display_name': 'database node', + 'description': 'database node' +}, { + 'role': 'os-identity', + 'display_name': 'keystone node', + 'description': 'keystone node' +}, { + 'role': 'os-dashboard', + 'display_name': 'dashboard node', + 'description': 'dashboard node' +}, { + 'role': 'os-ha', + 'display_name': 'ha proxy node', + 'description': 'ha proxy node', + 'optional': True +}, { + 'role': 'ceph-mds', + 'display_name': 'ceph metadata server', + 'description': 'ceph metadata server', + 'optional': True +}, { + 'role': 'ceph-os-mon', + 'display_name': 'ceph monitor server', + 'description': 'ceph monitor server' +}, { + 'role': 'ceph-osd', + 'display_name': 'ceph storage server', + 'description': 'ceph storage server' +}, { + 'role': 'ceph-os-radosgw', + 'display_name': 'ceph object gateway', + 'description': 'ceph object gateway', + 'optional': True +}] diff --git a/plugins/chef_installer/role/fusionsphere_chef.conf b/plugins/chef_installer/role/fusionsphere_chef.conf new file mode 100755 index 00000000..fda2e993 --- /dev/null +++ b/plugins/chef_installer/role/fusionsphere_chef.conf @@ -0,0 +1,69 @@ +ADAPTER_NAME = 'fusionsphere_icehouse' +ROLES = [{ + 'role': 'os-compute-worker', + 'display_name': 'compute node', + 'description': 'compute node' +}, { + 'role': 'os-network', + 'display_name': 'network node', + 'description': 'network node including network server' +}, { + 'role': 'os-network-server', + 'display_name': 'network server node', + 'description': 'network server node' +}, { + 'role': 'os-network-worker', + 'display_name': 'network node', + 'description': 'network node including network server' +}, { + 'role': 'os-block-storage-controller', + 'display_name': 'storage controller node', + 'description': 'storage controller node' +}, { + 'role': 'os-block-storage-volume', + 'display_name': 'storage node', + 'description': 'storage node', + 'optional': True +}, { + 'role': 'os-image', + 'display_name': 'image node', + 'description': 'image node' +}, { + 'role': 'os-compute-vncproxy', + 'display_name': 'vnc proxy node', + 'description': 'vnc proxy node' +}, { + 'role': 'os-controller', + 'display_name': 'controller node', + 'description': 'controller node including identity, dashboard, network server, and block stroage controller services' +}, { + 'role': 'os-compute-controller', + 'display_name': 'Nova controller node', + 'description': 'controller node for nova APIs' +}, { + 'role': 'os-ops-messaging', + 'display_name': 'message queue node', + 'description': 'message queue node' +}, { + 'role': 'os-ops-database', + 'display_name': 'database node', + 'description': 'database node' +}, { + 'role': 'os-identity', + 'display_name': 'keystone node', + 'description': 'keystone node' +}, { + 'role': 'os-dashboard', + 'display_name': 'dashboard node', + 'description': 'dashboard node' +}, { + 'role': 'os-ha', + 'display_name': 'ha proxy node', + 'description': 'ha proxy node', + 'optional': True +}, { + 'role': 'allinone-compute', + 'display_name': 'all in one compute', + 'description': 'all in one compute', + 'optional': True +}] diff --git a/plugins/chef_installer/role/openstack_chef.conf b/plugins/chef_installer/role/openstack_chef.conf new file mode 100755 index 00000000..c6da8689 --- /dev/null +++ b/plugins/chef_installer/role/openstack_chef.conf @@ -0,0 +1,67 @@ +ADAPTER_NAME = 'openstack_icehouse' +ROLES = [{ + 'role': 'os-compute-worker', + 'display_name': 'compute node', + 'description': 'compute node' +}, { + 'role': 'os-network', + 'display_name': 'network node', + 'description': 'network node including network server' +}, { + 'role': 'os-network-server', + 'display_name': 'network server node', + 'description': 'network server node' +}, { + 'role': 'os-network-worker', + 'display_name': 'network node', + 'description': 'network node including network server' +}, { + 'role': 'os-block-storage-controller', + 'display_name': 'storage controller node', + 'description': 'storage controller node' +}, { + 'role': 'os-block-storage-volume', + 'display_name': 'storage node', + 'description': 'storage node', + 'optional': True +}, { + 'role': 'os-image', + 'display_name': 'image node', + 'description': 'image node' +}, { + 'role': 'os-compute-vncproxy', + 'display_name': 'vnc proxy node', + 'description': 'vnc proxy node' +}, { + 'role': 'os-controller', + 'display_name': 'controller node', + 'description': 'controller node including identity, dashboard, network server, and block stroage controller services' +}, { + 'role': 'os-compute-controller', + 'display_name': 'Nova controller node', + 'description': 'controller node for nova APIs' +}, { + 'role': 'os-ops-messaging', + 'display_name': 'message queue node', + 'description': 'message queue node' +}, { + 'role': 'os-ops-database', + 'display_name': 'database node', + 'description': 'database node' +}, { + 'role': 'os-identity', + 'display_name': 'keystone node', + 'description': 'keystone node' +}, { + 'role': 'os-dashboard', + 'display_name': 'dashboard node', + 'description': 'dashboard node' +}, { + 'role': 'os-ha', + 'display_name': 'ha proxy node', + 'description': 'ha proxy node' +}, { + 'role': 'allinone-compute', + 'display_name': 'all in one compute', + 'description': 'all in one compute' +}]