From de39f8a3ebf754ad4db1ffd67bd5295424b8956f Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Wed, 14 Mar 2018 17:24:40 +0100 Subject: [PATCH] Allow for passing boot-time vars/args to OC nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openshift-ansible allows for passing boot time arguments to the openshift nodes as well as other variables through the inventory. By adding the OpenShift(Master|Worker)NodeVars variable, we'll allow for these variables to be set and customized per deployment. Co-Authored-By: Martin André Change-Id: Ifc8d26fab314a89bf1855fd9035c2ad9be23c28a --- extraconfig/services/openshift-master.yaml | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/extraconfig/services/openshift-master.yaml b/extraconfig/services/openshift-master.yaml index 242699a13d..deefa627f1 100644 --- a/extraconfig/services/openshift-master.yaml +++ b/extraconfig/services/openshift-master.yaml @@ -32,7 +32,6 @@ parameters: description: Mapping of service endpoint -> protocol. Typically set via parameter_defaults in the resource registry. type: json - OpenShiftGlobalVariables: default: {} description: Global Ansible variables for OpenShift-Ansible installer. @@ -41,6 +40,14 @@ parameters: default: '/usr/share/ansible/openshift-ansible/playbooks/byo/config.yml' description: Path to OpenShift-Ansible playbook. 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: role_data: @@ -69,6 +76,13 @@ outputs: state: directory with_items: - "{{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 copy: dest: "{{playbook_dir}}/openshift/inventory.yml" @@ -85,6 +99,10 @@ outputs: openshift_public_ip: {{hostvars.raw_get(host)['ctlplane_ip']}} openshift_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 %} nodes: @@ -103,6 +121,10 @@ outputs: openshift_node_labels: region: 'infra' zone: 'default' + {% if openshift_worker_node_vars -%} + {{openshift_worker_node_vars | to_nice_yaml() | indent(6)}} + {%- endif %} + {% endfor %} etcd: @@ -123,10 +145,6 @@ outputs: openshift_use_dnsmasq: 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 copy: dest: "{{playbook_dir}}/openshift/global_vars.yml"