Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnsibleUndefinedVariable: 'dict object' has not attribute u'xxx.xxx.xxx.xxx'" #76

Open
gdrabla opened this issue Apr 4, 2021 · 1 comment

Comments

@gdrabla
Copy link

gdrabla commented Apr 4, 2021

@roczei - I'm executing playbook from local vm machine (its single node vm, CM is installed on VM), getting error - AnsibleUndefinedVariable: 'dict object' has not attribute u'xxx.xxx.xxx.xxx'"

TASK [scm : Wait for agent heartbeats] *************************************************************************************************************************************************************************************************************************************************************************************************************************************
Pausing for 30 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
Press 'C' to continue the play or 'A' to abort
ok: [xxx.xxx.xxx.xxx

TASK [scm : Prepare CMS template] ****************************************************************************************************************************************
fatal: [xxx.xxx.xxx.xxx]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute u'xxx.xxx.xxx.xxx'"}

Please note i'm using ip address : 127.0. 0.1., please guide me how to use FQDN name in this case instead of IP address -
/etc/host file look as below -
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost6.localdomain6 localhost6

host file look as below -

[local]
127.0.0.1

[scm_server]
127.0.0.1

[db_server]
127.0.0.1

[utility_servers:children]
scm_server
db_server

#[krb5_server]
#127.0.0.1

@Jimvin
Copy link
Contributor

Jimvin commented Apr 5, 2021

What's most likely happening here is the Cloudera Manager agent is registering itself with the IP address associated with its hostname and not 127.0.0.1. When you come to create a template it checks to see if the host you've specified in the inventory exists in Cloudera Manager's list of hosts and it doesn't. Try looking at the hosts in Cloudera Manager and see what's in there, it should confirm what I am saying.
I would suggest assigning a hostname to your VM and adding the hostname/IP mapping to /etc/hosts rather than using a bare IP address. Remember, you can always check the contents of the hosts page in Cloudera Manager at this stage if the build fails to confirm what it thinks the current state of the hosts is, including their names and IP addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants