Add settings to launcher-playbook for OVB

OVB requires cloud settings to be added to the job
definition.

Change-Id: If07afec1803417787fc70d893773f579248988fb
This commit is contained in:
Ronelle Landy 2019-02-12 13:24:40 -05:00
parent d43f3093fa
commit b21ac8c337
2 changed files with 43 additions and 0 deletions

View File

@ -13,6 +13,10 @@
# >> ansible-playbook launcher-playbook.yaml \
# -e cloud_name='<custom cloud>'
#
# To run with a different clouds.yaml
# >> ansible-playbook launcher-playbook.yaml \
# -e clouds_yaml_path='<full path to yaml file>'
#
# To force the job into failing status in order to hold the nodes (temporary option):
# >> ansible-playbook launcher-playbook.yaml \
# -e force_post_failure=true
@ -45,6 +49,9 @@
- hosts: localhost
vars:
{% raw -%}
clouds_yaml_path: "/home/{{ ansible_user }}/.config/openstack/clouds.yaml"
{% endraw -%}
depends_on:
- {{ zuul.change_url }}
zuul_yaml: >-
@ -57,6 +64,29 @@
name: {{ zuul.job }}-dlrn-hash-tag
parent: {{ zuul.job }}
vars:
{% if 'ovb' in zuul.job -%}
{% raw -%}
cloud_secrets:
rdocloud:
{{ lookup('file', '{{ clouds_yaml_path }}') | regex_search('username: (.+)') }}
{{ lookup('file', '{{ clouds_yaml_path }}') | regex_search('password: (.+)') }}
{{ lookup('file', '{{ clouds_yaml_path }}') | regex_search('project_name: (.+)') }}
auth_url: https://phx2.cloud.rdoproject.org:13000/v3
region_name: regionOne
identity_api_version: 3
user_domain_name: Default
project_domain_name: Default
{% endraw -%}
cloud_settings:
rdocloud:
public_ip_net: 38.145.32.0/22
undercloud_flavor: m1.large
baremetal_flavor: m1.large
bmc_flavor: m1.medium
extra_node_flavor: m1.small
baremetal_image: CentOS-7-x86_64-GenericCloud-1804_02
remove_ovb_after_job: false
{% endif -%}
{% raw -%}
mirror_fqdn: {{ lookup('env', 'NODEPOOL_MIRROR') | default('mirror.regionone.rdo-cloud.rdoproject.org', true) }}
{% endraw -%}

View File

@ -7,6 +7,7 @@
: ${WORKSPACE:=$(mktemp -d -t reproduce-tmp.XXXXX)}
: ${LIBVIRT:=0}
: ${CLOUD_NAME:="rdo-cloud"}
: ${CLOUDS_YAML_PATH:="/home/$USER/.config/openstack/clouds.yaml"}
: ${FORCE_POST_FAILURE:=0}
: ${UPSTREAM_GERRIT_USER:="$USER"}
: ${RDO_GERRIT_USER:="$USER"}
@ -31,6 +32,9 @@ usage () {
echo " -c, --cloud-name"
echo " Host cloud, specified in the clouds.yaml, to target"
echo " Defaults to rdo-cloud"
echo " -cp, --clouds-yaml-path"
echo " Full path to the clouds.yaml file"
echo " Defaults to /home/$USER/.config/openstack/clouds.yaml"
echo " -f, --force-post-failure"
echo " Force job to fail so that the nodes will be held."
echo " Temporary solution"
@ -84,6 +88,11 @@ while [ "x$1" != "x" ]; do
shift
;;
--clouds-yaml-path|-cp)
CLOUDS_YAML_PATH=$2
shift
;;
--force-post-failure|-f)
FORCE_FAILURE=1
;;
@ -223,6 +232,10 @@ if [[ "$LIBVIRT" == "0" && "$CLOUD_NAME" != "rdo-cloud" ]]; then
EXTRA_PARAMS="$EXTRA_PARAMS -e cloud_name=$CLOUD_NAME "
fi
if [[ "$CLOUDS_YAML_PATH" != "/home/$USER/.config/openstack/clouds.yaml" ]]; then
EXTRA_PARAMS="$EXTRA_PARAMS -e clouds_yaml_path=$CLOUDS_YAML_PATH "
fi
if [[ "$FORCE_POST_FAILURE" == "1" ]]; then
EXTRA_PARAMS="$EXTRA_PARAMS -e force_post_failure=true "
fi