Unable to connect to remote host on Ansible Tower setup

3,076 views
Skip to first unread message

Spyridoula Tragopoulou

unread,
Oct 12, 2018, 10:34:36 AM10/12/18
to AWX Project
Hi everyone,

I am trying to run ./setup.sh using only remote host but I am getting this error:

TASK [config_dynamic : Ensure user is root] **************************************************************************************************************************************
fatal: [10.192.1.196]: FAILED! => {"changed": false, "msg": "UID on remote machine is 1000 (0 required). Check Ansible connection and become settings."}


Please find below the inventory file that I am using. I am using the root user of this machine to connect and also when ansible tries to connect to my host, everything is OK.

TASK [config_dynamic : Ensure connectivity to hosts and gather facts] ************************************************************************************************************
ok: [10.192.1.196]



-------------------------------------------------------------------------------------------------------------------------------------------

[tower]
10.192.1.196 ansible_connection=ssh ansible_ssh_user=javier ansible_ssh_password=password

[database]
10.192.1.196

[all:vars]
admin_password='password'

pg_host='10.192.1.196'
pg_port='5432'

pg_database='awx'
pg_username='awx'
pg_password='password'

rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password='password'
rabbitmq_cookie=rabbitmqcookie

# Needs to be true for fqdns and ip addresses
rabbitmq_use_long_name=true
# Needs to remain false if you are using localhost

----------------------------------------------------------------------------------------------------------------------------------

Any help will be appreciated.

Spyridoula

Christopher Meyers

unread,
Oct 12, 2018, 10:46:54 AM10/12/18
to strago...@gmail.com, AWX Project
Spyridoula,

It looks like maybe your user isn't a root user, but is capable of becoming root (i.e. sudo). If that's the case then you want to invoke setup.sh using something like this:
ANSIBLE_BECOME=true ./setup.sh 

Alternatively you can convey the become in your inventory file, instead of via an env var.

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/3a3b0314-5566-4460-9251-04a8a9d1d159%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

CHRIS MEYERS

SENIOR SOFTWARE ENGINEER, TOWERREWARD ZONE AMBASSADOR

Red Hat 

cme...@redhat.com   


Spyridoula Tragopoulou

unread,
Oct 12, 2018, 10:57:37 AM10/12/18
to AWX Project
Hi Chris,

Thank you very much for your immediate reply.

Well, I tried both solutions you suggested but now I am not even able to connect to host.

Firstly, I added I run the setup like this: ANSIBLE_BECOME=true ./setup.sh.
Also, I added ansible_become=true on the inventory file.

For both cases I received the error below:

TASK [config_dynamic : Ensure connectivity to hosts and gather facts] ************************************************************************************************************
fatal: [10.192.1.196]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 10.192.1.196 closed.\r\n", "module_stdout": "sudo: a password is required\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Christopher Meyers

unread,
Oct 12, 2018, 11:14:23 AM10/12/18
to strago...@gmail.com, AWX Project
Ok, sounds like your user is a added to the root group then; while the install playbook assumes you would be installing as THE root user (uid=0). I would recommend commenting out that preflight check. Ideally, we would make sure the user is in either uid=0 or gid=0.


For more options, visit https://groups.google.com/d/optout.

Spyridoula Tragopoulou

unread,
Oct 12, 2018, 11:31:13 AM10/12/18
to AWX Project
Could you please explain in more detail how to comment out this check?
I searched in install.yml for this step (TASK [config_dynamic : Ensure user is root) but I cannot find it.

Ryan Petrello

unread,
Oct 12, 2018, 11:40:17 AM10/12/18
to AWX Project
Spyridoula,

This mailing list is specific to the open source Ansible AWX project.  If you're having trouble installing Red Hat Ansible Tower, please reach out a Red Hat support representative.
Reply all
Reply to author
Forward
0 new messages