diff --git a/reference-architecture/vmware-ansible/ocp-on-vmware.py b/reference-architecture/vmware-ansible/ocp-on-vmware.py index b4d6511a6..ac0a07573 100755 --- a/reference-architecture/vmware-ansible/ocp-on-vmware.py +++ b/reference-architecture/vmware-ansible/ocp-on-vmware.py @@ -481,7 +481,16 @@ def _create_ocp_vars(self): if not self.no_confirm: click.confirm('Continue using these values?', abort=True) - if self.auth_type == 'ldap': + if self.auth_type == 'none': + playbooks = ["playbooks/ocp-install.yaml", "playbooks/minor-update.yaml"] + for ocp_file in playbooks: + for line in fileinput.input(ocp_file, inplace=True): + if line.startswith('#openshift_master_identity_providers:'): + line = line.replace('#', ' ') + print line + else: + print line, + elif self.auth_type == 'ldap': l_bdn = "" for d in self.ldap_fqdn.split("."): @@ -550,15 +559,11 @@ def _create_ocp_vars(self): else: print line, - if self.auth_type == 'none': - playbooks = ["playbooks/ocp-install.yaml", "playbooks/minor-update.yaml"] - for ocp_file in playbooks: - for line in fileinput.input(ocp_file, inplace=True): - if line.startswith('#openshift_master_identity_providers:'): - line = line.replace('#', ' ') - print line - else: - print line, + else: + print ("'auth_type' configuration has improper value '%s'. " + "It is allowed to be either " + "'ldap' or 'none'." % self.auth_type) + exit(1) if self.args.create_ocp_vars: exit(0)