New User First Issue discrepancy between ansible & tower

17 views
Skip to first unread message

joel....@gmail.com

unread,
Apr 12, 2019, 11:28:42 AM4/12/19
to Ansible Project
Ansible works, a single playbook "helloworld.yml" works via cmd line. Yet in tower it doesn't. My hosts file is very simple (just 1 IP).


ansible]$ cat hosts
# This is the default ansible 'hosts' file.
#
# It should live in /etc/ansible/hosts
#
#   - Comments begin with the '#' character
#   - Blank lines are ignored
#   - Groups of hosts are delimited by [header] elements
#   - You can enter hostnames or ip addresses
#   - A hostname/ip can be a member of multiple groups

# Ex 1: Ungrouped hosts, specify before any group headers.

## 192.168.100.1
10.244.193.34

# Ex 2: A collection of hosts belonging to the 'webservers' group

## [webservers]
## 192.168.1.100
## 192.168.1.110

# If you have multiple hosts following a pattern you can specify
# them like this:

## www[001:006].example.com

# Ex 3: A collection of database servers in the 'dbservers' group

## [dbservers]
##
## 10.25.1.56
## 10.25.1.57

# Here's another example of host ranges, this time there are no
# leading 0s:

## db-[99:101]-node.example.com

============================================================
cat helloworld.yml
---
- name: Hello World!
  hosts: all

  tasks:

  - name: Hello World!
    shell: echo "Hi! Tower is working!"



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

ansible-playbook helloworld.yml -f 10

PLAY [Hello World!] ************************************************************

TASK [Gathering Facts] *********************************************************
ok: [10.244.193.34]

TASK [Hello World!] ************************************************************
changed: [10.244.193.34]

PLAY RECAP *********************************************************************
10.244.193.34              : ok=2    changed=1    unreachable=0    failed=0

[cyc@cicdcyc-frobes-1-00 helloworld]$
====================================================================

but in tower it fails...

PLAY [Hello World!] ************************************************************
11:28:18
3
4
TASK [Gathering Facts] *********************************************************
11:28:18
5
fatal: [10.244.193.34]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '10.244.193.34' (ECDSA) to the list of known hosts.\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n", "unreachable": true}
6
7
PLAY RECAP *********************************************************************
11:28:18
8
10.244.193.34 : ok=0 changed=0 unreachable=1 failed=0
9


d...@linder.org

unread,
Apr 13, 2019, 9:46:43 AM4/13/19
to Ansible Project
Really looks like your credentials in Tower aren't properly setup properly.

Double check that the ssh key or userid/password you're using in Tower are valid and work with the 10.244.193.34 system.

If that fails, run the play with verbosity set to 3 or 4, and get onto the remote system to review the sshd log files for additional information and post that back here for us to look into.

Jon Stanley

unread,
Apr 15, 2019, 10:12:01 AM4/15/19
to ansible...@googlegroups.com
Did you set up the private key as a credential in Tower? It would appear that you can't authenticate to the remote host when you run via tower. In the UI, there's an option for what credential to use for the job template. I don't have an instance in front of me to walk you through it exactly, but that should set you on the right track.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5b15d286-611e-47d4-87e9-ff564b311849%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages