cloudera/cloudera-playbook

"AnsibleUndefinedVariable: 'ansible.parsing.yaml.objects.AnsibleUnicode object' has no attribute u'leon-test-1.test.com'"

leonlxw opened this issue · 3 comments

Basically running playbook from CM host and getting below error, tried lot of things however could not figure out what is going wrong.

PLAY [Install CDH] ************************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************
ok: [leon-test-1.test.com]

TASK [cdh : include_vars] *****************************************************************************************************************************
ok: [leon-test-1.test.com]

TASK [cdh : include_vars] *****************************************************************************************************************************
ok: [leon-test-1.test.com]

TASK [cdh : include_vars] *****************************************************************************************************************************
ok: [leon-test-1.test.com]

TASK [cdh : include_vars] *****************************************************************************************************************************
ok: [leon-test-1.test.com]

TASK [cdh : Check whether cluster exists] *************************************************************************************************************
ok: [leon-test-1.test.com]

TASK [cdh : set_fact] *********************************************************************************************************************************
ok: [leon-test-1.test.com]

TASK [cdh : debug] ************************************************************************************************************************************
ok: [leon-test-1.test.com] => {
"msg": "Cluster 'cluster_1' exists - False"
}

TASK [cdh : Prepare cluster template] *****************************************************************************************************************
fatal: [leon-test-1.test.com -> localhost]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.parsing.yaml.objects.AnsibleUnicode object' has no attribute u'leon-test-1.test.com'"}
to retry, use: --limit @/root/shell/cluster-script/test/cloudera-playbook-master/cdh.retry

PLAY RECAP ********************************************************************************************************************************************
leon-test-1.test.com : ok=8 changed=0 unreachable=0 failed=1

=============================

hosts
[scm_server]
leon-test-1.test.com license_file=/path/to/cloudera_license.txt

[db_server]
leon-test-1.test.com

[krb5_server]
leon-test-1.test.com default_realm=

[utility_servers:children]
scm_server
db_server
krb5_server

[gateway_servers]
leon-test-1.test.com host_template=HostTemplate-Gateway role_ref_names=HDFS-HTTPFS-1

[master_servers]
leon-test-1.test.com host_template=HostTemplate-Master1
leon-test-2.test.com host_template=HostTemplate-Master2
leon-test-3.test.com host_template=HostTemplate-Master3

[worker_servers]
leon-test-3.test.com
leon-test-4.test.com
leon-test-5.test.com

[worker_servers:vars]
host_template=HostTemplate-Workers

[cdh_servers:children]
utility_servers
gateway_servers
master_servers
worker_servers

Hi,

Im also facing the same issue. Getting error on scm template task. I have modified the inventory file with FQDN also and I have done all possible things but couldn't figure out what is the issue. Appreciated if anyone can provide us quick solution.

TASK [scm : Prepare CMS template] ****************************************************************************
task path: /root/cloudera-playbook/roles/scm/tasks/cms.yml:9

fatal: [cloudera1.rlcatalyst.com]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute u'cloudera1.rlcatalyst.com'"}

===================================================================
Inventory file details:
[root@ansible] cat hosts

Note for AWS: 'Public DNS' name is too long for ansible_host, use 'Public IP' (ansible/ansible#11536)

[scm_server]
cloudera1.rlcatalyst.com license_file=/path/to/cloudera_license.txt

[db_server]
cloudera1.rlcatalyst.com

[utility_servers:children]
scm_server
db_server

[gateway_servers]
clouderagw.rlcatalyst.com host_template=HostTemplate-Gateway role_ref_names=HDFS-HTTPFS-1

[master_servers]
cloudera1.rlcatalyst.com host_template=HostTemplate-Master1

[worker_servers]
cloudera2.rlcatalyst.com

[worker_servers:vars]
host_template=HostTemplate-Workers

[cdh_servers:children]
utility_servers
gateway_servers
master_servers
worker_servers

[all:vars]
ansible_user=root

lhoss commented

I also had such issues with the role, but after many fixes and improvments, I got it working to deploy a cluster on AWS, and for latest CDH-6.2 !
As a passionate open source contributor, I created nice PRs with the various improvements (waiting to be accepted, since days ago I submitted contributor paperwork),
but I suggest you and others having issues, to try out my branch https://github.com/scigility/cloudera-playbook/tree/scigility that contains all my fixes (but just does not contain any upstream commits since the 20.5.2019)

Hello. This issue would occur if the hostnames in inventory file are different to the hostnames reported by each node's Cloudera Manager agent. Using short names instead of FQDNs is one possibility, and DNS configuration (or misconfiguration) is another.

Closing as duplicate of #22.