Modify OVB stack and resource identifiers to match te-broker

The ovb-manage-stack role creates OVB stacks in a similar way
to te-broker. However the patterns of naming the stacks and the
related resources were different. This review changes the naming
pattern of the ovb-manage-stack role to match that used with
te-broker to allow for a more uniform mangement of stacks
across tenants and host clouds.

Change-Id: I5c764b9eb9d49e75998d8fe39f41ac90ec00df73
This commit is contained in:
Ronelle Landy 2018-03-08 18:22:43 -05:00
parent f13fe3e774
commit 1ae2c8c52e
5 changed files with 36 additions and 40 deletions

View File

@ -22,8 +22,7 @@ To interact with the Openstack Virtual Baremetal host cloud, credentials are nee
- os_region_name: <os_region_name> # Most probably RegionOne
Parameters required to access the stack:
- prefix --used as in id for the image and the stack parameters
- stack_name: <'oooq-{{ prefix }}stack'> -- name for OVB heat stack
- stack_name: <'baremetal_{{ idnum }}'> -- name for OVB heat stack
- rc_file: </home/stack/overcloudrc> -- file to reference the overcloud
- node_name: 'undercloud'
- existing_key_location: <local_working_dir> -- required to access the undercloud node

View File

@ -2,22 +2,17 @@
release: master
ovb_repo_version: a3786bca1604d6048562af80eca3bcad119e5065
node:
prefix:
- "{{ 1000 |random }}"
- "{{ lookup('env', 'USER') }}"
- "{{ lookup('env', 'BUILD_NUMBER') }}"
tmp:
node_prefix: '{{ node.prefix | reject("none") | join("-") }}-'
idnum: "{{ 100000 |random }}"
os_username: admin
os_password: password
os_tenant_name: admin
os_auth_url: 'http://10.0.1.10:5000/v2.0'
os_region_name: 'regionOne'
cloud_name: qeos7
cloud_name: rdocloud
stack_name: 'oooq-{{ prefix }}stack'
stack_name: 'baremetal_{{ idnum }}'
rc_file: /home/{{ ansible_user }}/overcloudrc
node_name: 'undercloud'
ssh_extra_args: '-F "{{ local_working_dir }}/ssh.config.ansible"'
@ -31,19 +26,20 @@ ovb_dir: "{{ local_working_dir }}/openstack-virtual-baremetal"
heat_template: "{{ templates_dir }}/quintupleo.yaml"
environment_list:
- "{{ templates_dir }}/resource-registry.yaml"
- "{{ local_working_dir }}/{{ prefix }}env.yaml"
- "{{ local_working_dir }}/env-{{ idnum }}.yaml"
boot_from_volume: false
baremetal_boot_from_volume_size: 50
undercloud_boot_from_volume_size: 50
latest_guest_image:
mitaka: CentOS-7-x86_64-GenericCloud-released-latest
newton: CentOS-7-x86_64-GenericCloud-released-latest
ocata: CentOS-7-x86_64-GenericCloud-released-latest
pike: CentOS-7-x86_64-GenericCloud-released-latest
queens: CentOS-7-x86_64-GenericCloud-released-latest
master: CentOS-7-x86_64-GenericCloud-released-latest
rhos-9: rhel-7.4-server-x86_64-latest
rhos-10: rhel-7.4-server-x86_64-latest
rhos-11: rhel-7.4-server-x86_64-latest
rhos-12: rhel-7.4-server-x86_64-latest
rhos-13: rhel-7.4-server-x86_64-latest
port_security: true
@ -63,22 +59,22 @@ remove_image_from_host_cloud: false
bmc_flavor: m1.medium
bmc_image: 'bmc-base'
bmc_prefix: '{{ prefix }}bmc'
bmc_prefix: 'bmc-{{ idnum }}'
baremetal_flavor: m1.large
baremetal_image: 'ipxe-boot'
baremetal_prefix: '{{ prefix }}baremetal'
baremetal_prefix: 'baremetal-{{ idnum }}'
key_name: '{{ prefix }}key'
private_net: '{{ prefix }}private'
key_name: 'key-{{ idnum }}'
private_net: 'private-{{ idnum }}'
node_count: 2
public_net: '{{ prefix }}public'
provision_net: '{{ prefix }}provision'
public_net: 'public-{{ idnum }}'
provision_net: 'provision-{{ idnum }}'
provision_net_cidr: 192.0.2.0/24
# QuintupleO-specific params ignored by virtual-baremetal.yaml
undercloud_name: '{{ prefix }}undercloud'
undercloud_image: '{{ prefix }}undercloud.qcow2'
undercloud_name: 'undercloud-{{ idnum }}'
undercloud_image: 'undercloud-{{ idnum }}.qcow2'
undercloud_flavor: m1.xlarge
external_net: '10.2.1.0/22'
@ -91,6 +87,7 @@ registered_releases:
- master
- rhos-11
- rhos-12
- rhos-13
baremetal_driver: >-
{% if release not in ['newton', 'ocata', 'pike'] -%}

View File

@ -19,9 +19,9 @@
- include: ovb-cleanup-stacks-keypairs.yml
when: cleanup_stacks_keypairs|bool
- name: generate prefix for all run-related entities
- name: generate idnum for all run-related entities
set_fact:
prefix: "{{ tmp.node_prefix }}"
idnum: "{{ tmp.idnum }}"
- name: set fact for undercloud image
set_fact:
@ -39,7 +39,7 @@
- name: Copy deploy stack parameters template
template:
src: env.yaml.j2
dest: "{{ local_working_dir }}/{{ prefix }}env.yaml"
dest: "{{ local_working_dir }}/env-{{ idnum }}.yaml"
mode: 0755
- name: Add keypair
@ -48,7 +48,7 @@
export OS_PASSWORD="{{ os_password }}";
export OS_TENANT_NAME="{{ os_tenant_name }}";
export OS_AUTH_URL="{{ os_auth_url }}";
nova keypair-add --pub-key {{ existing_key_location }}.pub {{ prefix }}key
nova keypair-add --pub-key {{ existing_key_location }}.pub key-{{ idnum }}
ignore_errors: true
no_log: true
@ -62,7 +62,7 @@
shell: >
export OS_CLIENT_CONFIG_FILE="{{ local_working_dir }}/clouds.yaml";
export OS_CLOUD="{{ cloud_name }}";
{{ ovb_dir }}/bin/deploy.py --env {{ local_working_dir }}/{{ prefix }}env.yaml --name {{ stack_name }} --quintupleo
{{ ovb_dir }}/bin/deploy.py --env {{ local_working_dir }}/env-{{ idnum }}.yaml --name {{ stack_name }} --quintupleo
args:
chdir: "{{ ovb_dir }}"
@ -180,7 +180,7 @@
chdir={{ local_working_dir }}
export OS_CLIENT_CONFIG_FILE="{{ local_working_dir }}/clouds.yaml";
export OS_CLOUD="{{ cloud_name}}";
{{ ovb_dir }}/bin/build-nodes-json --env {{ local_working_dir }}/{{ prefix }}env.yaml --driver {{ baremetal_driver }}
{{ ovb_dir }}/bin/build-nodes-json --env {{ local_working_dir }}/env-{{ idnum }}.yaml --driver {{ baremetal_driver }}
register: nodes_json
- name: remove clouds.yaml file

View File

@ -26,7 +26,7 @@
export OS_PASSWORD="{{ os_password }}";
export OS_TENANT_NAME="{{ os_tenant_name }}";
export OS_AUTH_URL="{{ os_auth_url }}";
nova keypair-delete {{ prefix }}key
nova keypair-delete key-{{ idnum }}
ignore_errors: true
no_log: true

View File

@ -6,21 +6,21 @@ parameters:
bmc_flavor: {{ bmc_flavor }}
bmc_image: 'bmc-base'
bmc_prefix: '{{ prefix }}bmc'
bmc_prefix: 'bmc-{{ idnum }}'
baremetal_flavor: {{ baremetal_flavor }}
baremetal_image: 'ipxe-boot'
baremetal_prefix: '{{ prefix }}baremetal'
baremetal_prefix: 'baremetal-{{ idnum }}'
key_name: '{{ prefix }}key'
private_net: '{{ prefix }}private'
key_name: 'key-{{ idnum }}'
private_net: 'private-{{ idnum }}'
node_count: {{ node_count }}
public_net: '{{ prefix }}public'
provision_net: '{{ prefix }}provision'
public_net: 'public-{{ idnum }}'
provision_net: 'provision-{{ idnum }}'
provision_net_cidr: {{ provision_net_cidr }}
# QuintupleO-specific params ignored by virtual-baremetal.yaml
undercloud_name: '{{ prefix }}undercloud'
undercloud_name: 'undercloud-{{ idnum }}'
undercloud_image: '{{ latest_undercloud_image }}'
undercloud_flavor: {{ undercloud_flavor }}
external_net: '{{ external_net }}'
@ -33,10 +33,10 @@ parameter_defaults:
# undercloud_floating_ip_id: 'uuid of floating ip'
# undercloud_floating_ip: 'address of floating ip'
# Network Isolation parameters
overcloud_internal_net: '{{ prefix }}overcloud_internal_net'
overcloud_storage_net: '{{ prefix }}overcloud_storage_net'
overcloud_storage_mgmt_net: '{{ prefix }}overcloud_storage_mgmt_net'
overcloud_tenant_net: '{{ prefix }}overcloud_tenant_net'
overcloud_internal_net: 'overcloud_internal-{{ idnum }}'
overcloud_storage_net: 'overcloud_storage-{{ idnum }}'
overcloud_storage_mgmt_net: 'overcloud_storage_mgmt-{{ idnum }}'
overcloud_tenant_net: 'overcloud_tenant-{{ idnum }}'
dns_nameservers: '{{ custom_nameserver[0] }}'
{% if boot_from_volume|bool %}
baremetal_volume_size: '{{ baremetal_boot_from_volume_size }}'