Closed oveits closed 6 years ago
The problem is caused by a wrong syntax in the inventory file:
correct:
[nodes]
ec2-35-156-161-11.eu-central-1.compute.amazonaws.com openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
ec2-35-156-161-17.eu-central-1.compute.amazonaws.com openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
wrong (missing single quotes):
[nodes]
ec2-35-156-161-11.eu-central-1.compute.amazonaws.com openshift_node_labels="{region: infra, zone: default}"
ec2-35-156-161-17.eu-central-1.compute.amazonaws.com openshift_node_labels="{region: infra, zone: default}"
This is caused by the last change https://github.com/oveits/openshift-terraform-ansible_installer/commit/a592d6ac090a6b2ea9751f2ebf6665da34361093 with automatic adaption of the inventory file.
Proposed solution:
in 2_install_openshift_via_ansible.sh
change line
NODES=`cat terraform.tfstate | grep ec2- | awk -F '"' -v master="$MASTER" ' $0 !~ master { print $4" openshift_node_labels=\"{\'region\': \'infra\', \'zone\': \'default\'}\"" }'`
by
NODES=`cat terraform.tfstate | grep ec2- | awk -F '"' -v master="$MASTER" ' $0 !~ master { print $4" openshift_node_labels=\"{'\''region'\'': '\''infra'\'', '\''zone'\'': '\''default'\''}\"" }'`
Note: for AWK, single quotes '
must be escaped with '\''
; i,e, end quote '
, escaped quote \'
and start quote'
. I had assumed that a single escape \'
is sufficient, but that is not true. '\''
looks weird, but it works. See http://stackoverflow.com/questions/9899001/how-to-escape-single-quote-in-awk-inside-printf.
Ansible installation fails with following log: