openshift / openshift-ansible-contrib

Additional roles and playbooks for OpenShift installation and management
https://www.openshift.com
Apache License 2.0
283 stars 371 forks source link

console_port is undefined #877

Closed mgohashi closed 6 years ago

mgohashi commented 6 years ago

Hi guys,

I was trying to create an openshift env on GCE and I've got the following issue. I saw that it is defined in group_vars.

BUG REPORT

TASK [openshift_facts] ***** fatal: [ocp-master-kkwt]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ console_port }}: 'console_port' is undefined\n\nThe error appears to have been in '/home/mohashi/Projects/redhat/ref/openshift/openshift-gce/openshift-ansible/playbooks/common/openshift-master/config.yml': line 67, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n post_tasks:\n - openshift_facts:\n ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: {{ console_port }}: 'console_port' is undefined"}

PLAY RECAP ***** localhost : ok=37 changed=14 unreachable=0 failed=0
ocp-bastion : ok=5 changed=0 unreachable=0 failed=0
ocp-infra-node-cw4f : ok=124 changed=18 unreachable=0 failed=0
ocp-master-kkwt : ok=203 changed=50 unreachable=0 failed=1
ocp-node-czsf : ok=124 changed=18 unreachable=0 failed=0
ocp-node-qmfd : ok=124 changed=18 unreachable=0 failed=0

Failure summary:

  1. Hosts: ocp-master-kkwt Play: Gather and set facts for master hosts Task: openshift_facts Message: The task includes an option with an undefined variable. The error was: {{ console_port }}: 'console_port' is undefined

           The error appears to have been in '/home/mohashi/Projects/redhat/ref/openshift/openshift-gce/openshift-ansible/playbooks/common/openshift-master/config.yml': line 67, column 5, but may
           be elsewhere in the file depending on the exact syntax problem.
    
           The offending line appears to be:
    
             post_tasks:
             - openshift_facts:
               ^ here
    
           exception type: <class 'ansible.errors.AnsibleUndefinedVariable'>
           exception: {{ console_port }}: 'console_port' is undefined

BUG REPORT INFO

Environment

Copy of inventory files and custom variables used (please omit your secrets!):

Main Configuration Section for OCP on GCP reference architecture

Prefix for every resource name deployed. You can deploy multiple clusters

under single account with different prefixes and DNS configuration

prefix: 'ocp'

Username and password for Red Hat Customer Portal

rhsm_user: '' rhsm_password: ''

Pool name which shall be used to register the instances

rhsm_pool: ''

Path to a RHEL image on local machine, downloaded from Red Hat Customer Portal

rhel_image_path: '~/Downloads/rhel-server-7.4-x86_64-kvm.qcow2'

Choose to delete or retain the clean image during teardown

delete_image: false

Choose to delete or retain the gold image during teardown

delete_gold_image: false

Project ID and main zone settings for Google Cloud

gcloud_project: 'openshift-xxxxxx' gcloud_zone: 'us-east1-b'

Public DNS domain which will be configured in Google Cloud DNS

public_hosted_zone: 'ocp.xxxxx.com'

Public DNS name for the Master service

openshift_master_cluster_public_hostname: 'master.{{ public_hosted_zone }}'

Internal DNS name for the Master service

openshift_master_cluster_hostname: 'internal-master.{{ public_hosted_zone }}'

Domain name for the OpenShift applications

wildcard_zone: 'apps.{{ public_hosted_zone }}'

Paths on the local file system for the certificate files. If empty, self-signed

certificate will be generated

master_https_key_file: '' master_https_cert_file: ''

How many instances should be created for each group

master_instance_group_size: 1 infra_node_instance_group_size: 1 node_instance_group_size: 2

Machine types

bastion_machine_type: g1-small master_machine_type: n1-standard-4 infra_machine_type: n1-standard-2 node_machine_type: n1-standard-2

OpenShift deployment type

Use 'origin' to deploy OpenShift Origin on top of CentOS 7

openshift_deployment_type: openshift-enterprise

Deploy OpenShift within containers instead of RPMs?

containerized: false

OpenShift SDN selection

options are 'redhat/openshift-ovs-multitenant', 'redhat/openshift-ovs-subnet'

os_sdn_network_plugin_name: 'redhat/openshift-ovs-subnet'

Deploy OpenShift Metrics

openshift_hosted_metrics_deploy: true openshift_hosted_metrics_storage_volume_size: 20Gi

Deploy OpenShift Logging

Please note that ElasticSearch pod needs 8Gi of free RAM on a node, so you

will probably need at least 'n1-standard-4' size for infra nodes. Alternatively

for evaluation purposes, you can set 'openshift_logging_es_memory_limit'

variable to cca 4Gi, so it fits on the 'n1-standard-2' size of infra nodes.

openshift_hosted_logging_deploy: true openshift_logging_es_pvc_size: 100Gi

OpenShift Identity Providers. This is Google oauth example (hosted_domain is

optional and restricts login to users only from the specified domain)

Any identity provider can be configured here, for documentation see

https://docs.openshift.com/container-platform/latest/install_config/configuring_authentication.html#identity-providers-ansible

openshift_master_identity_providers:

Supplemental options

Disk sizes in GB

bastion_disk_size: 20 master_boot_disk_size: 45 master_docker_disk_size: 25 infra_boot_disk_size: 25 infra_docker_disk_size: 25 infra_openshift_disk_size: 50 node_boot_disk_size: 25 node_docker_disk_size: 25 node_openshift_disk_size: 50

Custom VPC Subnet, example value: '10.160.0.0/20'

Default value is empty, when random subnet in form of 10.x.0.0/20 will be used

gce_vpc_custom_subnet_cidr: ''

deployment_type: '{{ openshift_deployment_type }}'

console_port: 8443

Command used to invoke ansible:
./ocp-on-gcp.sh

Output of ansible run:
https://gist.github.com/mgohashi/3f117cdca37748df36a4977fe99c3547

Anything else do we need to know:

pschiffe commented 6 years ago

Thanks for the report, please try to use ansible 2.3 for now, 2.4 is broken. You can track the ansible issue here: https://github.com/ansible/ansible/issues/33177

pschiffe commented 6 years ago

The GCP ref. arch. code should now work even with ansible 2.4 thanks to https://github.com/openshift/openshift-ansible-contrib/commit/c0f0cccdfbda475906c17fe5e3a00239adddaaea