From 0007d3325d22e27cac938aeb0cd7f914c469b5b2 Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Mon, 27 Jul 2015 10:38:35 +0000 Subject: [PATCH] Properly use groups throught Ansible Additionally, make each service optional witha config option allowing for extreme flexibility should the deployer want to replace a service with a non-kolla one (the database for example). Change-Id: I7b644da7cfa7e8e6b6878eb1b1aa97db830504ae Closes-Bug: #1478509 --- ansible/roles/glance/tasks/start.yml | 2 ++ ansible/site.yml | 31 +++++++++------------------- etc/kolla/defaults.yml | 11 ++++++++++ 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/ansible/roles/glance/tasks/start.yml b/ansible/roles/glance/tasks/start.yml index 86c140722b..f9534ebd8c 100644 --- a/ansible/roles/glance/tasks/start.yml +++ b/ansible/roles/glance/tasks/start.yml @@ -7,6 +7,7 @@ container_name: "glance_registry" container_volumes: - "{{ node_config_directory }}/glance-registry/:/opt/kolla/glance-registry/:ro" + when: inventory_hostname in groups['glance-registry'] - include: ../../start.yml vars: @@ -16,3 +17,4 @@ container_name: "glance_api" container_volumes: - "{{ node_config_directory }}/glance-api/:/opt/kolla/glance-api/:ro" + when: inventory_hostname in groups['glance-api'] diff --git a/ansible/site.yml b/ansible/site.yml index 0dd67b69bc..612d126b5a 100755 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -1,39 +1,28 @@ --- - hosts: haproxy roles: - - haproxy - tags: haproxy + - { role: haproxy, tags: haproxy, keepalived when: enable_haproxy | bool } - hosts: mariadb roles: - - mariadb - tags: mariadb + - { role: mariadb, tags: mariadb, when: enable_mariadb | bool } - hosts: rabbitmq roles: - - rabbitmq - tags: rabbitmq + - { role: rabbitmq, tags: rabbitmq, when: enable_rabbitmq | bool } - hosts: keystone roles: - - keystone - tags: keystone + - { role: keystone, tags: keystone, when: enable_keystone | bool } -- hosts: glance +- hosts: [glance-api, glance-registry] roles: - - glance - tags: glance + - { role: glance, tags: glance, when: enable_glance | bool } -- hosts: - - nova - - compute +- hosts: [nova-api, nova-conductor, nova-consoleauth, nova-novncproxy, nova-scheduler, compute] roles: - - nova - tags: nova + - { role: nova, tags: nova, when: enable_nova | bool } -- hosts: - - neutron - - compute +- hosts: [neutron-server, neutron-agents, compute] roles: - - neutron - tags: neutron + - { role: neutron, tags: neutron, when: enable_neutron | bool } diff --git a/etc/kolla/defaults.yml b/etc/kolla/defaults.yml index e2ab12d111..5ed397cbf1 100644 --- a/etc/kolla/defaults.yml +++ b/etc/kolla/defaults.yml @@ -32,3 +32,14 @@ glance_registry_port: "9191" nova_api_port: "8774" neutron_server_port: "9696" + + +# 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_mariadb: "yes" +enable_neutron: "yes" +enable_nova: "yes" +enable_rabbitmq: "yes"