Add cinder section to ironic config

Ironic Conductor can not retrieve volume info from Cinder and boot
fails.

Change-Id: I6f1ab5e661dd647ccacca1cb4ed0898ed3d8c662
Related-Prod: PROD-23408 (PROD-23408)
diff --git a/ironic/files/pike/ironic.conf b/ironic/files/pike/ironic.conf
index 5483e60..40da36b 100644
--- a/ironic/files/pike/ironic.conf
+++ b/ironic/files/pike/ironic.conf
@@ -999,6 +999,157 @@
 #action_interval = 10
 
 
+[cinder]
+
+#
+# From ironic
+#
+
+# This section was added by iura
+# I referred to https://docs.openstack.org/ironic/pike/configuration/sample-config.html
+
+# Number of retries in the case of a failed action (currently
+# only used when detaching volumes). This option is part of
+# boot-from-volume work, which is not currently exposed to
+# users. (integer value)
+#action_retries = 3
+action_retries = 3
+
+# Retry interval in seconds in the case of a failed action
+# (only specific actions are retried). (integer value)
+#action_retry_interval = 5
+
+# Authentication URL (string value)
+{%- if ironic.get('cinder', {}).get('auth_strategy') == 'keystone' %}
+auth_url = {{ ironic.identity.protocol }}://{{ ironic.identity.host }}:{{ ironic.identity.port }}
+{%- if ironic.identity.protocol == 'https' %}
+cafile={{ ironic.identity.get('cacert_file', ironic.cacert_file) }}
+{%- endif %}
+{%- else %}
+#auth_url = <None>
+{%- endif %}
+
+# Authentication type to load (string value)
+# Deprecated group/name - [cinder]/auth_plugin
+{%- if ironic.get('cinder', {}).get('auth_type') %}
+auth_type = {{ ironic.cinder.auth_type }}
+{%- else %}
+#auth_type = <None>
+{%- endif %}
+
+# PEM encoded Certificate Authority to use when verifying
+# HTTPs connections. (string value)
+#cafile = <None>
+
+# PEM encoded client certificate cert file (string value)
+#certfile = <None>
+
+# Optional domain ID to use with v3 and v2 parameters. It will
+# be used for both the user and project domain in v3 and
+# ignored in v2 authentication. (string value)
+#default_domain_id = <None>
+
+# Optional domain name to use with v3 API and v2 parameters.
+# It will be used for both the user and project domain in v3
+# and ignored in v2 authentication. (string value)
+#default_domain_name = <None>
+
+# Domain ID to scope to (string value)
+#domain_id = <None>
+
+# Domain name to scope to (string value)
+#domain_name = <None>
+
+# Verify HTTPS connections. (boolean value)
+#insecure = false
+insecure = true
+
+# PEM encoded client certificate key file (string value)
+#keyfile = <None>
+
+# User's password (string value)
+#password = <None>
+{%- if ironic.get('cinder', {}).get('password') %}
+password = {{ ironic.cinder.password }}
+{%- else %}
+#password = <None>
+{%- endif %}
+
+# Domain ID containing project (string value)
+#project_domain_id = <None>
+{%- if ironic.get('cinder', {}).get('project_domain_id') %}
+project_domain_id = {{ ironic.cinder.project_domain_id }}
+{%- else %}
+#project_domain_id = <None>
+{%- endif %}
+
+# Domain name containing project (string value)
+#project_domain_name = <None>
+#project_domain_id = default
+
+# Project ID to scope to (string value)
+# Deprecated group/name - [cinder]/tenant_id
+#project_id = <None>
+
+# Project name to scope to (string value)
+# Deprecated group/name - [cinder]/tenant_name
+#project_name = <None>
+{%- if ironic.get('cinder', {}).get('project_name') %}
+project_name = {{ ironic.cinder.project_name }}
+{%- else %}
+#project_name = <None>
+{%- endif %}
+
+# Client retries in the case of a failed request connection.
+# This option is part of boot-from-volume work, which is not
+# currently exposed to users. (integer value)
+#retries = 3
+
+# Tenant ID (string value)
+#tenant_id = <None>
+
+# Tenant Name (string value)
+#tenant_name = <None>
+
+# Timeout value for http requests (integer value)
+#timeout = <None>
+
+# Trust ID (string value)
+#trust_id = <None>
+
+# URL for connecting to cinder. If set, the value must start
+# with either http:// or https://. This option is part of
+# boot-from-volume work, which is not currently exposed to
+# users. (uri value)
+{%- if ironic.get('cinder', {}).get('url') %}
+url = {{ ironic.cinder.url }}
+{%- else %}
+#url = <None>
+{%- endif %}
+
+# User's domain id (string value)
+#user_domain_id = <None>
+user_domain_id = default
+
+# User's domain name (string value)
+{%- if ironic.get('cinder', {}).get('user_domain_name') %}
+user_domain_name = {{ ironic.cinder.user_domain_name }}
+{%- else %}
+#user_domain_name = <None>
+{%- endif %}
+
+# User id (string value)
+#user_id = <None>
+
+# Username (string value)
+# Deprecated group/name - [cinder]/user_name
+{%- if ironic.get('cinder', {}).get('username') %}
+username = {{ ironic.cinder.username }}
+{%- else %}
+#username = <None>
+{%- endif %}
+
+
 [cisco_ucs]
 
 #
diff --git a/ironic/files/queens/ironic.conf b/ironic/files/queens/ironic.conf
index 2a3adfc..15dbf2c 100644
--- a/ironic/files/queens/ironic.conf
+++ b/ironic/files/queens/ironic.conf
@@ -881,20 +881,37 @@
 # From ironic
 #
 
+# This section was added by iura
+# I referred to https://docs.openstack.org/ironic/pike/configuration/sample-config.html
+
 # Number of retries in the case of a failed action (currently
-# only used when detaching volumes). (integer value)
+# only used when detaching volumes). This option is part of
+# boot-from-volume work, which is not currently exposed to
+# users. (integer value)
 #action_retries = 3
+action_retries = 3
 
 # Retry interval in seconds in the case of a failed action
 # (only specific actions are retried). (integer value)
 #action_retry_interval = 5
 
 # Authentication URL (string value)
+{%- if ironic.get('cinder', {}).get('auth_strategy') == 'keystone' %}
+auth_url = {{ ironic.identity.protocol }}://{{ ironic.identity.host }}:{{ ironic.identity.port }}
+{%- if ironic.identity.protocol == 'https' %}
+cafile={{ ironic.identity.get('cacert_file', ironic.cacert_file) }}
+{%- endif %}
+{%- else %}
 #auth_url = <None>
+{%- endif %}
 
 # Authentication type to load (string value)
 # Deprecated group/name - [cinder]/auth_plugin
+{%- if ironic.get('cinder', {}).get('auth_type') %}
+auth_type = {{ ironic.cinder.auth_type }}
+{%- else %}
 #auth_type = <None>
+{%- endif %}
 
 # PEM encoded Certificate Authority to use when verifying
 # HTTPs connections. (string value)
@@ -919,10 +936,94 @@
 # Domain name to scope to (string value)
 #domain_name = <None>
 
-# Always use this endpoint URL for requests for this client.
-# NOTE: The unversioned endpoint should be specified here; to
-# request a particular API version, use the `version`, `min-
-# version`, and/or `max-version` options. (string value)
+# Verify HTTPS connections. (boolean value)
+#insecure = false
+insecure = true
+
+# PEM encoded client certificate key file (string value)
+#keyfile = <None>
+
+# User's password (string value)
+#password = <None>
+{%- if ironic.get('cinder', {}).get('password') %}
+password = {{ ironic.cinder.password }}
+{%- else %}
+#password = <None>
+{%- endif %}
+
+# Domain ID containing project (string value)
+#project_domain_id = <None>
+{%- if ironic.get('cinder', {}).get('project_domain_id') %}
+project_domain_id = {{ ironic.cinder.project_domain_id }}
+{%- else %}
+#project_domain_id = <None>
+{%- endif %}
+
+# Domain name containing project (string value)
+#project_domain_name = <None>
+#project_domain_id = default
+
+# Project ID to scope to (string value)
+# Deprecated group/name - [cinder]/tenant_id
+#project_id = <None>
+
+# Project name to scope to (string value)
+# Deprecated group/name - [cinder]/tenant_name
+#project_name = <None>
+{%- if ironic.get('cinder', {}).get('project_name') %}
+project_name = {{ ironic.cinder.project_name }}
+{%- else %}
+#project_name = <None>
+{%- endif %}
+
+# Client retries in the case of a failed request connection.
+# This option is part of boot-from-volume work, which is not
+# currently exposed to users. (integer value)
+#retries = 3
+
+# Tenant ID (string value)
+#tenant_id = <None>
+
+# Tenant Name (string value)
+#tenant_name = <None>
+
+# Timeout value for http requests (integer value)
+#timeout = <None>
+
+# Trust ID (string value)
+#trust_id = <None>
+
+# URL for connecting to cinder. If set, the value must start
+# with either http:// or https://. This option is part of
+# boot-from-volume work, which is not currently exposed to
+# users. (uri value)
+{%- if ironic.get('cinder', {}).get('url') %}
+url = {{ ironic.cinder.url }}
+{%- else %}
+#url = <None>
+{%- endif %}
+
+# User's domain id (string value)
+#user_domain_id = <None>
+user_domain_id = default
+
+# User's domain name (string value)
+{%- if ironic.get('cinder', {}).get('user_domain_name') %}
+user_domain_name = {{ ironic.cinder.user_domain_name }}
+{%- else %}
+#user_domain_name = <None>
+{%- endif %}
+
+# User id (string value)
+#user_id = <None>
+
+# Username (string value)
+# Deprecated group/name - [cinder]/user_name
+{%- if ironic.get('cinder', {}).get('username') %}
+username = {{ ironic.cinder.username }}
+{%- else %}
+#username = <None>
+{%- endif %}
 
 
 [cisco_ucs]