Browse Source

Introduce OpenShiftGlusterNodeVars heat param

Removes conflict on OpenShiftGlobalVariables param that was overwritten
by the openshift-cns.yaml environment file. The default options for CNS
as now moved into the extraconfig/services/openshift-cns.yaml template
and can be overwritten by setting the OpenShiftGlusterNodeVars heat
parameter.

Change-Id: I43052662e913a02945f22e9f541a45ce2d9d828c
changes/24/604724/4
Martin André 4 years ago committed by John Trowbridge
parent
commit
bd5dddb58d
  1. 5
      environments/openshift-cns.yaml
  2. 90
      extraconfig/services/openshift-cns.yaml
  3. 3
      extraconfig/services/openshift-master.yaml

5
environments/openshift-cns.yaml

@ -1,7 +1,2 @@
resource_registry:
OS::TripleO::Services::OpenShift::GlusterFS: ../extraconfig/services/openshift-cns.yaml
parameter_defaults:
OpenShiftGlobalVariables:
openshift_storage_glusterfs_namespace: glusterfs
openshift_storage_glusterfs_name: storage

90
extraconfig/services/openshift-cns.yaml

@ -32,6 +32,10 @@ parameters:
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
OpenShiftGlusterNodeVars:
default: {}
description: OpenShift node vars specific for the gluster nodes
type: json
OpenShiftGlusterDisks:
default:
- /dev/vdb
@ -107,45 +111,52 @@ outputs:
set_fact:
openshift_gluster_disks: {get_attr: [RoleParametersValue, value, OpenShiftGlusterDisks]}
- name: set openshift images vars fact
- name: set openshift gluster global vars fact
set_fact:
openshift_gluster_images:
openshift_storage_glusterfs_image:
yaql:
expression:
$.data.image.rightSplit(":", 1)[0]
data:
image: {get_param: DockerOpenShiftGlusterFSImage}
openshift_storage_glusterfs_version:
yaql:
expression:
$.data.image.rightSplit(":", 1)[1]
data:
image: {get_param: DockerOpenShiftGlusterFSImage}
openshift_storage_glusterfs_block_image:
yaql:
expression:
$.data.image.rightSplit(":", 1)[0]
data:
image: {get_param: DockerOpenShiftGlusterFSBlockImage}
openshift_storage_glusterfs_block_version:
yaql:
expression:
$.data.image.rightSplit(":", 1)[1]
data:
image: {get_param: DockerOpenShiftGlusterFSBlockImage}
openshift_storage_glusterfs_heketi_image:
yaql:
expression:
$.data.image.rightSplit(":", 1)[0]
data:
image: {get_param: DockerOpenShiftGlusterFSHeketiImage}
openshift_storage_glusterfs_heketi_version:
yaql:
expression:
$.data.image.rightSplit(":", 1)[1]
data:
image: {get_param: DockerOpenShiftGlusterFSHeketiImage}
openshift_gluster_global_vars:
map_merge:
- {get_param: OpenShiftGlusterNodeVars}
- openshift_storage_glusterfs_image:
yaql:
expression:
$.data.image.rightSplit(":", 1)[0]
data:
image: {get_param: DockerOpenShiftGlusterFSImage}
openshift_storage_glusterfs_version:
yaql:
expression:
$.data.image.rightSplit(":", 1)[1]
data:
image: {get_param: DockerOpenShiftGlusterFSImage}
openshift_storage_glusterfs_block_image:
yaql:
expression:
$.data.image.rightSplit(":", 1)[0]
data:
image: {get_param: DockerOpenShiftGlusterFSBlockImage}
openshift_storage_glusterfs_block_version:
yaql:
expression:
$.data.image.rightSplit(":", 1)[1]
data:
image: {get_param: DockerOpenShiftGlusterFSBlockImage}
openshift_storage_glusterfs_heketi_image:
yaql:
expression:
$.data.image.rightSplit(":", 1)[0]
data:
image: {get_param: DockerOpenShiftGlusterFSHeketiImage}
openshift_storage_glusterfs_heketi_version:
yaql:
expression:
$.data.image.rightSplit(":", 1)[1]
data:
image: {get_param: DockerOpenShiftGlusterFSHeketiImage}
- name: generate openshift gluster global vars
copy:
dest: "{{playbook_dir}}/openshift/global_gluster_vars.yml"
content: "{{openshift_gluster_global_vars|to_nice_yaml}}"
- name: generate openshift inventory for openshift_glusterfs service
lineinfile:
@ -188,6 +199,3 @@ outputs:
ansible_become: true
openshift_schedulable: true
{% endfor %}
vars:
{{openshift_gluster_images | to_nice_yaml() | indent(4) }}

3
extraconfig/services/openshift-master.yaml

@ -425,6 +425,9 @@ outputs:
-i '{{playbook_dir}}/openshift/inventory'
--extra-vars '@{{playbook_dir}}/openshift/global_defaults.yml'
--extra-vars '@{{playbook_dir}}/openshift/global_vars.yml'
{% if groups['openshift_glusterfs'] | default([]) %}
--extra-vars '@{{playbook_dir}}/openshift/global_gluster_vars.yml'
{% endif %}
'{{playbook_dir}}/openshift/playbook.yml'
{%- endif -%}
- name: print openshift command

Loading…
Cancel
Save