Multiple updates for Kayobe

---

1. Gather facts for localhost in kolla-ansible.yml
2. Don't include unconfigured networks in network_interfaces
3. Added Keystone configuration extra config merge

---

1. Facts are necessary for the kolla-ansible role,
which references the ansible_user_uid fact

2. It is possible to skip configuring a network,
by setting its name to None

This is done in networks.yml as follows:

admin_oc_net_name:

Currently, these networks may still be included in the 'network_interfaces'
list for each host, despite the fact that they are not in use.

A classic example is when ironic is not enabled, it is currently still
necessary to define provisioning and cleaning networks.

This change avoids including any networks that have their name set to None
in network_interfaces.

3. Added support for Keystone custom configuration

Added tests and documentation to add support for keystone extra configuration

Co-Authored-By: Mark Goddard <mark@stackhpc.com

Change-Id: Iaa304221b8093ac71f9cdbb23edc84d1517578da
This commit is contained in:
Ross Martyn 2019-04-04 11:46:22 +01:00 committed by Mark Goddard
parent ac85dc6064
commit d8ee0fa027
16 changed files with 46 additions and 9 deletions

View File

@ -12,7 +12,7 @@ compute_bootstrap_user: "{{ lookup('env', 'USER') }}"
# List of networks to which compute nodes are attached.
compute_network_interfaces: >
{{ (compute_default_network_interfaces +
compute_extra_network_interfaces) | unique | list }}
compute_extra_network_interfaces) | reject('none') | unique | list }}
# List of default networks to which compute nodes are attached.
compute_default_network_interfaces: >

View File

@ -14,7 +14,7 @@ controller_network_interfaces: >
{{ (controller_default_network_interfaces +
controller_extra_network_interfaces +
(controller_network_host_network_interfaces
if inventory_hostname in groups['network'] else [])) | unique | list }}
if inventory_hostname in groups['network'] else [])) | reject('none') | unique | list }}
# List of default networks to which controller nodes are attached.
controller_default_network_interfaces: >
@ -36,7 +36,7 @@ controller_extra_network_interfaces: []
controller_network_host_network_interfaces: >
{{ ([public_net_name,
tunnel_net_name] +
external_net_names) | unique | list }}
external_net_names) | reject('none') | unique | list }}
###############################################################################
# Controller node BIOS configuration.

View File

@ -14,13 +14,13 @@ monitoring_network_interfaces: >
{{ controller_network_interfaces | unique | list
if inventory_hostname in groups['controllers'] else
(monitoring_default_network_interfaces +
monitoring_extra_network_interfaces) | unique | list }}
monitoring_extra_network_interfaces) | reject('none') | unique | list }}
# List of default networks to which monitoring nodes are attached.
monitoring_default_network_interfaces: >
{{ [admin_oc_net_name,
internal_net_name,
public_net_name] | unique | list }}
public_net_name] | reject('none') | unique | list }}
# List of extra networks to which monitoring nodes are attached.
monitoring_extra_network_interfaces: []

View File

@ -12,13 +12,13 @@ seed_bootstrap_user: "{{ lookup('env', 'USER') }}"
# List of networks to which seed nodes are attached.
seed_network_interfaces: >
{{ (seed_default_network_interfaces +
seed_extra_network_interfaces) | unique | list }}
seed_extra_network_interfaces) | reject('none') | unique | list }}
# List of default networks to which seed nodes are attached.
seed_default_network_interfaces: >
{{ [admin_oc_net_name,
oob_oc_net_name,
provision_oc_net_name] | unique | list }}
provision_oc_net_name] | reject('none') | unique | list }}
# List of extra networks to which seed nodes are attached.
seed_extra_network_interfaces: []

View File

@ -12,7 +12,7 @@ seed_hypervisor_bootstrap_user: "{{ lookup('env', 'USER') }}"
# List of networks to which seed hypervisor nodes are attached.
seed_hypervisor_network_interfaces: >
{{ (seed_hypervisor_default_network_interfaces +
seed_hypervisor_extra_network_interfaces) | unique | list }}
seed_hypervisor_extra_network_interfaces) | reject('none') | unique | list }}
# List of default networks to which seed hypervisor nodes are attached.
seed_hypervisor_default_network_interfaces: "{{ seed_default_network_interfaces }}"

View File

@ -27,7 +27,7 @@ storage_default_network_interfaces: >
{{ [admin_oc_net_name,
internal_net_name,
storage_mgmt_net_name,
storage_net_name] | unique | list }}
storage_net_name] | reject('none') | unique | list }}
# List of extra networks to which storage nodes are attached.
storage_extra_network_interfaces: []

View File

@ -213,6 +213,7 @@
hosts: localhost
tags:
- kolla-ansible
gather_facts: true
vars:
# We need to reference configuration for the network node.
# We pick the first host from the group for this. It is possible that at

View File

@ -109,6 +109,7 @@
- { name: inspector, file: ironic-inspector.conf }
- { name: ironic, file: ironic.conf }
- { name: kafka, file: kafka.server.properties }
- { name: keystone, file: keystone.conf }
- { name: magnum, file: magnum.conf }
- { name: manila, file: manila.conf }
- { name: mariadb, file: galera.cnf }
@ -212,6 +213,7 @@
kolla_extra_inspector: "{{ kolla_extra_config.inspector | default }}"
kolla_extra_ironic: "{{ kolla_extra_config.ironic | default }}"
kolla_extra_kafka: "{{ kolla_extra_config.kafka | default }}"
kolla_extra_keystone: "{{ kolla_extra_config.keystone | default }}"
kolla_extra_magnum: "{{ kolla_extra_config.magnum | default }}"
kolla_extra_manila: "{{ kolla_extra_config.manila | default }}"
kolla_extra_mariadb: "{{ kolla_extra_config.mariadb | default }}"

View File

@ -67,6 +67,15 @@ kolla_extra_grafana:
kolla_enable_haproxy:
###############################################################################
# Keystone configuration.
# Whether to enable Keystone.
kolla_enable_keystone:
# Free form extra configuration to append to Keystone.conf
kolla_extra_keystone:
##############################################################################
# Heat configuration.
# Whether to enable Heat.

View File

@ -54,6 +54,10 @@ provisioner:
kolla_extra_kafka: |
[extra-kafka.server.properties]
foo=bar
kolla_enable_keystone: true
kolla_extra_keystone: |
[extra-keystone.conf]
foo=bar
kolla_enable_magnum: true
kolla_extra_magnum: |
[extra-magnum.conf]

View File

@ -69,6 +69,7 @@ def test_service_config_directory(host, path):
'ironic.conf',
'ironic-inspector.conf',
'kafka.server.properties',
'keystone.conf',
'magnum.conf',
'manila.conf',
'neutron/ml2_conf.ini',

View File

@ -23,6 +23,7 @@
- { src: ironic.conf.j2, dest: ironic.conf, enabled: "{{ kolla_enable_ironic }}" }
- { src: ironic-inspector.conf.j2, dest: ironic-inspector.conf, enabled: "{{ kolla_enable_ironic }}" }
- { src: kafka.server.properties.j2, dest: kafka.server.properties, enabled: "{{ kolla_enable_kafka }}" }
- { src: keystone.conf.j2, dest: keystone.conf, enabled: "{{ kolla_enable_keystone }}" }
- { src: magnum.conf.j2, dest: magnum.conf, enabled: "{{ kolla_enable_magnum }}" }
- { src: manila.conf.j2, dest: manila.conf, enabled: "{{ kolla_enable_manila }}" }
- { src: ml2_conf.ini.j2, dest: neutron/ml2_conf.ini, enabled: "{{ kolla_enable_neutron }}" }

View File

@ -0,0 +1,8 @@
# {{ ansible_managed }}
{% if kolla_extra_keystone %}
#######################
# Extra configuration
#######################
{{ kolla_extra_keystone }}
{% endif %}

View File

@ -173,6 +173,7 @@ which files are supported.
``kafka.server.properties`` Kafka configuration.
``kafka/*`` Extended Kafka configuration.
``keepalived/*`` Extended keepalived configuration.
``keystone.conf`` Keystone configuration.
``keystone/*`` Extended keystone configuration.
``magnum.conf`` Magnum configuration.
``magnum/*`` Extended magnum configuration.

View File

@ -195,6 +195,7 @@
#kolla_enable_ironic_pxe_uefi:
#kolla_enable_iscsid:
#kolla_enable_karbor:
#kolla_enable_keystone:
#kolla_enable_kuryr:
#kolla_enable_magnum:
#kolla_enable_manila:

View File

@ -0,0 +1,9 @@
---
features:
- |
Adds support for skipping configuration of a network, by setting its name
to ``None``. This is done in ``networks.yml`` as follows::
admin_oc_net_name:
- |
Adds support for custom configuration of ``keystone.conf``.