Allow Octavia deployments for Standalone

We have yet Nova for SSH keys management, when deploying a standalone
cloud. Allow Octavia deployments for such a case as well.
Jinja2 rendering of the octavia service template provides that
functionality by relying on a new role tag 'standalone'.

Change-Id: I69f3623646ec5b65109e0a4f0c16139018da9282
Closes-bug: #1806113
Co-Authored-By: Harald Jensas <hjensas@redhat.com>
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2019-01-07 15:07:21 +02:00
parent c296b305e0
commit 2a5baa5979
3 changed files with 21 additions and 0 deletions

View File

@ -1,4 +1,8 @@
heat_template_version: rocky
{%- set octavia_standalone=[] -%}
{%- for role in roles if 'standalone' in role.tags -%}
{% if octavia_standalone.append('1') %}{% endif %}
{%- endfor %}
description: >
Configuration of Octavia as-a-service resources in the overcloud.
@ -61,7 +65,9 @@ parameters:
description: SSH key name.
OctaviaAmphoraSshKeyFile:
type: string
{% if not octavia_standalone %}
default: ''
{% endif %}
description: Public key file path. User will be able to SSH into amphorae
with the provided key. User may, in most cases, also elevate to root
from user 'centos' (CentOS), 'ubuntu' (Ubuntu) or 'cloud-user' (RHEL)
@ -152,9 +158,11 @@ parameters:
default: 'service'
resources:
{% if not octavia_standalone %}
default_key_pair:
type: OS::Nova::KeyPair
external_id: default
{% endif %}
OctaviaVars:
type: OS::Heat::Value
properties:
@ -168,7 +176,10 @@ resources:
amp_image_tag: { get_param: OctaviaAmphoraImageTag }
amp_ssh_key_name: { get_param: OctaviaAmphoraSshKeyName }
amp_ssh_key_path: { get_param: OctaviaAmphoraSshKeyFile }
{% if not octavia_standalone %}
amp_ssh_key_data: { get_attr: [default_key_pair, public_key] }
{% endif %}
{% raw %}
amp_to_raw: { get_param: NovaEnableRbdBackend }
auth_username: { get_param: OctaviaUserName }
auth_password: { get_param: OctaviaPassword }
@ -282,3 +293,4 @@ outputs:
path: "{{ item }}"
with_items:
- "{{ octavia_ansible_group_vars.octavia_local_tmpdir }}"
{% endraw %}

View File

@ -0,0 +1,8 @@
---
other:
- |
Octavia may be deployed for a standalone cloud, which has yet Nova services
available for Amphorae SSH keys management. For that case, the parameter
``OctaviaAmphoraSshKeyFile`` must be defined by a user.
Otherwise, it takes an empty value by usual for overcloud deployments
meanings and Nova will be used to create a key-pair for Octavia instead.

View File

@ -11,6 +11,7 @@
tags:
- primary
- controller
- standalone
networks:
External:
subnet: external_subnet