From 2a5baa5979c3283cb4b141b5520aa56285bf7d98 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 7 Jan 2019 15:07:21 +0200 Subject: [PATCH] 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 Signed-off-by: Bogdan Dobrelya --- ...config.yaml => octavia-deployment-config.j2.yaml} | 12 ++++++++++++ .../notes/octavia-standalone-f1f1121ba77981c3.yaml | 8 ++++++++ roles/Standalone.yaml | 1 + 3 files changed, 21 insertions(+) rename docker/services/octavia/{octavia-deployment-config.yaml => octavia-deployment-config.j2.yaml} (97%) create mode 100644 releasenotes/notes/octavia-standalone-f1f1121ba77981c3.yaml diff --git a/docker/services/octavia/octavia-deployment-config.yaml b/docker/services/octavia/octavia-deployment-config.j2.yaml similarity index 97% rename from docker/services/octavia/octavia-deployment-config.yaml rename to docker/services/octavia/octavia-deployment-config.j2.yaml index ecf5a84a18..b90019cdb1 100644 --- a/docker/services/octavia/octavia-deployment-config.yaml +++ b/docker/services/octavia/octavia-deployment-config.j2.yaml @@ -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 %} diff --git a/releasenotes/notes/octavia-standalone-f1f1121ba77981c3.yaml b/releasenotes/notes/octavia-standalone-f1f1121ba77981c3.yaml new file mode 100644 index 0000000000..83408c829c --- /dev/null +++ b/releasenotes/notes/octavia-standalone-f1f1121ba77981c3.yaml @@ -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. diff --git a/roles/Standalone.yaml b/roles/Standalone.yaml index 90305a6186..dcf3030532 100644 --- a/roles/Standalone.yaml +++ b/roles/Standalone.yaml @@ -11,6 +11,7 @@ tags: - primary - controller + - standalone networks: External: subnet: external_subnet