Merge "Allow for passing boot-time vars/args to OC nodes"

This commit is contained in:
Zuul 2018-03-29 07:02:09 +00:00 committed by Gerrit Code Review
commit 14af18e393
1 changed files with 23 additions and 5 deletions

View File

@ -32,7 +32,6 @@ parameters:
description: Mapping of service endpoint -> protocol. Typically set description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry. via parameter_defaults in the resource registry.
type: json type: json
OpenShiftGlobalVariables: OpenShiftGlobalVariables:
default: {} default: {}
description: Global Ansible variables for OpenShift-Ansible installer. description: Global Ansible variables for OpenShift-Ansible installer.
@ -41,6 +40,14 @@ parameters:
default: '/usr/share/ansible/openshift-ansible/playbooks/byo/config.yml' default: '/usr/share/ansible/openshift-ansible/playbooks/byo/config.yml'
description: Path to OpenShift-Ansible playbook. description: Path to OpenShift-Ansible playbook.
type: string type: string
OpenShiftMasterNodeVars:
default: {}
description: OpenShift node vars specific for the master nodes
type: json
OpenShiftWorkerNodeVars:
default: {}
description: OpenShift node vars specific for the worker nodes
type: json
outputs: outputs:
role_data: role_data:
@ -69,6 +76,13 @@ outputs:
state: directory state: directory
with_items: with_items:
- "{{playbook_dir}}/openshift" - "{{playbook_dir}}/openshift"
- name: set openshift global vars fact
set_fact:
openshift_global_vars: {get_param: OpenShiftGlobalVariables}
openshift_master_node_vars: {get_param: OpenShiftMasterNodeVars}
openshift_worker_node_vars: {get_param: OpenShiftWorkerNodeVars}
- name: generate openshift inventory - name: generate openshift inventory
copy: copy:
dest: "{{playbook_dir}}/openshift/inventory.yml" dest: "{{playbook_dir}}/openshift/inventory.yml"
@ -85,6 +99,10 @@ outputs:
openshift_public_ip: {{hostvars.raw_get(host)['ctlplane_ip']}} openshift_public_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
openshift_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}} openshift_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}}
openshift_public_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}} openshift_public_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}}
{% if openshift_master_node_vars -%}
{{openshift_master_node_vars | to_nice_yaml() | indent(6)}}
{%- endif %}
{% endfor %} {% endfor %}
nodes: nodes:
@ -103,6 +121,10 @@ outputs:
openshift_node_labels: openshift_node_labels:
region: 'infra' region: 'infra'
zone: 'default' zone: 'default'
{% if openshift_worker_node_vars -%}
{{openshift_worker_node_vars | to_nice_yaml() | indent(6)}}
{%- endif %}
{% endfor %} {% endfor %}
etcd: etcd:
@ -123,10 +145,6 @@ outputs:
openshift_use_dnsmasq: true openshift_use_dnsmasq: true
openshift_use_external_openvswitch: true openshift_use_external_openvswitch: true
- name: set openshift global vars fact
set_fact:
openshift_global_vars: {get_param: OpenShiftGlobalVariables}
- name: generate openshift global vars - name: generate openshift global vars
copy: copy:
dest: "{{playbook_dir}}/openshift/global_vars.yml" dest: "{{playbook_dir}}/openshift/global_vars.yml"