Ansible failing with 'No Route to Host' .

1,045 views
Skip to first unread message

Marcos Georgopoulos

unread,
Jun 1, 2018, 6:47:35 AM6/1/18
to Ansible Project
Hi,

I am running a playbook against a RHEL 7.4 image which sits behind a proxy.  SELINUX and the firewall have been disabled.  I am using Ansible 2.5.3

Here is the task

- name: Add Docker repository.

  get_url:

    url: "{{ docker_yum_repo_url }}"

    dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'

    owner: root

    group: root

    mode: 0644

    use_proxy: yes




fatal: [10.40.12.136]: FAILED! => changed=false 

  invocation:

    module_args:

      attributes: null

      backup: null

      checksum: ''

      client_cert: null

      client_key: null

      content: null

      delimiter: null

      dest: /etc/yum.repos.d/docker-ce.repo

      directory_mode: null

      follow: false

      force: false

      force_basic_auth: false

      group: root

      headers: null

      http_agent: ansible-httpget

      mode: 420

      owner: root

      regexp: null

      remote_src: null

      selevel: null

      serole: null

      setype: null

      seuser: null

      sha256sum: ''

      src: null

      timeout: 10

      tmp_dest: null

      unsafe_writes: null

      url: https://download.docker.com/linux/centos/docker-ce.repo

      url_password: null

      url_username: null

      use_proxy: true

      validate_certs: true

  msg: 'Failed to connect to download.docker.com at port 443: [Errno 113] No route to host'



If I ssh into the server I can wget or curl the file with no issue at all and as you can see the module is been configured to use my proxy.  


Any ideas? this is driving me insane.


thanks.

Mohd Aftab

unread,
Jun 1, 2018, 2:03:10 PM6/1/18
to ansible...@googlegroups.com
This works for me

---
- hosts: local
  tasks:
  - name: Download file from a file path
    get_url:
     dest: /tmp/docker.repo
  - file:
     path: /tmp/docker.repo
     owner: root
     group: root
     mode: 0644


Regards
Aftab

--
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-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d9d3e268-825a-4c8d-b42e-b0dea4cc94c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages