Skip to content

Commit 1add729

Browse files
committed
Extra var ironic_enable_keystone_integration added.
Basically, there are three main installation scenario: Scenario 1: Ironic installation together with other openstack services including keystone. In this case variable enable_keystone is set to true and keystone service will be installed together with ironic installation. It is possible realise this scenario, no fix needed Scenario 2: Ironic installation with connection to already installed keystone. In this scenario we have to set enable_keystone to “No” to prevent from new keystone service installation during the ironic installation process. But in other hand, we need to have correct sections in ironic.conf to provide all information needed to connect to existing keystone. But all sections for keystone are added to ironic.conf only if enable_keystone var is set to “Yes”. It isn’t possible to realise this scenario. Proposed fix provide support for this scenario, where multiple regions share the same keystone service. Scenario 3: No keystone integration. Ironic don't connect to Keystone. It is possible realise this scenario, no fix needed Proposed solution also keep the default behaviour: if no enable_keystone_integration is manually defined by default it takes value of enable_keystone variable and all behaviour is the same. But if we don't want to install keystone and want to connect to existing one at the same time, it will be possible to set enable_keystone var to “No” (preventing keystone from installation) and at the same time set ironic_enable_keystone_integration to Yes to allow needed section appear in ironic.conf through templating. Change-Id: I0c7e9a28876a1d4278fb2ed8555c2b08472864b9 (cherry picked from commit da4fd2d)
1 parent cbda3c3 commit 1add729

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

ansible/roles/ironic/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ ironic_enabled_notification_topics: "{{ ironic_notification_topics | selectattr(
286286
####################
287287
# Keystone
288288
####################
289+
ironic_enable_keystone_integration: "{{ enable_keystone | bool }}"
289290
ironic_ks_services:
290291
- name: "ironic"
291292
type: "baremetal"

ansible/roles/ironic/templates/ironic.conf.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# suppressed by the deployer by setting a value for the option.
77

88
[DEFAULT]
9-
{% if not enable_keystone | bool %}
9+
{% if not ironic_enable_keystone_integration | bool %}
1010
auth_strategy = noauth
1111
{% endif %}
1212
debug = {{ ironic_logging_debug }}
@@ -52,7 +52,7 @@ connection_recycle_time = {{ database_connection_recycle_time }}
5252
max_pool_size = {{ database_max_pool_size }}
5353
max_retries = -1
5454

55-
{% if enable_keystone | bool %}
55+
{% if ironic_enable_keystone_integration | bool %}
5656
[keystone_authtoken]
5757
www_authenticate_uri = {{ keystone_internal_url }}
5858
auth_url = {{ keystone_admin_url }}
@@ -143,7 +143,7 @@ cafile = {{ openstack_cacert }}
143143
{% endif %}
144144

145145
[inspector]
146-
{% if enable_keystone | bool %}
146+
{% if ironic_enable_keystone_integration | bool %}
147147
auth_url = {{ keystone_admin_url }}
148148
auth_type = password
149149
project_domain_id = default
@@ -160,7 +160,7 @@ endpoint_override = {{ ironic_inspector_internal_endpoint }}
160160
{% endif %}
161161

162162
[service_catalog]
163-
{% if enable_keystone | bool %}
163+
{% if ironic_enable_keystone_integration | bool %}
164164
auth_url = {{ keystone_admin_url }}
165165
auth_type = password
166166
project_domain_id = default

doc/source/reference/bare-metal/ironic-guide.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,28 @@ The following changes will occur if iPXE booting is enabled:
9494
environment. You may also boot directly to iPXE by some other means e.g by
9595
burning it to the option rom of your ethernet card.
9696

97+
Attach ironic to external keystone (optional)
98+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99+
In :kolla-ansible-doc:`multi-regional <user/multi-regions.html>` deployment
100+
keystone could be installed in one region (let's say region 1) and ironic -
101+
in another region (let's say region 2). In this case we don't install keystone
102+
together with ironic in region 2, but have to configure ironic to connect to
103+
existing keystone in region 1. To deploy ironic in this way we have to set
104+
variable ``enable_keystone`` to ``"no"``.
105+
106+
.. code-block:: yaml
107+
108+
enable_keystone: "no"
109+
110+
It will prevent keystone from being installed in region 2.
111+
112+
To add keystone-related sections in ironic.conf, it is also needed to set
113+
variable ``ironic_enable_keystone_integration`` to ``"yes"``
114+
115+
.. code-block:: yaml
116+
117+
ironic_enable_keystone_integration: "yes"
118+
97119
Deployment
98120
~~~~~~~~~~
99121
Run the deploy as usual:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
features:
3+
- |
4+
New variable ``ironic_enable_keystone_integration`` was added.
5+
It helps to add keystone connection information into
6+
``ironic.conf`` if we want to connect to existing keystone
7+
(not installing it at the same time).

0 commit comments

Comments
 (0)