Respect the enable_<service> variables

This also allows us to disable services depending on config options
like nova_console==spice

Change-Id: I6a96044533f0154828c4c97de976f77f0967cfae
This commit is contained in:
Angus Salkeld 2016-02-15 10:06:48 +10:00
parent b1a596a641
commit 6e9532f70f
26 changed files with 51 additions and 11 deletions

View File

@ -142,22 +142,21 @@ openstack_auth_v2:
password: "{{ keystone_admin_password }}"
project_name: "admin"
# These roles are required for Kolla to be operation, however a savvy deployer
# could disable some of these required roles and run thier own services.
enable_glance: "yes"
enable_haproxy: "yes"
enable_keystone: "yes"
enable_memcached: "yes"
# Core services are required for Kolla to be operation.
enable_mariadb: "yes"
enable_neutron: "yes"
enable_nova: "yes"
enable_keystone: "yes"
enable_rabbitmq: "yes"
enable_glance: "yes"
enable_nova: "yes"
enable_neutron: "yes"
# Additional optional OpenStack services are specified here
enable_ceph: "no"
enable_cinder: "no"
enable_heat: "yes"
enable_horizon: "yes"
enable_horizon: "no"
enable_memcached: "no"
enable_haproxy: "no"
enable_ceph: "no"
enable_heat: "no"
enable_swift: "no"
enable_murano: "no"
enable_ironic: "no"

View File

@ -29,3 +29,14 @@ neutron_external_interface: "eth2"
openstack_release: "2.0.0"
init_log_level: "debug"
database_max_timeout: "60"
# Additional optional OpenStack services
enable_cinder: "no"
enable_horizon: "no"
enable_memcached: "no"
enable_haproxy: "no"
enable_ceph: "no"
enable_heat: "no"
enable_swift: "no"
enable_murano: "no"
enable_ironic: "no"

View File

@ -111,6 +111,9 @@ class Runner(object):
self._conf = conf
self.base_dir = os.path.abspath(file_utils.find_base_dir())
self.type_name = None
self._enabled = self._conf.get('enabled', True)
if not self._enabled:
LOG.warn('Service %s disabled', self._conf['name'])
def _list_commands(self):
if 'service' in self._conf:
@ -119,6 +122,8 @@ class Runner(object):
yield key, self._conf['commands'][key]
def write_to_zookeeper(self, zk, base_node):
if not self._enabled:
return
for cmd_name, cmd_conf in self._list_commands():
cmd = Command(cmd_conf, cmd_name, self._conf['name'])
cmd.write_to_zookeeper(zk, base_node)
@ -139,6 +144,8 @@ class Runner(object):
return self._conf['name']
def generate_deployment_files(self, kolla_config, jinja_vars, temp_dir):
if not self._enabled:
return
_, proj, service = self._conf['name'].split('/')
values = {
'role': service,

View File

@ -1,4 +1,5 @@
name: openstack/cinder/cinder-api
enabled: {{ enable_cinder | bool }}
container:
image: "{{ cinder_api_image }}:{{ cinder_api_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/cinder/cinder-backup
enabled: {{ enable_cinder | bool }}
container:
image: "{{ cinder_backup_image }}:{{ cinder_backup_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/cinder/cinder_ansible_tasks
enabled: {{ enable_cinder | bool }}
container:
image: "{{ kolla_toolbox_image }}:{{ kolla_toolbox_tag }}"
task:

View File

@ -1,4 +1,5 @@
name: openstack/cinder/cinder-scheduler
enabled: {{ enable_cinder | bool }}
container:
image: "{{ cinder_scheduler_image }}:{{ cinder_scheduler_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/cinder/cinder-volume
enabled: {{ enable_cinder | bool }}
container:
image: "{{ cinder_volume_image }}:{{ cinder_volume_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/glance/glance-api
enabled: {{ enable_glance | bool }}
container:
image: "{{ glance_api_image }}:{{ glance_api_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/glance/glance_ansible_tasks
enabled: {{ enable_glance | bool }}
container:
image: "{{ kolla_toolbox_image }}:{{ kolla_toolbox_tag }}"
task:

View File

@ -1,4 +1,5 @@
name: openstack/glance/glance-registry
enabled: {{ enable_horizon | bool }}
container:
image: "{{ glance_registry_image }}:{{ glance_registry_tag }}"
service:

View File

@ -2,6 +2,7 @@
{% set apache_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %}
{% set apache_conf = 'horizon.conf' if kolla_base_distro in ['ubuntu', 'debian'] else '000-default.conf' %}
name: openstack/horizon/horizon
enabled: {{ enable_horizon | bool }}
container:
image: "{{ horizon_image }}:{{ horizon_tag }}"
service:

View File

@ -1,6 +1,7 @@
{% set keystone_cmd = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %}
{% set keystone_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %}
name: openstack/keystone/keystone-api
enabled: {{ enable_keystone | bool }}
container:
image: "{{ keystone_image }}:{{ keystone_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/keystone/keystone_ansible_tasks
enabled: {{ enable_keystone | bool }}
container:
image: "{{ kolla_toolbox_image }}:{{ kolla_toolbox_tag }}"
task:

View File

@ -1,5 +1,6 @@
{% set mysql_dir = 'mysql' if kolla_base_distro in ['ubuntu', 'debian'] else '' %}
name: infra/mariadb/mariadb
enabled: {{ enable_mariadb | bool }}
container:
image: "{{ mariadb_image }}:{{ mariadb_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: infra/memcached/memcached
enabled: {{ enable_memcached | bool }}
container:
image: "{{ memcached_image }}:{{ memcached_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/nova/nova-api
enabled: {{ enable_nova | bool }}
container:
image: "{{ nova_api_image }}:{{ nova_api_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/nova/nova-compute
enabled: {{ enable_nova | bool }}
container:
image: "{{ nova_compute_image }}:{{ nova_compute_tag }}"
privileged: true

View File

@ -1,4 +1,5 @@
name: openstack/nova/nova-conductor
enabled: {{ enable_nova | bool }}
container:
image: "{{ nova_conductor_image }}:{{ nova_conductor_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/nova/nova-consoleauth
enabled: {{ enable_nova | bool }}
container:
image: "{{ nova_consoleauth_image }}:{{ nova_consoleauth_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/nova/nova_ansible_tasks
enabled: {{ enable_nova | bool }}
container:
image: "{{ kolla_toolbox_image }}:{{ kolla_toolbox_tag }}"
task:

View File

@ -1,4 +1,5 @@
name: openstack/nova/nova-libvirt
enabled: {{ enable_nova | bool }}
container:
image: "{{ nova_libvirt_image }}:{{ nova_libvirt_tag }}"
privileged: true

View File

@ -1,4 +1,5 @@
name: openstack/nova/nova-novncproxy
enabled: {{ enable_nova | bool and nova_console == 'novnc' }}
container:
image: "{{ nova_novncproxy_image }}:{{ nova_novncproxy_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/nova/nova-scheduler
enabled: {{ enable_nova | bool }}
container:
image: "{{ nova_scheduler_image }}:{{ nova_scheduler_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: openstack/nova/nova-spicehtml3proxy
enabled: {{ enable_nova | bool and nova_console == 'spice' }}
container:
image: "{{ nova_spicehtml3proxy_image }}:{{ nova_spicehtml3proxy_tag }}"
service:

View File

@ -1,4 +1,5 @@
name: infra/rabbitmq/rabbitmq
enabled: {{ enable_rabbitmq | bool }}
container:
image: "{{ rabbitmq_image }}:{{ rabbitmq_tag }}"
service: