# Debian 10 Playbook error

**URL:** <https://forum.ansible.com/t/debian-10-playbook-error/30801>\
**Category:** Ansible Project\
**Created:** [July 17, 2019, 2:06pm UTC](https://forum.ansible.com/t/debian-10-playbook-error/30801 "2019-07-17T14:06:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keith\_Mills](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Keith\_Mills](https://forum.ansible.com/u/Keith_Mills)\
**Post date:** [July 17, 2019, 2:06pm UTC](https://forum.ansible.com/t/debian-10-playbook-error/30801/1 "2019-07-17T14:06:31Z")

</div>

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  
 ESTABLISH SSH CONNECTION FOR USER: root  
 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’”’"‘’  
 (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’)

---

<div class="post-metadata">

**Author:** ![mzagrabe](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@mzagrabe](https://forum.ansible.com/u/mzagrabe)\
**Post date:** [July 17, 2019, 2:18pm UTC](https://forum.ansible.com/t/debian-10-playbook-error/30801/2 "2019-07-17T14:18:32Z")

</div>

Hey Keith,

---

<div class="post-metadata">

**Author:** ![Keith\_Mills](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Keith\_Mills](https://forum.ansible.com/u/Keith_Mills)\
**Post date:** [July 17, 2019, 2:29pm UTC](https://forum.ansible.com/t/debian-10-playbook-error/30801/3 "2019-07-17T14:29:22Z")

</div>

Hi Matt,

name server

---

<div class="post-metadata">

**Author:** ![mzagrabe](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@mzagrabe](https://forum.ansible.com/u/mzagrabe)\
**Post date:** [July 17, 2019, 2:33pm UTC](https://forum.ansible.com/t/debian-10-playbook-error/30801/4 "2019-07-17T14:33:05Z")

</div>

If you query the name server:

dig @nameserver [name.example.com](http://name.example.com)

what do you get?

Name resolution is somewhat out of the scope of ansible.

-m

---

<div class="post-metadata">

**Author:** ![Keith\_Mills](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Keith\_Mills](https://forum.ansible.com/u/Keith_Mills)\
**Post date:** [July 17, 2019, 2:40pm UTC](https://forum.ansible.com/t/debian-10-playbook-error/30801/5 "2019-07-17T14:40:30Z")

</div>

; \<\<\>\> DiG 9.9.4-RedHat-9.9.4-74.el7\_6.1 \<\<\>\> @16.81.52.163 [hwbldeb10ex6401.sde.rdlabs.hpecorp.net](http://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:  
;[hwbldeb10ex6401.sde.rdlabs.hpecorp.net](http://hwbldeb10ex6401.sde.rdlabs.hpecorp.net). IN A

;; AUTHORITY SECTION:  
[sde.rdlabs.hpecorp.net](http://sde.rdlabs.hpecorp.net). 3600 IN SOA [hdc3.sde.rdlabs.hpecorp.net](http://hdc3.sde.rdlabs.hpecorp.net). [ess-morpheus-admin.groups.int.hpe.com](http://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

---

<div class="post-metadata">

**Author:** ![mzagrabe](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@mzagrabe](https://forum.ansible.com/u/mzagrabe)\
**Post date:** [July 17, 2019, 2:45pm UTC](https://forum.ansible.com/t/debian-10-playbook-error/30801/6 "2019-07-17T14:45:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Keith\_Mills](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Keith\_Mills](https://forum.ansible.com/u/Keith_Mills)\
**Post date:** [July 17, 2019, 7:10pm UTC](https://forum.ansible.com/t/debian-10-playbook-error/30801/7 "2019-07-17T19:10:36Z")

</div>

Issue resolved! The hostname was incorrect. Changed hostname and rebooted.
