Debian 10 Playbook error

33 views
Skip to first unread message

Keith Mills

unread,
Jul 17, 2019, 10:06:31 AM7/17/19
to Ansible Project
I am trying to set up a new Debian 10 build server, and the first step is gaining the ability to ssh into the device from outside my local network. For whatever reason, this is proving to be difficult and I haven't the slightest clue why. When I try to ssh into my server with user@hostname, I get the error: 

ssh: Could not resolve hostname {hostname}: Name or service not known

When I try to ssh into my server with user@IPADDRESS it's successful

ping {hostname} : ping: {hostname}: Name or service not known
ping {IP}: successful

nslookup {hostname}: 

;; Got SERVFAIL reply from x.x.x.x, trying next server
Server:         x.x.x.x.
Address:       x.x.x.x.#53

** server can't find {hostname}: SERVFAIL

nslookup {IP}: successful



Ansible Playbook:

- hosts: buildservers
   remote_user: root
   roles:
     - buildservers


I'm trying to run ansible role on multiple servers, but i get an error:

fatal: [hostname]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname hostname: Name or service not known", "unreachable": true}

ansible-playbook -vvvv

ansible-playbook 2.8.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/kjames/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Apr  9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
Using /etc/ansible/ansible.cfg as config file

setting up inventory plugins
host_list declined parsing /home/kjames/ds9/buildservers-qa as it did not pass it's verify_file() method
script declined parsing /home/kjames/ds9/buildservers-qa as it did not pass it's verify_file() method
auto declined parsing /home/kjames/ds9/buildservers-qa as it did not pass it's verify_file() method
Not replacing invalid character(s) "set([u'-'])" in group name (RHEL7E-ARM)
[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default, this will change, but still be user
configurable on deprecation. This feature will be removed in version 2.10. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
 [WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details

Not replacing invalid character(s) "set([u'-'])" in group name (RHEL7E-ARM)
Parsed /home/kjames/ds9/buildservers-qa inventory source with ini plugin
statically imported: /home/kjames/ds9/roles/buildservers/tasks/regular-packages.yaml
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc

PLAYBOOK: new-buildserver.yaml *******************************************************************************************************************************************
Positional arguments: new-buildserver.yaml
ask_pass: True
check: True
become_method: sudo
inventory: (u'/home/kjames/ds9/buildservers-qa',)
forks: 5
tags: (u'all',)
verbosity: 4
connection: smart
timeout: 10
1 plays in new-buildserver.yaml

PLAY [buildservers] ******************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************
task path: /home/kjames/ds9/new-buildserver.yaml:13
<hostname> ESTABLISH SSH CONNECTION FOR USER: root
<hostname> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/home/kjames/.ansible/cp/2a56e2da62 hostname '/bin/sh -c '"'"'echo ~root && sleep 0'"'"''
<hostname> (255, '', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/home/kjames/.ansible/cp/2a56e2da62" does not exist\r\ndebug2: resolving "hostname" port 22\r\nssh: Could not resolve hostname hostname: Name or service not known\r\n')





Matt Zagrabelny

unread,
Jul 17, 2019, 10:20:04 AM7/17/19
to ansible...@googlegroups.com
Hey Keith,

On Wed, Jul 17, 2019 at 9:07 AM Keith Mills <mills....@gmail.com> wrote:
I am trying to set up a new Debian 10 build server, and the first step is gaining the ability to ssh into the device from outside my local network. For whatever reason, this is proving to be difficult and I haven't the slightest clue why. When I try to ssh into my server with user@hostname, I get the error: 

ssh: Could not resolve hostname {hostname}: Name or service not known

How are you expecting to translate names to IPs?

/etc/hosts

name server

-m

Keith Mills

unread,
Jul 17, 2019, 10:29:23 AM7/17/19
to Ansible Project
Hi Matt,

name server


On Wednesday, July 17, 2019 at 9:20:04 AM UTC-5, Matt Zagrabelny wrote:
Hey Keith,

Matt Zagrabelny

unread,
Jul 17, 2019, 10:33:29 AM7/17/19
to ansible...@googlegroups.com


On Wed, Jul 17, 2019 at 9:29 AM Keith Mills <mills....@gmail.com> wrote:
Hi Matt,

name server

If you query the name server:

dig @nameserver name.example.com

what do you get?

Name resolution is somewhat out of the scope of ansible.

-m

Keith Mills

unread,
Jul 17, 2019, 10:40:30 AM7/17/19
to Ansible Project
; <<>> DiG 9.9.4-RedHat-9.9.4-74.el7_6.1 <<>> @16.81.52.163 hwbldeb10ex6401.sde.rdlabs.hpecorp.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27051
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:

;; AUTHORITY SECTION:
sde.rdlabs.hpecorp.net. 3600    IN      SOA     hdc3.sde.rdlabs.hpecorp.net. ess-morpheus-admin.groups.int.hpe.com. 801754 900 600 86400 3600

;; Query time: 2 msec
;; SERVER: 16.81.52.163#53(16.81.52.163)
;; WHEN: Wed Jul 17 18:41:58 UTC 2019
;; MSG SIZE  rcvd: 167


On Wednesday, July 17, 2019 at 9:33:29 AM UTC-5, Matt Zagrabelny wrote:

Matt Zagrabelny

unread,
Jul 17, 2019, 10:47:19 AM7/17/19
to ansible...@googlegroups.com
Are you sure the A/AAAA records are present in the zone?

Did the zone get an updated serial?

Can you try querying the authoritative server directly for your zone?

-m

--
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/79931f72-a249-4bc9-a021-8194900ce25a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Keith Mills

unread,
Jul 17, 2019, 3:10:36 PM7/17/19
to Ansible Project
Issue resolved! The hostname was incorrect. Changed hostname and rebooted.


On Wednesday, July 17, 2019 at 9:47:19 AM UTC-5, Matt Zagrabelny wrote:
Are you sure the A/AAAA records are present in the zone?

Did the zone get an updated serial?

Can you try querying the authoritative server directly for your zone?

-m

To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages